aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-13 23:09:01 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-13 23:09:01 -0500
commit2e219c7804c208545b0500b7da21334a58575e86 (patch)
treec56692dc5a383cde88c070af243a475099d32c9f
parent2cd87e0b67c5372651aa390cddc9b9d658e2a20f (diff)
downloadthedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.tar.gz
thedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.tar.bz2
thedroneely.com-2e219c7804c208545b0500b7da21334a58575e86.zip
Makefile: Expose more deployment logic
Generalize partials
-rw-r--r--.gitignore4
-rw-r--r--Makefile43
-rw-r--r--generators/hugo/themes/tdro/layouts/_default/single.html2
-rw-r--r--generators/hugo/themes/tdro/layouts/partials/article-references.html6
-rw-r--r--generators/hugo/themes/tdro/layouts/partials/article-webrings.html (renamed from generators/hugo/themes/tdro/layouts/partials/article-on-web.html)6
-rw-r--r--generators/hugo/themes/tdro/layouts/partials/references/.keep (renamed from generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep)0
-rw-r--r--generators/hugo/themes/tdro/layouts/partials/webrings/.keep (renamed from generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep)0
7 files changed, 45 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 0355f3b..06c9588 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,12 @@
-**/generators/exoference/*.html
+**/references/*.html
+**/webrings/*.html
.hugo_build.lock
/cockpit
/database
/storage
/vendor
config.php
+generators/exoference/exoference
generators/hugo/content
generators/hugo/public
generators/openring/openring
diff --git a/Makefile b/Makefile
index d412684..878ad30 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,40 @@
+all:
+ make webrings
+ make quotes
+ make references
+ make migration
+ make site
+ make admin
+ make migration
+
generators:
- make openring
- make fortune
+ make webrings
+ make quotes
+ make references
-openring:
+webrings:
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
+ > generators/hugo/themes/tdro/layouts/partials/webrings/openring.html
-fortune:
+quotes:
strfile generators/fortune/quotes.fortune
-hugo:
+references:
+ find generators/hugo/content/posts -type f -name "*.md" -exec basename --suffix '.md' {} \; \
+ | while read -r file; do path="generators/hugo/themes/tdro/layouts/partials/references/$$file.html" \
+ && printf 'Gathering references for %s\n' "$$file" && [ ! -e "$$path" ] \
+ && generators/exoference/exoference "$$(printf 'https://thedroneely.com/posts/%s/\n' "$$file")" > \
+ "$$path" || true ; done
+
+site:
ln -sfT ../../public generators/hugo/public
cd generators/hugo && hugo && { cd ../.. || exit 1; }
-cockpit:
+admin:
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
@@ -25,4 +42,14 @@ migration:
sqlite3 database/sqlite.db < database/contactform.sql
sed --in-place "s|'sql:;dbname=sql_database'|'sqlite:' . __DIR__ . '/database/sqlite.db'|" config.php
-.PHONY: generators cockpit
+permissions:
+ find . -type f -print0 | xargs -0 chmod 640
+ find . -type d -print0 | xargs -0 chmod 770
+ chmod +x \
+ bootstrap/helpers/cache \
+ bootstrap/helpers/thumbnails \
+ generators/openring/openring
+ chmod g+w database/sqlite.db
+ find public/images -type f -exec touch -d "3 days ago" {} +
+
+.PHONY: generators admin
diff --git a/generators/hugo/themes/tdro/layouts/_default/single.html b/generators/hugo/themes/tdro/layouts/_default/single.html
index 1d98d73..9e67be6 100644
--- a/generators/hugo/themes/tdro/layouts/_default/single.html
+++ b/generators/hugo/themes/tdro/layouts/_default/single.html
@@ -10,7 +10,7 @@
{{- partial "article-syntax.html" . -}}
{{- partial "article-meta-bottom.html" . -}}
{{- partial "article-more-content.html" . -}}
- {{- partial "article-on-web.html" . -}}
+ {{- partial "article-webrings.html" . -}}
{{- partial "article-comments.html" . -}}
{{- partial "article-references.html" . -}}
</main>
diff --git a/generators/hugo/themes/tdro/layouts/partials/article-references.html b/generators/hugo/themes/tdro/layouts/partials/article-references.html
index ca3aee7..9de25c4 100644
--- a/generators/hugo/themes/tdro/layouts/partials/article-references.html
+++ b/generators/hugo/themes/tdro/layouts/partials/article-references.html
@@ -1,7 +1,7 @@
-{{- $exoference := print "themes/tdro/layouts/partials/generators/exoference/" .Slug ".html" -}}
-{{- $include := print "generators/exoference/" .Slug ".html" -}}
+{{- $references := print "themes/tdro/layouts/partials/references/" .Slug ".html" -}}
+{{- $include := print "references/" .Slug ".html" -}}
-{{- if fileExists $exoference -}}
+{{- if fileExists $references -}}
<article-references id="article-references">
<section>
<h2>References</h2>
diff --git a/generators/hugo/themes/tdro/layouts/partials/article-on-web.html b/generators/hugo/themes/tdro/layouts/partials/article-webrings.html
index 53d1d45..2d8189b 100644
--- a/generators/hugo/themes/tdro/layouts/partials/article-on-web.html
+++ b/generators/hugo/themes/tdro/layouts/partials/article-webrings.html
@@ -1,7 +1,7 @@
-{{- $openring := "themes/tdro/layouts/partials/generators/openring/openring.html" -}}
-{{- $include := "generators/openring/openring.html" -}}
+{{- $webrings := "themes/tdro/layouts/partials/webrings/openring.html" -}}
+{{- $include := "webrings/openring.html" -}}
-{{- if fileExists $openring -}}
+{{- if fileExists $webrings -}}
<article-on-web id="article-on-web">
<section>
<button-anchor>
diff --git a/generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep b/generators/hugo/themes/tdro/layouts/partials/references/.keep
index e69de29..e69de29 100644
--- a/generators/hugo/themes/tdro/layouts/partials/generators/exoference/.keep
+++ b/generators/hugo/themes/tdro/layouts/partials/references/.keep
diff --git a/generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep b/generators/hugo/themes/tdro/layouts/partials/webrings/.keep
index e69de29..e69de29 100644
--- a/generators/hugo/themes/tdro/layouts/partials/generators/openring/.keep
+++ b/generators/hugo/themes/tdro/layouts/partials/webrings/.keep