From abbc3f96782fbec7ed5d2754d01938bf4adf649c Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 13 Apr 2020 17:25:29 -0400 Subject: [PATCH] make the main content/blog section configurable instead of hardcoded to notes --- config.toml | 6 +++--- content/_index.html | 2 +- layouts/_default/single.html | 2 +- layouts/index.atom | 2 +- layouts/partials/head/head.html | 2 +- layouts/partials/head/open-graph.html | 4 ++-- layouts/partials/head/preload.html | 2 +- layouts/partials/page/footer.html | 2 +- layouts/partials/scripts/utterances.html | 2 +- layouts/rss.xml | 2 +- netlify.toml | 5 +++++ yarn.lock | 15 +++++++-------- 12 files changed, 25 insertions(+), 21 deletions(-) diff --git a/config.toml b/config.toml index 1cb3f24c..d6e530d9 100644 --- a/config.toml +++ b/config.toml @@ -24,16 +24,16 @@ disableAliases = true [params] description = "Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in modern JavaScript frameworks and progressive web apps." domain = "jarv.is" + mainSection = "notes" pageMaxWidth = 910 - facebookAppID = "3357248167622283" - gitRepo = "https://github.com/jakejarvis/jarv.is" defaultImage = "/me_large.jpg" + github = "jakejarvis/jarv.is" + facebookAppID = "3357248167622283" copyrightFirstYear = "2001" wayback = "https://web.archive.org/web/20010501000000*/jakejarvis.com" license = "CC-BY-4.0" licenseFull = "Creative Commons Attribution 4.0 International" licenseURL = "https://creativecommons.org/licenses/by/4.0/" - utterancesRepo = "jakejarvis/jarv.is" [module] [[module.imports]] diff --git a/content/_index.html b/content/_index.html index ad72a04f..3f36ebb3 100644 --- a/content/_index.html +++ b/content/_index.html @@ -1,6 +1,6 @@ --- title: "Jake Jarvis – Front-End Web Developer in Boston, MA" -date: 2020-04-05 15:46:35-0400 +date: 2020-04-13 16:07:02-0400 type: home --- diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa1079a6..ddfebfe5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,7 @@
- {{ .Date.Format "January 2, 2006" }}{{ with .Site.Params.gitRepo }}Improve This Post{{ end }} + {{ .Date.Format "January 2, 2006" }}{{ with .Site.Params.github }}Improve This Post{{ end }}

{{ .Title | markdownify }}

diff --git a/layouts/index.atom b/layouts/index.atom index 1659a748..b11af437 100644 --- a/layouts/index.atom +++ b/layouts/index.atom @@ -20,7 +20,7 @@ {{- range .AlternativeOutputFormats }} {{ printf `` .MediaType.Type .Permalink | safeHTML }} {{- end }} - {{- range (where .Site.RegularPages "Section" "notes") }} + {{- range (where .Site.RegularPages "Section" .Site.Params.mainSection) }} {{ .Title }} {{- with .Site.Author.name }} diff --git a/layouts/partials/head/head.html b/layouts/partials/head/head.html index fefa8f15..0bed731a 100644 --- a/layouts/partials/head/head.html +++ b/layouts/partials/head/head.html @@ -10,7 +10,7 @@ {{ partialCached "head/feeds" . -}} {{ partialCached "head/webmention" . -}} -{{ if and .IsPage (eq .Type "notes") }} +{{ if and .IsPage (eq .Type .Site.Params.mainSection) }} {{- with .OutputFormats.Get "amp" -}} {{- end }} diff --git a/layouts/partials/head/open-graph.html b/layouts/partials/head/open-graph.html index 67eba4b9..820c1bfe 100644 --- a/layouts/partials/head/open-graph.html +++ b/layouts/partials/head/open-graph.html @@ -1,6 +1,6 @@ - + @@ -10,7 +10,7 @@ -{{- if and .IsPage (eq .Type "notes") }} +{{- if and .IsPage (eq .Type .Site.Params.mainSection) }} {{- if not .PublishDate.IsZero }} diff --git a/layouts/partials/head/preload.html b/layouts/partials/head/preload.html index e3543df6..423d0cd9 100644 --- a/layouts/partials/head/preload.html +++ b/layouts/partials/head/preload.html @@ -1,6 +1,6 @@ {{ if eq hugo.Environment "production" }} - {{ if and .IsPage (and (eq .Type "notes") (ne .Params.comments false)) }} + {{ if and .IsPage (and (eq .Type .Site.Params.mainSection) (ne .Params.comments false)) }} diff --git a/layouts/partials/page/footer.html b/layouts/partials/page/footer.html index 773eede8..37048135 100644 --- a/layouts/partials/page/footer.html +++ b/layouts/partials/page/footer.html @@ -6,7 +6,7 @@
Made with and Hugo. - {{ with .Site.Params.gitRepo }}View source.{{ end }} + {{ with .Site.Params.github }}View source.{{ end }}
diff --git a/layouts/partials/scripts/utterances.html b/layouts/partials/scripts/utterances.html index db4ca731..26ccbfd7 100644 --- a/layouts/partials/scripts/utterances.html +++ b/layouts/partials/scripts/utterances.html @@ -1,6 +1,6 @@