diff options
author | Thedro Neely <thedroneely@gmail.com> | 2022-08-31 03:48:02 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2022-08-31 03:48:02 -0400 |
commit | 30e9489b68540678ffeda38773e41429a0bb16f5 (patch) | |
tree | accf9680a12f00541a1aa6ef60d22f4a3c89fd06 | |
parent | 526026c3e9df262e14651e2d6160171f89f5f761 (diff) | |
download | thedroneely.com-30e9489b68540678ffeda38773e41429a0bb16f5.tar.gz thedroneely.com-30e9489b68540678ffeda38773e41429a0bb16f5.tar.bz2 thedroneely.com-30e9489b68540678ffeda38773e41429a0bb16f5.zip |
generators/hugo: Add references and make file
11 files changed, 54 insertions, 9 deletions
@@ -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 --- /dev/null +++ b/generators/exoference/.keep 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 -}} </article> + {{- 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" . -}} </main> {{ 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 @@ -<article-meta-bottom> +<article-meta-bottom id="article-meta-bottom"> {{ dateFormat "2 January 2006" .Params.date }} <code> — Written</code> <br> 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 @@ -<article-more-content> +<article-more-content id="article-more-content"> <section> <h2>More Content</h2> {{ $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 @@ -<article-on-web> +{{- $openring := "themes/tdro/layouts/partials/generators/openring/openring.html" -}} +{{- $include := "generators/openring/openring.html" -}} + +{{- if fileExists $openring -}} +<article-on-web id="article-on-web"> <section> <button-anchor> <a href="https://git.sr.ht/~sircmpwn/openring" title="Generated by Open Ring"> @@ -8,5 +12,6 @@ </button-anchor> <h2>On the Web</h2> </section> - {{- partial "openring.html" . -}} + {{- partial $include . -}} </article-on-web> +{{- 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 -}} +<article-references id="article-references"> + <section> + <h2>References</h2> + </section> + {{- partial $include . -}} +</article-references> +{{- 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 --- /dev/null +++ b/generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep 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 --- /dev/null +++ b/generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep 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; } |