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

github.com/cdeck3r/OneDly-Theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcdeck3r <cdecker@outlook.de>2019-08-08 10:11:35 +0300
committercdeck3r <cdecker@outlook.de>2019-08-08 10:11:35 +0300
commit6d85b154e980df53d330dfe36fa145dc4b147b64 (patch)
treec195669142c5d6d16c55b05f251b7f008071fcf1
parent2ab7cf7099a9b444cf27e20223080cb80cc69f0b (diff)
.Site.Params.mainSections, re-org of post dir contentv1.0.1
-rw-r--r--README.md11
-rw-r--r--exampleSite/config.toml3
-rw-r--r--exampleSite/content/_index.md4
-rw-r--r--exampleSite/content/post/about.md (renamed from exampleSite/content/about.md)0
-rw-r--r--exampleSite/content/post/conclusion.md (renamed from exampleSite/content/conclusion.md)0
-rw-r--r--exampleSite/content/post/project.md (renamed from exampleSite/content/project.md)0
-rw-r--r--layouts/partials/main.html2
7 files changed, 14 insertions, 6 deletions
diff --git a/README.md b/README.md
index 82549f9..46be9c3 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,16 @@ Examples
### Section Ordering
-The project documentation may consists of several files indicating different sections. All files need to be placed in `myproject/content/post` directory. An example project content structure can be found in `exampleSite/content`. Fixed sections reside outside the `post` directory.
+The project documentation may consists of several files indicating different documentation sections. In Hugo-Speak these sections are pages stored in separate `.md` files. All files need to be placed in `myproject/content/post` directory. An example project content structure can be found in `exampleSite/content`.
+
+Hugo uses the [content directory with the most pages](https://gohugo.io/functions/where/#mainsections) as source for displaying your documentation. You may explicitly set the `post` directory or any other directory containing your project documentation as well as add additional directories in the `config.toml`. In the example below the content sources from the `post` and the `other` directories.
+
+```
+[params]
+ ...
+ # optionally specify where the content is
+ # mainSections = ["post", "other"]
+```
One may create a new section using `hugo new post/about.md`. It is recommended to start with an About section. In the file's front matter specify
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index e9f3701..74e3455 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -13,6 +13,9 @@ theme = "onedly"
author_name = "cdeck3r"
project_url = "//github.com/cdeck3r/OneDly-Theme"
+ # optionally specify where the content is
+ # mainSections = ["post"]
+
# social share links to appear at the end
socialShare = true
# Sets specific share to appear on posts (default behavior is to appear)
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md
deleted file mode 100644
index 6abc75e..0000000
--- a/exampleSite/content/_index.md
+++ /dev/null
@@ -1,4 +0,0 @@
-+++
-author = "Hugo Authors"
-+++
-
diff --git a/exampleSite/content/about.md b/exampleSite/content/post/about.md
index d23b5c2..d23b5c2 100644
--- a/exampleSite/content/about.md
+++ b/exampleSite/content/post/about.md
diff --git a/exampleSite/content/conclusion.md b/exampleSite/content/post/conclusion.md
index a7ef28e..a7ef28e 100644
--- a/exampleSite/content/conclusion.md
+++ b/exampleSite/content/post/conclusion.md
diff --git a/exampleSite/content/project.md b/exampleSite/content/post/project.md
index f8da6b6..f8da6b6 100644
--- a/exampleSite/content/project.md
+++ b/exampleSite/content/post/project.md
diff --git a/layouts/partials/main.html b/layouts/partials/main.html
index b91c6c2..488a6a2 100644
--- a/layouts/partials/main.html
+++ b/layouts/partials/main.html
@@ -1,7 +1,7 @@
<section id="main">
<!-- Page Content -->
-{{ range $index, $element := where (.Data.Pages.ByParam "sec") "Section" "in" "post" }}
+{{ range $index, $element := where (.Data.Pages.ByParam "sec") "Section" "in" .Site.Params.mainSections }}
{{ if modBool $index 2 }}
<div class="content-section-a">
{{ else }}