From 6d85b154e980df53d330dfe36fa145dc4b147b64 Mon Sep 17 00:00:00 2001 From: cdeck3r Date: Thu, 8 Aug 2019 09:11:35 +0200 Subject: .Site.Params.mainSections, re-org of post dir content --- README.md | 11 ++++++++- exampleSite/config.toml | 3 +++ exampleSite/content/_index.md | 4 ---- exampleSite/content/about.md | 41 ---------------------------------- exampleSite/content/conclusion.md | 30 ------------------------- exampleSite/content/post/about.md | 41 ++++++++++++++++++++++++++++++++++ exampleSite/content/post/conclusion.md | 30 +++++++++++++++++++++++++ exampleSite/content/post/project.md | 25 +++++++++++++++++++++ exampleSite/content/project.md | 25 --------------------- layouts/partials/main.html | 2 +- 10 files changed, 110 insertions(+), 102 deletions(-) delete mode 100644 exampleSite/content/_index.md delete mode 100644 exampleSite/content/about.md delete mode 100644 exampleSite/content/conclusion.md create mode 100644 exampleSite/content/post/about.md create mode 100644 exampleSite/content/post/conclusion.md create mode 100644 exampleSite/content/post/project.md delete mode 100644 exampleSite/content/project.md 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/about.md deleted file mode 100644 index d23b5c2..0000000 --- a/exampleSite/content/about.md +++ /dev/null @@ -1,41 +0,0 @@ -+++ -title = "About" -description = "Initial project description" -date = "2019-08-07" -author = "Christian Decker" -sec = 1 -+++ - -One-Day-Only or OneDly projects help to acquire a new skill or to complete a task within a short timeframe. It limits the available time and combines it with defined objectives. This situation forces you to focus on the relevant elements in order to successfully complete a task or project. Please note, the idea is not to pack as much work as you can do within a workday. At the end you will find answers for the following questions - -* What were the relevant elements for success? -* How good are you in estimating your work effort? -* What were road blocks or even showstoppers you haven't forseen even in a short-term project horizon? -* What are typical reoccuring interuptions and distractions during your work? -* What is your personal pace when working intensly on a task or project? - - -This will certainly generate some personal insights and improve your activities in future projects. - -### Structuring OneDly Projects - -A single page stores an entire OneDly project documentation. We recommend the following concise structure. - -* About: Some background / intro information motivating the project -* Project Definition - * Goal - * Approach and Objectives -* Sections -* ... -* Summary and Conclusions -* Next steps - -### Example - -Raspi mini computers are embedded computers running linux and provide a desktop alike programming experiences. They are available at low cost. Being able to develop software for these systems is a valuable contribution to one's CV. - -This OneDly project experiements with the Raspi setup, development and deployment of some example software. - - - - diff --git a/exampleSite/content/conclusion.md b/exampleSite/content/conclusion.md deleted file mode 100644 index a7ef28e..0000000 --- a/exampleSite/content/conclusion.md +++ /dev/null @@ -1,30 +0,0 @@ -+++ -title = "Conclusion" -description = "Summary, conclusion and next steps" -date = "2019-08-07" -author = "Christian Decker" -sec = 7 -+++ - -This section concludes the project. - -### Summary - -The list below displays the achieved objectives: - -* [x] To be able to setup a Raspi from scratch -* [x] To be able to develop a simple command line software -* [x] To enable a software to automatically restart after shutdown / power off -* [ ] To enable resilience by monitoring and restarting software processes remotely - -### Conclusion - -I successfully acquired new development skills for raspi computers. They provide a valuable contribution to my CV. - -### Next Steps - -There are other embedded systems. Will approach them as my next programming plattform. - - - - diff --git a/exampleSite/content/post/about.md b/exampleSite/content/post/about.md new file mode 100644 index 0000000..d23b5c2 --- /dev/null +++ b/exampleSite/content/post/about.md @@ -0,0 +1,41 @@ ++++ +title = "About" +description = "Initial project description" +date = "2019-08-07" +author = "Christian Decker" +sec = 1 ++++ + +One-Day-Only or OneDly projects help to acquire a new skill or to complete a task within a short timeframe. It limits the available time and combines it with defined objectives. This situation forces you to focus on the relevant elements in order to successfully complete a task or project. Please note, the idea is not to pack as much work as you can do within a workday. At the end you will find answers for the following questions + +* What were the relevant elements for success? +* How good are you in estimating your work effort? +* What were road blocks or even showstoppers you haven't forseen even in a short-term project horizon? +* What are typical reoccuring interuptions and distractions during your work? +* What is your personal pace when working intensly on a task or project? + + +This will certainly generate some personal insights and improve your activities in future projects. + +### Structuring OneDly Projects + +A single page stores an entire OneDly project documentation. We recommend the following concise structure. + +* About: Some background / intro information motivating the project +* Project Definition + * Goal + * Approach and Objectives +* Sections +* ... +* Summary and Conclusions +* Next steps + +### Example + +Raspi mini computers are embedded computers running linux and provide a desktop alike programming experiences. They are available at low cost. Being able to develop software for these systems is a valuable contribution to one's CV. + +This OneDly project experiements with the Raspi setup, development and deployment of some example software. + + + + diff --git a/exampleSite/content/post/conclusion.md b/exampleSite/content/post/conclusion.md new file mode 100644 index 0000000..a7ef28e --- /dev/null +++ b/exampleSite/content/post/conclusion.md @@ -0,0 +1,30 @@ ++++ +title = "Conclusion" +description = "Summary, conclusion and next steps" +date = "2019-08-07" +author = "Christian Decker" +sec = 7 ++++ + +This section concludes the project. + +### Summary + +The list below displays the achieved objectives: + +* [x] To be able to setup a Raspi from scratch +* [x] To be able to develop a simple command line software +* [x] To enable a software to automatically restart after shutdown / power off +* [ ] To enable resilience by monitoring and restarting software processes remotely + +### Conclusion + +I successfully acquired new development skills for raspi computers. They provide a valuable contribution to my CV. + +### Next Steps + +There are other embedded systems. Will approach them as my next programming plattform. + + + + diff --git a/exampleSite/content/post/project.md b/exampleSite/content/post/project.md new file mode 100644 index 0000000..f8da6b6 --- /dev/null +++ b/exampleSite/content/post/project.md @@ -0,0 +1,25 @@ ++++ +title = "Project Definition" +description = "Goals, objectives and approach" +date = "2019-08-07" +author = "Christian Decker" +sec = 2 ++++ + +This section defines concisely the basic project frame. + +### Goal + +Improve my CV by adding new state-of-the-art development skills. + +### Approach & Objectives + +* To be able to setup a Raspi from scratch +* To be able to develop a simple command line software +* To enable a software to automatically restart after shutdown / power off +* To enable resilience by monitoring and restarting software processes remotely + + + + + diff --git a/exampleSite/content/project.md b/exampleSite/content/project.md deleted file mode 100644 index f8da6b6..0000000 --- a/exampleSite/content/project.md +++ /dev/null @@ -1,25 +0,0 @@ -+++ -title = "Project Definition" -description = "Goals, objectives and approach" -date = "2019-08-07" -author = "Christian Decker" -sec = 2 -+++ - -This section defines concisely the basic project frame. - -### Goal - -Improve my CV by adding new state-of-the-art development skills. - -### Approach & Objectives - -* To be able to setup a Raspi from scratch -* To be able to develop a simple command line software -* To enable a software to automatically restart after shutdown / power off -* To enable resilience by monitoring and restarting software processes remotely - - - - - 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 @@
-{{ 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 }}
{{ else }} -- cgit v1.2.3