From b484e9525b8af78c4d0fe36d0cdc557660d82397 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 20 Feb 2022 13:21:30 +0100 Subject: [PATCH] provide header variant with banner; work in progress: example site = cybercards documentation --- LICENSE.md | 2 +- archetypes/default.md | 5 ++-- exampleSite/config.yaml | 12 ++------ exampleSite/content/posts/components.md | 27 ++++++++++++++--- exampleSite/content/posts/install.md | 2 +- exampleSite/content/posts/overview.md | 18 +++++++---- exampleSite/content/posts/pageconfig.md | 2 +- exampleSite/content/posts/structures.md | 6 ++-- layouts/_default/baseof.html | 3 +- layouts/partials/header-banner.html | 40 +++++++++++++++++++++++++ layouts/partials/header.html | 2 +- theme.toml | 6 ++-- 12 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 layouts/partials/header-banner.html diff --git a/LICENSE.md b/LICENSE.md index d6506c0..0fba6c1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2021 cyberconcepts.org team (team@cyberconcepts.org) +Copyright (c) 2022 cyberconcepts.org team (team@cyberconcepts.org) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/archetypes/default.md b/archetypes/default.md index 3c6b06a..0786b60 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -8,10 +8,11 @@ parents: [] domains: [] topics: [] doctypes: [] -date: {{ .Date }} +date: {{ time.Format "2006-01-02" .Date }} author: draft: false -weight: 50 +weight: 300 --- ## First Headline + diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index a0c23c7..d2e13f5 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,6 +11,8 @@ markup: unsafe: true params: + hideSectionArticles: true + #defaultImage: 9609-motor2.jpg logo: logo-matrix.png favicon: icon-star.png @@ -41,16 +43,6 @@ taxonomies: domain: domains topic: topics -related: - includeNewer: true - indices: - - name: parents - weight: 100 - - name: topics - weight: 100 - threshold: 80 - toLower: true - menu: main: - identifier: home diff --git a/exampleSite/content/posts/components.md b/exampleSite/content/posts/components.md index 27bb371..21717a6 100644 --- a/exampleSite/content/posts/components.md +++ b/exampleSite/content/posts/components.md @@ -4,11 +4,30 @@ summary: The parts and components that make up the *cybercards* theme img: image-5.png pageid: components parents: [documentation] -topics: [Documentation, Components] -author: helmut +topics: [Documentation, Components, Zettelkasten] +author: helmutm date: 2022-02-19 weight: 320 --- -Nulla vel ante sit amet leo imperdiet porta. Mauris pellentesque finibus ligula non dignissim. Sed sed vehicula velit. Ut eleifend velit maximus massa lobortis mattis. In dui quam, rutrum eu purus et, mattis consequat ex. Vivamus risus mauris, ultricies vel dolor eget, aliquet tristique est. Suspendisse odio urna, vehicula vel diam at, pulvinar porttitor metus. Sed ac ipsum et magna aliquam mattis in eleifend mi. Pellentesque porttitor diam nec hendrerit efficitur. In hac habitasse platea dictumst. Nam arcu enim, imperdiet quis molestie molestie, molestie non diam. Quisque pretium felis in lorem placerat rhoncus eu et lorem. Praesent tincidunt purus sed mi lacinia maximus. Curabitur rutrum tempus posuere. Donec quis fringilla enim. Nullam nisl nisl, vestibulum sed enim vel, tempor pulvinar ligula. +## Layout Components + +### Header section + +### List page + +### Single page + +### Sidebar + +## Styling + +`_custom-vars.scss` + +`_custom.scss` + +## Shortcodes + +`ilink` + +`iimg` -Mauris tincidunt ligula et erat ullamcorper varius. Nunc sit amet lacus ullamcorper, suscipit sem in, interdum dui. Nam ultricies, dui eget aliquet mollis, erat ipsum luctus eros, sed pulvinar nulla velit ut nibh. Mauris sed molestie turpis. Curabitur vehicula eros lectus, ac venenatis justo fringilla eget. Phasellus fringilla molestie diam vel aliquet. Nunc orci lorem, laoreet eget blandit nec, vestibulum eu urna. Ut gravida egestas massa, in auctor nisl iaculis id. In hac habitasse platea dictumst. Fusce nec massa ullamcorper, posuere nisl et, feugiat risus. Morbi metus risus, facilisis aliquam risus porta, volutpat viverra leo. Praesent vestibulum, orci in consectetur aliquet, lacus metus suscipit risus, a dignissim eros nibh sed purus. Nullam in magna non nulla ultricies aliquam. Nullam malesuada rhoncus est, in vehicula lacus mattis vel. Nam et velit dignissim, consectetur est ac, imperdiet nulla. Nunc feugiat facilisis ipsum, quis porttitor quam mattis in. \ No newline at end of file diff --git a/exampleSite/content/posts/install.md b/exampleSite/content/posts/install.md index 8dab4c8..62fdfc2 100644 --- a/exampleSite/content/posts/install.md +++ b/exampleSite/content/posts/install.md @@ -5,7 +5,7 @@ img: image-1.png pageid: install parents: [documentation] topics: [Documentation, Installation] -author: helmut +author: helmutm date: 2022-02-19 weight: 310 --- diff --git a/exampleSite/content/posts/overview.md b/exampleSite/content/posts/overview.md index 0ac957a..a81f0a6 100644 --- a/exampleSite/content/posts/overview.md +++ b/exampleSite/content/posts/overview.md @@ -4,12 +4,20 @@ summary: What is this all about? img: image-4.png pageid: overview parents: [introduction] -topics: [Hugo, Theme] -author: helmut -date: 2022-02-19 +topics: [Hugo, Theme, Zettelkasten, Documentation] +author: helmutm +date: 2022-02-20 weight: 110 --- -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris erat augue, eleifend nec est quis, iaculis suscipit lacus. In convallis ut mi ac volutpat. Integer feugiat lacinia purus, at condimentum enim tempus vitae. Fusce tempus tortor nibh, ut mollis sapien pulvinar at. Nam nec tortor ante. Phasellus lorem elit, placerat sit amet ligula ac, fermentum vulputate nibh. Quisque sed dapibus risus. Quisque sagittis iaculis maximus. Mauris lorem ligula, commodo in ullamcorper et, mollis ut dui. +Based on [Hugo Cards](https://themes.gohugo.io/themes/hugo-cards) -Integer ut turpis metus. Curabitur purus orci, sagittis non ultrices ac, elementum ut diam. Suspendisse fringilla dolor id sapien tincidunt, vitae tempor enim tempus. Ut quis varius tortor, ut molestie ante. Curabitur maximus quis nibh quis lacinia. Nullam ante nunc, mollis sed nibh quis, sagittis semper lectus. Morbi quis enim nibh. Vestibulum justo sem, placerat vitae cursus vel, hendrerit vitae nibh. Mauris id metus non lorem volutpat varius. Fusce dui lectus, imperdiet at felis at, tincidunt dapibus enim. Ut porttitor at magna molestie faucibus. Etiam sed dignissim lectus. Praesent interdum vulputate diam, non iaculis libero fringilla sit amet. Nunc dignissim vel ipsum sed tincidunt. Nullam id sapien quam. +Makes heavy use of the Bootstrap *card* element, not only on overview pages but also when presenting meta data and links on the sidebar of a page. + +But the name *cybercards* is also related to another aspekt of the theme: It allows you to construct a complex directed graph of linked pages, that is something like [Niklas Lumann](https://en.wikipedia.org/wiki/Niklas_Luhmann)'s famous [Zettelkasten](https://en.wikipedia.org/wiki/Zettelkasten) (slip box), a - possibly fairly large (Luhmann's had about 90,000 cards) - collection of index cards that are interlinked by putting identifiers on each card that may then be referenced from other cards. + +There are three ways for linking (see the {{< ilink pid="structures">}}*Structures*{{< /ilink >}} and {{< ilink pid="pageconfig">}}*Page Configuration*{{< /ilink >}} pages): + +- Use taxonomy, currently supported are *topics*. With the *cybercards* theme a topic may have parent topics, thus building a directed graph (sort of hierarchy, but with optionally more than one parent of an object, so more like a network) of topics. Pages belonging to the same topic as the current page are listed in the *Related Posts* section of the sidebar. Parent and child topics are shown page of a topic if there are explicit topic documents for these in the `content/topics` folder. +- Connect pages via the `parents` parameter, that references other ("parent") pages via their `pageid`s. Parent and child pages of the current page are shown in corresponding sections of the sidebar. Alternatively you can show child pages (i.e. pages that link to the current one via their *parents* parameter) as cards directly on the parent page, depending on a setting in the site parameters. Pages that link to the same parent page as the current page are listed in the *Sibling Posts* section of the sidebar. +- Link directly from a page's text to another page by inserting an `ilink` (internal link) shortcode that references the `pageid` of the other page (just like in a Wiki, but without the magic of CamelCase and automatic page creation). On the referenced page you get a list of *Backlinks* in the sidebar that shows which other pages link to it via an `ilink` shortcode. diff --git a/exampleSite/content/posts/pageconfig.md b/exampleSite/content/posts/pageconfig.md index c43d15b..92a659a 100644 --- a/exampleSite/content/posts/pageconfig.md +++ b/exampleSite/content/posts/pageconfig.md @@ -5,7 +5,7 @@ img: image-3.png pageid: pageconfig parents: [documentation] topics: [Documentation, Configuration] -author: helmut +author: helmutm date: 2022-02-19 weight: 340 --- diff --git a/exampleSite/content/posts/structures.md b/exampleSite/content/posts/structures.md index 4b58c76..d1d920d 100644 --- a/exampleSite/content/posts/structures.md +++ b/exampleSite/content/posts/structures.md @@ -4,9 +4,9 @@ summary: How to build a linked index card structure using taxonomies and page re img: image-2.png pageid: structures parents: [documentation] -topics: [Documentation, Structures, Graph, Taxonomy, Links] -author: helmut -date: 2022-02-19 +topics: [Documentation, Structures, Graph, Taxonomy, Links, Zettelkasten] +author: helmutm +date: 2022-02-20 weight: 330 --- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1fe5159..b922e7d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,7 +16,8 @@ {{ block "config" . }}{{ end }} - {{ partial "header.html" . }} + {{ $header := or .Site.Params.layouts.partials.header "header" }} + {{ partial $header . }}
{{ block "main" . }} {{ end }} diff --git a/layouts/partials/header-banner.html b/layouts/partials/header-banner.html new file mode 100644 index 0000000..42599b3 --- /dev/null +++ b/layouts/partials/header-banner.html @@ -0,0 +1,40 @@ + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 59f2854..db86660 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,4 +1,4 @@ -