From f1ad48028e17ef7cd8c9d7fc481153f390d6b3e2 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <the@jeffreyfreeman.me> Date: Mon, 16 Oct 2023 13:26:55 -0400 Subject: [PATCH] Made adding sections much easier --- CHANGELOG.md | 2 ++ README.md | 6 ------ layouts/entry/single.html | 3 --- layouts/news/list.html | 3 --- layouts/news/single.html | 3 --- layouts/partials/top_list_generic.html | 2 +- layouts/partials/top_list_news.html | 12 ------------ layouts/partials/top_list_projects.html | 12 ------------ layouts/partials/top_list_resource.html | 12 ------------ layouts/partials/top_list_taxonomy.html | 2 +- layouts/projects/list.html | 3 --- layouts/projects/single.html | 3 --- layouts/resource/list.html | 3 --- layouts/resource/single.html | 3 --- 14 files changed, 4 insertions(+), 65 deletions(-) delete mode 100644 layouts/entry/single.html delete mode 100644 layouts/news/list.html delete mode 100644 layouts/news/single.html delete mode 100644 layouts/partials/top_list_news.html delete mode 100644 layouts/partials/top_list_projects.html delete mode 100644 layouts/partials/top_list_resource.html delete mode 100644 layouts/projects/list.html delete mode 100644 layouts/projects/single.html delete mode 100644 layouts/resource/list.html delete mode 100644 layouts/resource/single.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 7005cf9eb..2532a079c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ * Minor improvement to CSS so `page` types dont get clipped by the menu header. * Added a container shortcode for use on `page` types to get left and right margins. +* Adding new sections is now almost completely dynamic and requires much less + modification of code. See updated `README.me`. ## 1.1.0 diff --git a/README.md b/README.md index 5486a7416..dc150cb8a 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,8 @@ just yet. ### Renaming -1. Change the name of the `/layouts/partials/top_list_<section>.html` to the -new name and edit its content. 1. Modify `./clean-build.cjs` at the bottom of the file to include the name of the new section. -1. Rename directory `./layouts/<section>` to the name of the new section, or - create a new directory using an existing directory as a template. -1. Edit `./layouts/<section>/list.html` to point to the new section partial -(first line). 1. Change or create a new directory for section content under `/content/<new_section>` diff --git a/layouts/entry/single.html b/layouts/entry/single.html deleted file mode 100644 index 709763526..000000000 --- a/layouts/entry/single.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_single.html" . }} -{{ partial "body_single.html" . }} -{{ partial "bottom_single.html" . }} diff --git a/layouts/news/list.html b/layouts/news/list.html deleted file mode 100644 index 215103d3c..000000000 --- a/layouts/news/list.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_list_news.html" . }} -{{ partial "body_list.html" . }} -{{ partial "bottom_list.html" . }} diff --git a/layouts/news/single.html b/layouts/news/single.html deleted file mode 100644 index 709763526..000000000 --- a/layouts/news/single.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_single.html" . }} -{{ partial "body_single.html" . }} -{{ partial "bottom_single.html" . }} diff --git a/layouts/partials/top_list_generic.html b/layouts/partials/top_list_generic.html index bf84b00fe..531ab5c54 100644 --- a/layouts/partials/top_list_generic.html +++ b/layouts/partials/top_list_generic.html @@ -5,7 +5,7 @@ <div class="main-wrapper"> <header class='subheader'> <div class='container'> - <h2 class='page-title'> {{ .Title }} + <h2 class='page-title'> {{ .Title }}{{ if .Description }} <small>{{ .Description }}</small>{{ end }} </h2> </div> </header> diff --git a/layouts/partials/top_list_news.html b/layouts/partials/top_list_news.html deleted file mode 100644 index ead589c00..000000000 --- a/layouts/partials/top_list_news.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ partial "head.html" . }} -<body class="list h-feed"> - <div> - {{ partial "menu.html" . }} - <div class="main-wrapper"> - <header class='subheader'> - <div class='container'> - <h2 class='page-title'> News <small>For current events related to Fedipage. You can follow this page on the fediverse at @fedipage@fedipage.com.</small> - </h2> - </div> - </header> - <main class="hfeed container" id="content" role="main"> diff --git a/layouts/partials/top_list_projects.html b/layouts/partials/top_list_projects.html deleted file mode 100644 index 298731e9b..000000000 --- a/layouts/partials/top_list_projects.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ partial "head.html" . }} -<body class="list h-feed"> - <div> - {{ partial "menu.html" . }} - <div class="main-wrapper"> - <header class='subheader'> - <div class='container'> - <h2 class='page-title'> Projects <small>Open source projects related to the fedipage project.</small> - </h2> - </div> - </header> - <main class="hfeed container" id="content" role="main"> diff --git a/layouts/partials/top_list_resource.html b/layouts/partials/top_list_resource.html deleted file mode 100644 index 336fd1c8e..000000000 --- a/layouts/partials/top_list_resource.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ partial "head.html" . }} -<body class="list h-feed"> - <div> - {{ partial "menu.html" . }} - <div class="main-wrapper"> - <header class='subheader'> - <div class='container'> - <h2 class='page-title'> Resources <small>services, assistance, information, and other resources to assist in contributing to the Fedipage project.</small> - </h2> - </div> - </header> - <main class="hfeed container" id="content" role="main"> diff --git a/layouts/partials/top_list_taxonomy.html b/layouts/partials/top_list_taxonomy.html index 09d67e2b4..0aa5df05c 100644 --- a/layouts/partials/top_list_taxonomy.html +++ b/layouts/partials/top_list_taxonomy.html @@ -5,7 +5,7 @@ <div class="main-wrapper"> <header class='subheader'> <div class='container'> - <h2 class='page-title'> Categories <small> a listing of all the topics we cover organized in one place.</small> + <h2 class='page-title'> Categories <small> A listing of all the topics we cover organized in one place.</small> </h2> </div> </header> diff --git a/layouts/projects/list.html b/layouts/projects/list.html deleted file mode 100644 index b7658ea2e..000000000 --- a/layouts/projects/list.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_list_projects.html" . }} -{{ partial "body_list.html" . }} -{{ partial "bottom_list.html" . }} diff --git a/layouts/projects/single.html b/layouts/projects/single.html deleted file mode 100644 index 709763526..000000000 --- a/layouts/projects/single.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_single.html" . }} -{{ partial "body_single.html" . }} -{{ partial "bottom_single.html" . }} diff --git a/layouts/resource/list.html b/layouts/resource/list.html deleted file mode 100644 index 91210d750..000000000 --- a/layouts/resource/list.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_list_resource.html" . }} -{{ partial "body_list.html" . }} -{{ partial "bottom_list.html" . }} diff --git a/layouts/resource/single.html b/layouts/resource/single.html deleted file mode 100644 index 709763526..000000000 --- a/layouts/resource/single.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ partial "top_single.html" . }} -{{ partial "body_single.html" . }} -{{ partial "bottom_single.html" . }} -- GitLab