From 696731b1b56b09bfd0313d58e31df9ebf971ddac Mon Sep 17 00:00:00 2001 From: steverusso Date: Fri, 12 Jun 2020 00:42:10 +0000 Subject: [PATCH] Refactors and project cleanup (#18) Disable taxonomy types. Put the simple software data in the home page content file. Navbar can be cached. Make the CSS assets and bundle the global CSS. Can cache the scripts and the footer. Global CSS and JS partials. These don't make any sense. Fix baseof titling. Move navbar and footer out of directories where they are the only files, update base template. Reviewed-by: jeff --- {static => assets}/icons.css | 0 {static => assets}/light-theme.css | 0 {static => assets}/simplesystems.css | 0 config.toml | 1 + data/home/ssattrs.json => content/_index.md | 5 ++++- layouts/_default/baseof.html | 18 ++++++------------ layouts/_default/section.html | 2 -- layouts/index.html | 2 +- layouts/partials/css-global.html | 8 ++++++++ .../{footer/site-footer.html => footer.html} | 0 .../{scripts/scripts.html => js-global.html} | 0 .../{navbar/site-navbar.html => navbar.html} | 0 layouts/partials/simple-software.html | 2 +- layouts/section/blog.html | 2 -- layouts/section/jobs.html | 2 -- 15 files changed, 21 insertions(+), 21 deletions(-) rename {static => assets}/icons.css (100%) rename {static => assets}/light-theme.css (100%) rename {static => assets}/simplesystems.css (100%) rename data/home/ssattrs.json => content/_index.md (97%) create mode 100644 layouts/partials/css-global.html rename layouts/partials/{footer/site-footer.html => footer.html} (100%) rename layouts/partials/{scripts/scripts.html => js-global.html} (100%) rename layouts/partials/{navbar/site-navbar.html => navbar.html} (100%) diff --git a/static/icons.css b/assets/icons.css similarity index 100% rename from static/icons.css rename to assets/icons.css diff --git a/static/light-theme.css b/assets/light-theme.css similarity index 100% rename from static/light-theme.css rename to assets/light-theme.css diff --git a/static/simplesystems.css b/assets/simplesystems.css similarity index 100% rename from static/simplesystems.css rename to assets/simplesystems.css diff --git a/config.toml b/config.toml index 2e4c528..ac8095d 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,5 @@ languageCode = "en-us" +disableKinds = ["taxonomy", "taxonomyTerm"] title = "SimpleSystems, LLC" [markup.goldmark.renderer] diff --git a/data/home/ssattrs.json b/content/_index.md similarity index 97% rename from data/home/ssattrs.json rename to content/_index.md index 64c00a3..6063ece 100644 --- a/data/home/ssattrs.json +++ b/content/_index.md @@ -1,4 +1,6 @@ -[ +--- +title: +ssattrs: [ { "title": "Comprehensible Interaction", "img": "/img/interact.png", @@ -20,3 +22,4 @@ "desc": "When software simply does its job, and does it well, it will be an asset to other systems. When software becomes convoluted, it will hinder other systems." } ] +--- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0dd2df1..a534cba 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,26 +4,20 @@ - - - + {{ partialCached "css-global.html" . }} - {{ block "title" . }} - {{ .Site.Title }} - {{ end }} + {{ .Site.Title }} {{ block "title" . }} {{ with .Title }} | {{ . }} {{ end }} {{ end }} - {{ partial "navbar/site-navbar.html" . }} + {{ partialCached "navbar.html" . }}
- {{ block "main" . }} - - {{ end }} + {{ block "main" . }} {{ end }}
- {{ partial "footer/site-footer.html" . }} - {{ partial "scripts/scripts.html" . }} + {{ partialCached "footer.html" . }} + {{ partialCached "js-global.html" . }} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index e30bf06..1e73680 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -1,6 +1,4 @@ {{ define "main" }} - {{ .Content }} -
{{ range .Pages }} diff --git a/layouts/index.html b/layouts/index.html index 8ab3285..930b759 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,4 +1,4 @@ {{ define "main" }} {{ partial "jumbotron.html" . }} - {{ partial "simple-software.html" . }} + {{ partial "simple-software.html" .Params.ssattrs }} {{ end }} diff --git a/layouts/partials/css-global.html b/layouts/partials/css-global.html new file mode 100644 index 0000000..00ab07d --- /dev/null +++ b/layouts/partials/css-global.html @@ -0,0 +1,8 @@ +{{ $sheets := slice }} +{{ range slice "icons.css" "simplesystems.css" "light-theme.css" }} + {{ $sheets = $sheets | append (resources.Get .) }} +{{ end }} + +{{ $css := $sheets | resources.Concat "/css/main.css" | resources.Fingerprint "sha512" }} + + diff --git a/layouts/partials/footer/site-footer.html b/layouts/partials/footer.html similarity index 100% rename from layouts/partials/footer/site-footer.html rename to layouts/partials/footer.html diff --git a/layouts/partials/scripts/scripts.html b/layouts/partials/js-global.html similarity index 100% rename from layouts/partials/scripts/scripts.html rename to layouts/partials/js-global.html diff --git a/layouts/partials/navbar/site-navbar.html b/layouts/partials/navbar.html similarity index 100% rename from layouts/partials/navbar/site-navbar.html rename to layouts/partials/navbar.html diff --git a/layouts/partials/simple-software.html b/layouts/partials/simple-software.html index a384751..8f63958 100644 --- a/layouts/partials/simple-software.html +++ b/layouts/partials/simple-software.html @@ -7,7 +7,7 @@
- {{ range $.Site.Data.home.ssattrs }} + {{ range $ }}
{{ partial "cards/home-card.html" . }}
diff --git a/layouts/section/blog.html b/layouts/section/blog.html index 3f295f9..9b157b3 100644 --- a/layouts/section/blog.html +++ b/layouts/section/blog.html @@ -1,6 +1,4 @@ {{ define "main" }} - {{ .Content }} -
diff --git a/layouts/section/jobs.html b/layouts/section/jobs.html index 39684f9..b9b2bb4 100644 --- a/layouts/section/jobs.html +++ b/layouts/section/jobs.html @@ -1,6 +1,4 @@ {{ define "main" }} - {{ .Content }} -