Compare commits

..

3 Commits

Author SHA1 Message Date
608b0cde28
Update example site config
Some checks failed
Build demo / build (push) Has been cancelled
Should be valid up to Hugo v0.146.0.
2025-04-18 16:01:51 +08:00
f21c8d02fb
Modularize components into its own file
To make it work with Hugo 0.146, I think.
2025-04-18 15:59:21 +08:00
4e1b08c84e
Update flake inputs
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7?narHash=sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs%3D' (2024-11-18)
  → 'github:NixOS/nixpkgs/18dd725c29603f582cf1900e0d25f9f1063dbf11?narHash=sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38%3D' (2025-04-13)
2025-04-18 15:53:15 +08:00
7 changed files with 30 additions and 38 deletions

View File

@ -1,9 +1,11 @@
baseURL = "https://foo-dogsquared.github.io/hugo-theme-more-contentful" baseURL = "https://foo-dogsquared.github.io/hugo-theme-more-contentful"
title = "More Contentful" title = "More Contentful"
enableGitInfo = false enableGitInfo = false
paginate = 20
rssLimit = 2 rssLimit = 2
[pagination]
pagerSize = 20
[security] [security]
enableInlineShortcodes = true enableInlineShortcodes = true
[security.exec] [security.exec]

6
flake.lock generated
View File

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1731890469, "lastModified": 1744536153,
"narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5083ec887760adfe12af64830a66807423a859a7", "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -12,7 +12,7 @@ Otherwise, we take the pages of a section. */ -}}
{{- range (.Paginate $pages).Pages }} {{- range (.Paginate $pages).Pages }}
<article class="post"> <article class="post">
<h1><a href="{{ .RelPermalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h1> <h1><a href="{{ .RelPermalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h1>
{{ partial "partials/components/post-meta.html" . }} {{ partial "components/post-meta.html" . }}
</article> </article>
{{- end }} {{- end }}

View File

@ -5,7 +5,7 @@
<article> <article>
<header> <header>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ partial "partials/components/post-meta.html" . }} {{ partial "components/post-meta.html" . }}
</header> </header>
{{ $is_toc := cond (ne .Params.toc nil) .Params.toc $.Site.Params.toc }} {{ $is_toc := cond (ne .Params.toc nil) .Params.toc $.Site.Params.toc }}

View File

@ -1,32 +0,0 @@
{{- /*
Here's where all of the inline partials are defined.
If the partial is short enough, it should be put here.
*/ -}}
{{- /*
A partial that aliases the Heroicon template from the icon partial.
*/ -}}
{{- define "partials/components/heroicon.html" }}
{{- $name := default .id .name }}
{{- $res := resources.ExecuteAsTemplate (printf "icons/generic/%s.svg" .id)
(dict "id" .id
"name" $name)
(resources.Get "templates/heroicon.svg") }}
<svg class="site__icon">
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
</svg>
{{ end }}
{{- /*
A partial for easily using icons from Simple Icons set.
*/ -}}
{{- define "partials/components/simple-icon.html" }}
{{- $name := default .id .name }}
{{- $res := resources.ExecuteAsTemplate (printf "icons/brand/%s.svg" .id)
(dict "id" .id
"name" $name)
(resources.Get "templates/simple-icon.svg") }}
<svg class="site__icon">
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
</svg>
{{- end }}

View File

@ -0,0 +1,11 @@
{{- /*
A partial that aliases the Heroicon template from the icon partial.
*/ -}}
{{- $name := default .id .name }}
{{- $res := resources.ExecuteAsTemplate (printf "icons/generic/%s.svg" .id)
(dict "id" .id
"name" $name)
(resources.Get "templates/heroicon.svg") }}
<svg class="site__icon">
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
</svg>

View File

@ -0,0 +1,11 @@
{{- /*
A partial for easily using icons from Simple Icons set.
*/ -}}
{{- $name := default .id .name }}
{{- $res := resources.ExecuteAsTemplate (printf "icons/brand/%s.svg" .id)
(dict "id" .id
"name" $name)
(resources.Get "templates/simple-icon.svg") }}
<svg class="site__icon">
<use href="{{ $res.RelPermalink }}#{{ $name }}"></use>
</svg>