Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/geschke/hugo-tikva.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Geschke <ralf@kuerbis.org>2018-11-22 21:32:45 +0300
committerRalf Geschke <ralf@kuerbis.org>2018-11-22 21:32:45 +0300
commit3328600d9981e98aa1984a9f3861a54f2bcad458 (patch)
treef48e5ac5020b97517c65f1d24c6c57cf390de87b
parent420ce6fe81c20469d4b63c876cbb07092920794e (diff)
Handling of footer, subfooter and sidebar sections improved, now it works with "headless" setting. Added partial for subfooter item.v0.2
-rw-r--r--CHANGELOG.md12
-rw-r--r--exampleSite/config.toml23
-rw-r--r--exampleSite/content/sections/footer/column01.md3
-rw-r--r--exampleSite/content/sections/footer/column02.md (renamed from exampleSite/content_sections/footer/column02.md)0
-rw-r--r--exampleSite/content/sections/footer/column03.md (renamed from exampleSite/content_sections/footer/column03.md)0
-rw-r--r--exampleSite/content/sections/footer/index.md3
-rw-r--r--exampleSite/content/sections/sidebar/content01_about.html (renamed from exampleSite/content_sections/sidebar/content01_about.html)0
-rw-r--r--exampleSite/content/sections/sidebar/content02.md4
-rw-r--r--exampleSite/content/sections/sidebar/index.md3
-rw-r--r--exampleSite/content/sections/subfooter/content.md (renamed from exampleSite/content_sections/subfooter/content.md)0
-rw-r--r--exampleSite/content/sections/subfooter/index.md3
-rw-r--r--exampleSite/content_sections/footer/column01.md3
-rw-r--r--exampleSite/content_sections/sidebar/content02.md4
-rw-r--r--layouts/partials/footer_container.html21
-rw-r--r--layouts/partials/sidebar_container.html27
-rw-r--r--layouts/partials/subfooter_container.html15
-rw-r--r--layouts/partials/subfooter_item.html1
-rw-r--r--theme.toml2
18 files changed, 64 insertions, 60 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 663fdbe..3edabbb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,15 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## 0.2 - 2018-11-21
+## 0.2 - 2018-11-22
### Added
- This CHANGELOG file and version numbering
+- New partial "subfooter_item.html". The behavior of subfooter is now similar to footer and sidebar. As default, only the .Content of the subfooter file(s) will be displayed.
### Changed
-- Handling of footer, subfooter and sidebar folders. The concept of getting footer, subfooter and sidebar content from regular markdown files makes content generation comfortable, but has the disadvantage that Hugo creates all folders which are placed in the main `content` folder. If a folder will be excluded by *ignoreFiles* option, no content is generated, to footer, subfooter and sidebar remain empty. To solve this, this theme makes use of a folder with the default name `content_sections` in the project's root directory. The footer, subfooter and sidebar folders and their files have to be placed into this folder. Please have a look at the folder structure of `exampleSite`. It is possible to use another folder which is reachable in the project's directory, see the new config option `contentSectionsPath = "/my-sections-folder/"`.
+- Handling of footer, subfooter and sidebar folders. The concept of getting footer, subfooter and sidebar content from regular markdown files makes content generation comfortable, but has the disadvantage that Hugo creates all folders which are placed in the main `content` folder. To prevent this, page bundles can be declared as "headless", i.e. the bundle will not be published, see https://gohugo.io/content-management/page-bundles/#headless-bundle . To make clear the difference to the previous version a backward incompatible change has been added. The folders "`footer`", "`subfooter`" and "`sidebar`" have to be created in the folder `content/sections/`. If you have already used these folders, just create a new directory `sections` into your `content` directory and move `footer`, `subfooter` and `sidebar` into this new folder. To make the folders "headless" add a file named "`index.md`" into the directories with the following content:
+```
+---
+headless: true
+---
+```
+You'll find an example in the `exampleSite` project.
+
- min_version in theme.toml bumped to 0.48
## 0.1 - 2018-11-21
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index cae0870..629fea8 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -31,8 +31,6 @@ paginate = 2
showNumberOfWords = false # true|false: Show number of word on article header of single content page
hideMeta = false # Hide meta information on single pages
- #contentSectionsPath = '/content_sections/' # Relative path to content sections folder. Please add leading and trailing '/'. The content section path contains the folders with markdown files for footer, subfooter and sidebar. It is possible to change the name of the folder. If this option is not set, the default '/content_sections/' will be used.
-
# Navigation bar settings
@@ -104,6 +102,13 @@ paginate = 2
# Footer configuration
+# To create a footer, create a directory "sections/footer" into your project’s content directory.
+# Then add some content files (.md or .html) to the footer folder AND create an index.md file with the Front Matter setting
+# headless: true
+# Without the "headless" setting the sidebar will not be displayed!
+# See https://gohugo.io/content-management/page-bundles/#headless-bundle
+# You can modify the style with a partial "footer_column.html", see example in "layouts/partials/".
+
[params.theme.footer]
enabled = true # Show the footer part
#numberColumns = 3 # Set number of columns available in footer of a page. Use the "footer" folder in the page structure to add content. If nothing is set, the default number is 3. Currently.i.e. since v0.2 not used, the number of columns is identical to the number of files in footer directory.
@@ -113,7 +118,12 @@ paginate = 2
# Subfooter configuration
-# To use the subfooter, plase create a folder named "subfooter" in your "content" folder and add a markdown (or html) file. The first found file will be used as subfolder content
+# To create a subfooter, create a directory "sections/subfooter" into your project’s content directory.
+# Then add some content files (.md or .html) to the subfooter folder AND create an index.md file with the Front Matter setting
+# headless: true
+# Without the "headless" setting the sidebar will not be displayed!
+# See https://gohugo.io/content-management/page-bundles/#headless-bundle
+# You can modify the style with a partial "subfooter_item.html", see example in "layouts/partials/".
[params.theme.subfooter]
enabled = true # Show the content below the footer
@@ -172,8 +182,11 @@ paginate = 2
# Sidebar section
-# To create a sidebar, it's recommended to add a folder "sidebar" into a directory "content_sections" of your project’s root directory.
-# Then add some content files (.md or .html) to the sidebar folder.
+# To create a sidebar, create a directory "sections/sidebar" into your project’s content directory.
+# Then add some content files (.md or .html) to the sidebar folder AND create an index.md file with the Front Matter setting
+# headless: true
+# Without the "headless" setting the sidebar will not be displayed!
+# See https://gohugo.io/content-management/page-bundles/#headless-bundle
# You can modify the style with a partial "sidebar_item.html", see example in "layouts/partials/".
[params.sidebar]
diff --git a/exampleSite/content/sections/footer/column01.md b/exampleSite/content/sections/footer/column01.md
new file mode 100644
index 0000000..2d30fbc
--- /dev/null
+++ b/exampleSite/content/sections/footer/column01.md
@@ -0,0 +1,3 @@
+<div>
+This is a placeholder for a content file of the footer. You can use Markdown or HTML here. Just place your content files into a folder "sections/footer" in your content directory, make the page bundle "headless" and enable the footer in the site config file.
+</div>
diff --git a/exampleSite/content_sections/footer/column02.md b/exampleSite/content/sections/footer/column02.md
index 56e1085..56e1085 100644
--- a/exampleSite/content_sections/footer/column02.md
+++ b/exampleSite/content/sections/footer/column02.md
diff --git a/exampleSite/content_sections/footer/column03.md b/exampleSite/content/sections/footer/column03.md
index 90a55bf..90a55bf 100644
--- a/exampleSite/content_sections/footer/column03.md
+++ b/exampleSite/content/sections/footer/column03.md
diff --git a/exampleSite/content/sections/footer/index.md b/exampleSite/content/sections/footer/index.md
new file mode 100644
index 0000000..ca03031
--- /dev/null
+++ b/exampleSite/content/sections/footer/index.md
@@ -0,0 +1,3 @@
+---
+headless: true
+---
diff --git a/exampleSite/content_sections/sidebar/content01_about.html b/exampleSite/content/sections/sidebar/content01_about.html
index 1ca6c70..1ca6c70 100644
--- a/exampleSite/content_sections/sidebar/content01_about.html
+++ b/exampleSite/content/sections/sidebar/content01_about.html
diff --git a/exampleSite/content/sections/sidebar/content02.md b/exampleSite/content/sections/sidebar/content02.md
new file mode 100644
index 0000000..bf89fa1
--- /dev/null
+++ b/exampleSite/content/sections/sidebar/content02.md
@@ -0,0 +1,4 @@
+---
+title: "Example content"
+---
+You can place everything you want in this area. Just add HTML or Markdown files into a folder named "sections/sidebar" in your content folder and declare the folder as "headless". This is an example of modifying the style with an individual "sidebar_item.html" partial. \ No newline at end of file
diff --git a/exampleSite/content/sections/sidebar/index.md b/exampleSite/content/sections/sidebar/index.md
new file mode 100644
index 0000000..ca03031
--- /dev/null
+++ b/exampleSite/content/sections/sidebar/index.md
@@ -0,0 +1,3 @@
+---
+headless: true
+---
diff --git a/exampleSite/content_sections/subfooter/content.md b/exampleSite/content/sections/subfooter/content.md
index a4fd3ec..a4fd3ec 100644
--- a/exampleSite/content_sections/subfooter/content.md
+++ b/exampleSite/content/sections/subfooter/content.md
diff --git a/exampleSite/content/sections/subfooter/index.md b/exampleSite/content/sections/subfooter/index.md
new file mode 100644
index 0000000..ca03031
--- /dev/null
+++ b/exampleSite/content/sections/subfooter/index.md
@@ -0,0 +1,3 @@
+---
+headless: true
+---
diff --git a/exampleSite/content_sections/footer/column01.md b/exampleSite/content_sections/footer/column01.md
deleted file mode 100644
index 1340573..0000000
--- a/exampleSite/content_sections/footer/column01.md
+++ /dev/null
@@ -1,3 +0,0 @@
-<div>
-This is a placeholder for a content file of the footer. You can use Markdown or HTML here. Just place your content with type "footer" or in the "content/footer" directory and enable the footer in the site config file.
-</div>
diff --git a/exampleSite/content_sections/sidebar/content02.md b/exampleSite/content_sections/sidebar/content02.md
deleted file mode 100644
index 3ab1336..0000000
--- a/exampleSite/content_sections/sidebar/content02.md
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: "Example content"
----
-You can place everything you want in this area. Just add HTML or Markdown files into a folder named "sidebar" in your content folder. This is an example of modifying the style with an individual "sidebar_item.html" partial. \ No newline at end of file
diff --git a/layouts/partials/footer_container.html b/layouts/partials/footer_container.html
index d12111c..af74132 100644
--- a/layouts/partials/footer_container.html
+++ b/layouts/partials/footer_container.html
@@ -3,22 +3,13 @@
<div class="container">
<footer>
-
<div class="row">
-
- {{- $path := printf "%s%s" (default "/content_sections/" .Site.Params.contentSectionsPath ) "footer/" -}}
- {{- $files := readDir $path -}}
- {{- $footerRow := "" -}}
- {{- range $files | sort -}}
- {{- $fileName := printf "%s%s" $path .Name -}}
-
- {{- $footerRow = readFile $fileName | markdownify -}}
-
- {{ partial "footer_column.html" (dict "Page" . "Content" $footerRow) }}
-
- {{- end -}}
-
-
+ {{ $footerItems := .Site.GetPage "/sections/footer" }}
+ {{ if $footerItems }}
+ {{ range sort $footerItems.Resources "Name" }}
+ {{ partial "footer_column.html" . }}
+ {{ end }}
+ {{ end }}
</div>
</footer>
</div>
diff --git a/layouts/partials/sidebar_container.html b/layouts/partials/sidebar_container.html
index cdbc9d6..f3965ed 100644
--- a/layouts/partials/sidebar_container.html
+++ b/layouts/partials/sidebar_container.html
@@ -1,26 +1,11 @@
<aside class="col-md-3 tikva-sidebar">
- {{ .GetPage "/content_sections/sidebar/content02.md" }}
-<p>foo</p>
- {{- $path := printf "%s%s" (default "/content_sections/" .Site.Params.contentSectionsPath ) "sidebar/" -}}
+{{ $sidebarItems := .Site.GetPage "/sections/sidebar" }}
+{{ if $sidebarItems }}
+ {{ range sort $sidebarItems.Resources "Name" }}
-
- {{- $files := readDir $path -}}
- {{- $sidebarItem := "" -}}
- {{- range $files | sort -}}
- {{- $fileName := printf "%s%s" $path .Name -}}
-
- {{- $sidebarItem = readFile $fileName | markdownify -}}
-
-{{ $fileName }}
-
-
- {{ partial "sidebar_item.html" (dict "Page" . "Content" $sidebarItem) }}
-
- {{- end -}}
-
-
-
-
+ {{ partial "sidebar_item.html" . }}
+ {{ end }}
+{{ end }}
</aside><!-- /.tikva-sidebar -->
diff --git a/layouts/partials/subfooter_container.html b/layouts/partials/subfooter_container.html
index c747d6d..b6f2f11 100644
--- a/layouts/partials/subfooter_container.html
+++ b/layouts/partials/subfooter_container.html
@@ -5,16 +5,13 @@
<div class="footer">
<div class="row wrapper padding">
<div class="col-xs-12 col-md-12">
- {{- $path := printf "%s%s" (default "/content_sections/" .Site.Params.contentSectionsPath ) "subfooter/" -}}
- {{- $files := readDir $path -}}
- {{- $footerRow := "" -}}
- {{- range $files | sort -}}
- {{- $fileName := printf "%s%s" $path .Name -}}
-
- {{- readFile $fileName | markdownify -}}
-
- {{- end -}}
+ {{ $subfooterItems := .Site.GetPage "/sections/subfooter" }}
+ {{ if $subfooterItems }}
+ {{ range sort $subfooterItems.Resources "Name" }}
+ {{ partial "subfooter_item.html" . }}
+ {{ end }}
+ {{ end }}
</div>
diff --git a/layouts/partials/subfooter_item.html b/layouts/partials/subfooter_item.html
new file mode 100644
index 0000000..0579f44
--- /dev/null
+++ b/layouts/partials/subfooter_item.html
@@ -0,0 +1 @@
+ {{ .Content }}
diff --git a/theme.toml b/theme.toml
index 406968c..66299c3 100644
--- a/theme.toml
+++ b/theme.toml
@@ -1,6 +1,6 @@
# Name : Tikva
# Version : 0.2
-# Released : 2018-09-21
+# Released : 2018-09-22
name = "Tikva"
license = "MIT"