From 30e9489b68540678ffeda38773e41429a0bb16f5 Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Wed, 31 Aug 2022 03:48:02 -0400 Subject: generators/hugo: Add references and make file --- .gitignore | 1 + Makefile | 24 ++++++++++++++++++++++ generators/exoference/.keep | 0 .../hugo/themes/tdro/layouts/_default/single.html | 5 ++--- .../tdro/layouts/partials/article-meta-bottom.html | 2 +- .../layouts/partials/article-more-content.html | 2 +- .../tdro/layouts/partials/article-on-web.html | 9 ++++++-- .../tdro/layouts/partials/article-references.html | 11 ++++++++++ .../layouts/partials/generators/exoference/.keep | 0 .../layouts/partials/generators/openring/.keep | 0 public/css/tdro.css | 9 ++++++-- 11 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 Makefile create mode 100644 generators/exoference/.keep create mode 100644 generators/hugo/themes/tdro/layouts/partials/article-references.html create mode 100644 generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep create mode 100644 generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep diff --git a/.gitignore b/.gitignore index a9fb86d..23ad3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +**/generators/exoference/*.html .hugo_build.lock /app/storage /cockpit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fecbe4d --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +generators: + make openring + make fortune + +openring: + generators/openring/openring \ + -s "https://drewdevault.com/feed.xml" \ + -s "https://mxb.dev/feed.xml" \ + -s "https://www.taniarascia.com/rss.xml" \ + < generators/openring/template.html \ + > generators/hugo/themes/tdro/layouts/partials/generators/openring/openring.html + +fortune: + strfile generators/fortune/quotes.fortune + +hugo: + ln -sfT ../../public generators/hugo/public + cd generators/hugo && hugo && { cd ../.. || exit 1; } + +cockpit: + sed --in-place "s|^hugo_base_dir.*|hugo_base_dir: $PWD/generators/hugo|" cockpit/addons/Hugo/config.yaml + sed --in-place "s|^hugo_theme.*|hugo_theme: tdro|" cockpit/addons/Hugo/config.yaml + +.PHONY: generators diff --git a/generators/exoference/.keep b/generators/exoference/.keep new file mode 100644 index 0000000..e69de29 diff --git a/generators/hugo/themes/tdro/layouts/_default/single.html b/generators/hugo/themes/tdro/layouts/_default/single.html index 96bb02c..1d98d73 100644 --- a/generators/hugo/themes/tdro/layouts/_default/single.html +++ b/generators/hugo/themes/tdro/layouts/_default/single.html @@ -7,12 +7,11 @@ {{- partial "function-content.html" .Content | safeHTML -}} + {{- partial "article-syntax.html" . -}} {{- partial "article-meta-bottom.html" . -}} {{- partial "article-more-content.html" . -}} - {{- if fileExists "themes/tdro/layouts/partials/openring.html" -}} {{- partial "article-on-web.html" . -}} - {{- end -}} - {{- partial "article-syntax.html" . -}} {{- partial "article-comments.html" . -}} + {{- partial "article-references.html" . -}} {{ end }} diff --git a/generators/hugo/themes/tdro/layouts/partials/article-meta-bottom.html b/generators/hugo/themes/tdro/layouts/partials/article-meta-bottom.html index d1adf5c..3a272f2 100644 --- a/generators/hugo/themes/tdro/layouts/partials/article-meta-bottom.html +++ b/generators/hugo/themes/tdro/layouts/partials/article-meta-bottom.html @@ -1,4 +1,4 @@ - + {{ dateFormat "2 January 2006" .Params.date }} — Written
diff --git a/generators/hugo/themes/tdro/layouts/partials/article-more-content.html b/generators/hugo/themes/tdro/layouts/partials/article-more-content.html index dbe5725..5751aaa 100644 --- a/generators/hugo/themes/tdro/layouts/partials/article-more-content.html +++ b/generators/hugo/themes/tdro/layouts/partials/article-more-content.html @@ -1,4 +1,4 @@ - +

More Content

{{ $more := shuffle .Site.RegularPages | first 3 }} diff --git a/generators/hugo/themes/tdro/layouts/partials/article-on-web.html b/generators/hugo/themes/tdro/layouts/partials/article-on-web.html index 59776da..53d1d45 100644 --- a/generators/hugo/themes/tdro/layouts/partials/article-on-web.html +++ b/generators/hugo/themes/tdro/layouts/partials/article-on-web.html @@ -1,4 +1,8 @@ - +{{- $openring := "themes/tdro/layouts/partials/generators/openring/openring.html" -}} +{{- $include := "generators/openring/openring.html" -}} + +{{- if fileExists $openring -}} +
@@ -8,5 +12,6 @@

On the Web

- {{- partial "openring.html" . -}} + {{- partial $include . -}}
+{{- end -}} diff --git a/generators/hugo/themes/tdro/layouts/partials/article-references.html b/generators/hugo/themes/tdro/layouts/partials/article-references.html new file mode 100644 index 0000000..ca3aee7 --- /dev/null +++ b/generators/hugo/themes/tdro/layouts/partials/article-references.html @@ -0,0 +1,11 @@ +{{- $exoference := print "themes/tdro/layouts/partials/generators/exoference/" .Slug ".html" -}} +{{- $include := print "generators/exoference/" .Slug ".html" -}} + +{{- if fileExists $exoference -}} + +
+

References

+
+ {{- partial $include . -}} +
+{{- end -}} diff --git a/generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep b/generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep new file mode 100644 index 0000000..e69de29 diff --git a/generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep b/generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep new file mode 100644 index 0000000..e69de29 diff --git a/public/css/tdro.css b/public/css/tdro.css index 8d69584..6efb2a0 100644 --- a/public/css/tdro.css +++ b/public/css/tdro.css @@ -635,6 +635,7 @@ article-list, taxonomy-list, article-on-web, article-comments, +article-references, article-subsection, article-meta-bottom, article-archive-list, @@ -654,6 +655,7 @@ article-more-content { taxonomy-list, article-on-web, article-comments, + article-references, article-subsection, article-meta-bottom, article-archive-list, @@ -666,6 +668,7 @@ article-more-content { taxonomy-list h2, article-on-web h2, article-comments h2, +article-references h2, article-more-content h2, taxonomy-archive-list h2 { font-size: 1.25rem; @@ -811,9 +814,11 @@ article-archive-link a svg { vertical-align: bottom; } +article-on-web, +article-comments, +article-references, article-meta-bottom, -article-more-content, -article-on-web { +article-more-content { padding: 2.5rem 1.5rem; } -- cgit v1.2.3