From c62ebb9796ca5bf1e2e5760a73a233f99c7890b7 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Tue, 21 Nov 2023 09:33:11 +0100 Subject: [PATCH] work in progress: output formats tpl, htmx, pt --- config.yaml | 22 ++++++++++++ layouts/_default/home.zpt.pt | 34 ++++++++++++++++++ layouts/_default/list.html-fragment.htmx | 2 ++ layouts/_default/list.tpl.tpl | 2 ++ layouts/_default/single.html-fragment.htmx | 2 ++ layouts/_default/single.tpl.tpl | 2 ++ sites/hx/config.yaml | 6 ++++ sites/pt/config.yaml | 40 ++++++++++++++++++++++ 8 files changed, 110 insertions(+) create mode 100644 config.yaml create mode 100644 layouts/_default/home.zpt.pt create mode 100644 layouts/_default/list.html-fragment.htmx create mode 100644 layouts/_default/list.tpl.tpl create mode 100644 layouts/_default/single.html-fragment.htmx create mode 100644 layouts/_default/single.tpl.tpl create mode 100644 sites/pt/config.yaml diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..41c540e --- /dev/null +++ b/config.yaml @@ -0,0 +1,22 @@ +mediaTypes: + x-text/html-fragment: + suffixes: + - htmx + x-text/go-template: + suffixes: + - tpl + x-text/zope-pagetemplate: + suffixes: + - pt + +outputFormats: + html-fragment: + isPlainText: false + mediaType: x-text/html-fragment + tpl: + isPlainText: false + mediaType: x-text/go-template + zpt: + baseName: main + isPlainText: false + mediaType: x-text/zope-pagetemplate diff --git a/layouts/_default/home.zpt.pt b/layouts/_default/home.zpt.pt new file mode 100644 index 0000000..9a08c6b --- /dev/null +++ b/layouts/_default/home.zpt.pt @@ -0,0 +1,34 @@ + + + + + + + {{ if .Site.Params.favicon -}} + + {{- end }} + {{ $title := or (i18n .Title) .Title .Site.Title -}} + {{ $title }}{{ if ne $title .Site.Title }} - {{ .Site.Title }}{{ end }} + {{ hugo.Generator }} + {{ $main := resources.Get "sass/main.scss" | toCSS | minify -}} + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + {{ block "config" . }}{{ end }} + + + {{ $header := or .Site.Params.layouts.partials.header "header" }} + {{ partial $header . }} +
+
+ {{ block "main" . }} {{ end }} +
+
+ {{ partial "footer.html" . }} + + {{ partial "js.html" . }} + {{ block "appjs" . }} {{ end }} + + + diff --git a/layouts/_default/list.html-fragment.htmx b/layouts/_default/list.html-fragment.htmx new file mode 100644 index 0000000..81dc7ab --- /dev/null +++ b/layouts/_default/list.html-fragment.htmx @@ -0,0 +1,2 @@ + {{- partial "content" . -}} + diff --git a/layouts/_default/list.tpl.tpl b/layouts/_default/list.tpl.tpl new file mode 100644 index 0000000..81dc7ab --- /dev/null +++ b/layouts/_default/list.tpl.tpl @@ -0,0 +1,2 @@ + {{- partial "content" . -}} + diff --git a/layouts/_default/single.html-fragment.htmx b/layouts/_default/single.html-fragment.htmx new file mode 100644 index 0000000..81dc7ab --- /dev/null +++ b/layouts/_default/single.html-fragment.htmx @@ -0,0 +1,2 @@ + {{- partial "content" . -}} + diff --git a/layouts/_default/single.tpl.tpl b/layouts/_default/single.tpl.tpl new file mode 100644 index 0000000..81dc7ab --- /dev/null +++ b/layouts/_default/single.tpl.tpl @@ -0,0 +1,2 @@ + {{- partial "content" . -}} + diff --git a/sites/hx/config.yaml b/sites/hx/config.yaml index 0796189..a3492d7 100644 --- a/sites/hx/config.yaml +++ b/sites/hx/config.yaml @@ -38,6 +38,12 @@ frontmatter: related: _merge: shallow +mediaTypes: + _merge: shallow + +outputs: + home: [html, html-fragment, tpl] + menu: main: - identifier: home diff --git a/sites/pt/config.yaml b/sites/pt/config.yaml new file mode 100644 index 0000000..a285c6a --- /dev/null +++ b/sites/pt/config.yaml @@ -0,0 +1,40 @@ +baseurl: /docs/scopes/pt/ +DefaultContentLanguage: en +title: cyberscopes example site +summary: Generate main.pt for Zope applications +paginate: 6 +theme: +- cyberscopes +- cybercards +themesDir: themes + +params: + + logo: cc-logo.png + favicon: icon-star-bl.png + + github: https://github.com/cyberconcepts + sourcehut: https://git.sr.ht/~cco + email: helmutm@cy55.de + + copyright: + name: Helmut Merz + link: https://www.cyberconcepts.org + + api: + module: main-htmx.ts + +taxonomies: [] + +frontmatter: + _merge: shallow + +related: + _merge: shallow + +mediaTypes: + _merge: shallow + +outputs: + home: [zpt] +