From 5d093b3a339e6d497d62410df81a4dd8116c70bdaad36d738e175326819a0703 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Wed, 9 Nov 2022 00:00:00 +0000 Subject: Create configDir for journal generation This gets rid of the ugly dependency on Python scripts. By using configDir, two different configs can be specified. One for Gemini and one for the Web. This keeps everything separate, tidy, and much more maintainable. --- .build.yml | 14 +++++---- .gitignore | 5 ++-- config.toml | 69 --------------------------------------------- config/_default/config.toml | 63 +++++++++++++++++++++++++++++++++++++++++ config/gemini/config.toml | 6 ++++ config/web/config.toml | 7 +++++ themes/journal | 2 +- 7 files changed, 87 insertions(+), 79 deletions(-) delete mode 100644 config.toml create mode 100644 config/_default/config.toml create mode 100644 config/gemini/config.toml create mode 100644 config/web/config.toml diff --git a/.build.yml b/.build.yml index 98ecf89..12c8207 100644 --- a/.build.yml +++ b/.build.yml @@ -6,14 +6,16 @@ packages: environment: site: nicholasjohnson.srht.site tasks: -- generate: | - python3 $site/themes/hugo-theme-nicksphere/scripts/generate.py +- generate_journal: | + cd $site + hugo -e gemini + hugo -e web - package_website: | - cd $site/website - tar -cvz . > ../../site.tar.gz + cd $site/public/website + tar -cvz . > ../../../site.tar.gz - package_capsule: | - cd $site/capsule - tar -cvz . > ../../capsule.tar.gz + cd $site/public/capsule + tar -cvz . > ../../../capsule.tar.gz - upload_website: | hut pages publish -d $site site.tar.gz - upload_capsule: | diff --git a/.gitignore b/.gitignore index cb2f626..c7ce793 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -public/ -capsule/ -website/ +public/capsule +public/website .hugo_build.lock diff --git a/config.toml b/config.toml deleted file mode 100644 index cb2aa75..0000000 --- a/config.toml +++ /dev/null @@ -1,69 +0,0 @@ -theme = "hugo-theme-nicksphere" -baseURL = "https://nicksphere.ch" -title = "Nicholas Johnson" -copyright = "CC BY-SA 4.0" -languageCode = "en-us" -disablePathToLower = true -enableRobotsTXT = true -disableKinds = ['taxonomy', 'term', 'RSS', 'section'] -rssLimit = 20 - -[author] - name = "Nicholas Johnson" - email = "nick@nicksphere.ch" - -[params] - description = "Online journal about computing, philosophy, spirituality, privacy, and society." - keywords = "computing, computers, philosophy, spirituality, privacy, surveillance, mass surveillance, free software, libre software, technology, society, politics, opinion, education, educational, blog, blogging, gemini, geminispace, gemini capsule" - indexTitle = "Welcome To My Online Journal!" - indexIntro = "I write about computing, philosophy, privacy, society, spirituality, and more." - beginCopyrightYear = 2019 - -[permalinks] - entry = "/:year/:month/:day/:filename" - -[menu] - [[menu.main]] - name = "About Page" - url = "/about/" - weight = 1 - [[menu.main]] - name = "Promoted Links" - url = "/promoted/" - weight = 2 - [[menu.main]] - name = "Glossary" - url = "/glossary/" - weight = 3 - [[menu.main]] - name = "Atom Feed" - url = "/atom.xml" - weight = 4 - -[mediaTypes] - [mediaTypes."application/atom"] - suffixes = ["xml"] - [mediaTypes."text/gemini"] - suffixes = ["gmi"] - -[outputFormats] - [outputFormats.Atom] - mediaType = "application/atom" - baseName = "atom" - [outputFormats.Gemini] - mediaType = "text/gemini" - [outputFormats.Gemini_Atom] - mediaType = "application/atom" - baseName = "atom" - path = "gemini_atom" - -[markup] - [markup.goldmark] - [markup.goldmark.renderer] - hardWraps = true - [markup.goldmark.extensions] - linkify = false - -[outputs] - home = ["HTML", "Gemini", "Atom", "Gemini_Atom"] - page = ["HTML", "Gemini"] diff --git a/config/_default/config.toml b/config/_default/config.toml new file mode 100644 index 0000000..3d4b20b --- /dev/null +++ b/config/_default/config.toml @@ -0,0 +1,63 @@ +theme = "hugo-theme-nicksphere" +baseURL = "https://nicksphere.ch" +title = "Nicholas Johnson" +copyright = "CC BY-SA 4.0" +languageCode = "en-us" +disablePathToLower = true +rssLimit = 20 +ignoreFiles = ['content/templates/logo\.txt$'] + +[author] + name = "Nicholas Johnson" + email = "nick@nicksphere.ch" + +[params] + description = "Online journal about computing, philosophy, spirituality, privacy, and society." + keywords = "computing, computers, philosophy, spirituality, privacy, surveillance, mass surveillance, free software, libre software, technology, society, politics, opinion, education, educational, blog, blogging, gemini, geminispace, gemini capsule" + indexTitle = "Welcome To My Online Journal!" + indexIntro = "I write about computing, philosophy, privacy, society, spirituality, and more." + beginCopyrightYear = 2019 + +[permalinks] + entry = "/:year/:month/:day/:filename" + +[menu] + [[menu.main]] + name = "About Page" + url = "/about/" + weight = 1 + [[menu.main]] + name = "Promoted Links" + url = "/promoted/" + weight = 2 + [[menu.main]] + name = "Glossary" + url = "/glossary/" + weight = 3 + [[menu.main]] + name = "Atom Feed" + url = "/atom.xml" + weight = 4 + +[markup] + [markup.goldmark] + [markup.goldmark.renderer] + hardWraps = true + [markup.goldmark.extensions] + linkify = false + +[mediaTypes] + [mediaTypes."application/atom"] + suffixes = ["xml"] + [mediaTypes."text/gemini"] + suffixes = ["gmi"] + +[outputFormats] + [outputFormats.Atom] + mediaType = "application/atom" + baseName = "atom" + [outputFormats.Gemini] + mediaType = "text/gemini" + [outputFormats.Gemini_Atom] + mediaType = "application/atom" + baseName = "atom" diff --git a/config/gemini/config.toml b/config/gemini/config.toml new file mode 100644 index 0000000..417a9bd --- /dev/null +++ b/config/gemini/config.toml @@ -0,0 +1,6 @@ +disableKinds = ['taxonomy', 'term', 'RSS', 'section', 'sitemap'] +publishDir = "public/capsule" + +[outputs] + home = ["Gemini", "Gemini_Atom"] + page = ["Gemini"] diff --git a/config/web/config.toml b/config/web/config.toml new file mode 100644 index 0000000..f34177b --- /dev/null +++ b/config/web/config.toml @@ -0,0 +1,7 @@ +disableKinds = ['taxonomy', 'term', 'RSS', 'section'] +enableRobotsTXT = true +publishDir = "public/website" + +[outputs] + home = ["HTML", "Atom"] + page = ["HTML"] diff --git a/themes/journal b/themes/journal index d2df941..90f6e85 160000 --- a/themes/journal +++ b/themes/journal @@ -1 +1 @@ -Subproject commit d2df941fdaa188ece3f43fd8c47b9234e10bbcd6ca2fe4636d9ab5da18cdb336 +Subproject commit 90f6e85f8689f09644b3a060541d0d5b3defa2e0f39a910e2212bc3ededeef89 -- cgit v1.2.3