1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 12:15:34 -04:00

make the main content/blog section configurable instead of hardcoded to notes

This commit is contained in:
2020-04-13 17:25:29 -04:00
parent c1700cdda0
commit abbc3f9678
12 changed files with 25 additions and 21 deletions

View File

@@ -10,7 +10,7 @@
{{ partialCached "head/feeds" . -}}
{{ partialCached "head/webmention" . -}}
<link rel="author" href="{{ "humans.txt" | absURL }}">
{{ if and .IsPage (eq .Type "notes") }}
{{ if and .IsPage (eq .Type .Site.Params.mainSection) }}
{{- with .OutputFormats.Get "amp" -}}
<link rel="amphtml" href="{{ .Permalink }}">
{{- end }}

View File

@@ -1,6 +1,6 @@
<meta property="og:title" content="{{ .Title }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="{{ if and .IsPage (eq .Type "notes") }}article{{ else }}website{{ end }}">
<meta property="og:type" content="{{ if and .IsPage (eq .Type .Site.Params.mainSection) }}article{{ else }}website{{ end }}">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
@@ -10,7 +10,7 @@
<meta property="og:image:height" content="{{ .Scratch.Get "socialImage_height" }}">
<meta property="og:image:alt" content="{{ .Title }}">
{{- if and .IsPage (eq .Type "notes") }}
{{- if and .IsPage (eq .Type .Site.Params.mainSection) }}
{{- if not .PublishDate.IsZero }}
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">
<meta property="article:modified_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}">

View File

@@ -1,6 +1,6 @@
{{ if eq hugo.Environment "production" }}
<link rel="preconnect" href="https://s.jarv.is" crossorigin>
{{ if and .IsPage (and (eq .Type "notes") (ne .Params.comments false)) }}
{{ if and .IsPage (and (eq .Type .Site.Params.mainSection) (ne .Params.comments false)) }}
<link rel="preconnect" href="https://utteranc.es" crossorigin>
<link rel="preconnect" href="https://api.utteranc.es" crossorigin>
<link rel="preconnect" href="https://api.github.com" crossorigin>

View File

@@ -6,7 +6,7 @@
<div id="poweredby">
<a class="no-underline" href="https://gohugo.io/" title="Powered by Hugo" id="hugo" target="_blank" rel="noopener">Made with <span class="beat">&#x2764;</span> and Hugo.</a>
{{ with .Site.Params.gitRepo }}<a class="no-underline" href="{{ . }}" title="View Source on GitHub" id="source" target="_blank" rel="noopener">View source.</a>{{ end }}
{{ with .Site.Params.github }}<a class="no-underline" href="https://github.com/{{ . }}" title="View Source on GitHub" id="source" target="_blank" rel="noopener">View source.</a>{{ end }}
</div>
</div>
</footer>

View File

@@ -1,6 +1,6 @@
<script async defer
src="https://utteranc.es/client.js"
data-repo="{{ .Site.Params.utterancesRepo }}"
data-repo="{{ .Site.Params.github }}"
data-issue-term="og:title"
data-label="comments"
data-theme="github-light"