Merge pull request #1 from iamthomastaylor/add-changes

Update `bearcub` to incorporate my preferences
This commit is contained in:
Thomas T 2023-12-29 02:29:40 -05:00 committed by GitHub
commit 7d0fd1a5a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 16 deletions

View file

@ -6,10 +6,18 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{- partial "favicon.html" . -}}
{{ if .IsHome }}
<title>{{ .Site.Title }}</title>
{{ else }}
<title>{{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }}</title>
{{ end }}
{{- partial "seo_tags.html" . -}}
<meta name="referrer" content="no-referrer-when-downgrade" />
<script
data-goatcounter="{{ .Site.Params.goatcounter }}"
async src="https://gc.zgo.at/count.js">
</script>
{{ $style := resources.Get "style.css" | minify }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet">
@ -40,6 +48,7 @@
</header>
<main id="main-content">
{{- block "main" . }}{{- end }}
{{- partial "custom_main.html" . -}}
</main>
<footer>
{{- partial "footer.html" . -}}

View file

@ -1,7 +1,12 @@
{{ define "main" }}
<content>
{{ if .Data.Singular }}
<h3 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h3>
<h1 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h1>
{{ else }}
<h1 class="blog-filter">{{ .Title }}</h1>
{{ $t := .Site.GetPage "tags"}}
{{ $c := .Site.GetPage "categories"}}
<p>{{ .Pages.Len }} posts sortable by <a href="{{ $c.Permalink }}">categories</a> or <a href="{{ $t.Permalink }}">tags</a>.</p>
{{ end }}
<ul class="blog-posts">
{{ range .Pages }}
@ -25,12 +30,5 @@
</li>
{{ end }}
</ul>
{{ if not .Data.Singular }}
<div>
{{ range .Site.Taxonomies.tags }}
<a class="blog-tags" href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>&nbsp;&nbsp;
{{ end }}
</div>
{{ end }}
</content>
{{ end }}

View file

@ -18,7 +18,6 @@
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if not .IsHome }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
@ -39,4 +38,4 @@
</item>
{{ end }}
</channel>
</rss>
</rss>

View file

@ -16,11 +16,16 @@
<a class="blog-tags" href="{{ .Permalink }}">#{{ .LinkTitle }}</a>&nbsp;&nbsp;
{{ end }}
</p>
{{ with .Site.Social.email }}
{{ with .Site.Params.social.email }}
<p>
<a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'>
{{ i18n "email-reply" }} ↪
</a>
</p>
{{ end }}
<p>
<a href="https://weeklywtf.beehiiv.com/subscribe">
Subscribe to weekly tech news →
</a>
</p>
{{ end }}

View file

@ -0,0 +1,25 @@
{{ if .IsHome }}
{{ $pages := first .Site.Params.latestPostsCount (where .Site.RegularPages "Section" "blog") }}
<ul class="blog-posts">
{{ range $pages }}
<li>
<span>
<i>
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
</time>
</i>
</span>
{{ if .Params.link }}
<a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
{{ else }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
</li>
{{ else }}
<li>
{{ i18n "no-posts" }}
</li>
{{ end }}
</ul>
{{ end }}

View file

@ -1,3 +1,3 @@
<small>
{{ .Site.Copyright }} | {{ markdownify .Site.Params.madeWith }}
</small>
{{ .Site.Copyright }}
</small>

View file

@ -1,7 +1,6 @@
{{ range .Site.Menus.main.ByWeight }}
<a href="{{ .URL }}">{{ .Name }}</a>
<a href="{{ .URL }}">{{ lower .Name }}</a>
{{ end }}
<a href='{{ absURL "index.xml" }}'>RSS</a>
<!-- Convert this page's translations into a dict -->
{{ $translations := dict }}

View file

@ -73,7 +73,7 @@
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{ with .Site.Social.twitter -}}
{{ with .Site.Params.social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end -}}