Compare commits

...

2 Commits

Author SHA1 Message Date
Hugo Poissonnet 84baa1d098 feat: add patchs for theme override 2022-12-21 23:27:35 +01:00
Hugo Poissonnet 87d86e7f4e feat: add tags 2022-12-21 23:26:50 +01:00
4 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,28 @@
--- themes/cupper-hugo-theme/layouts/_default/list.html 2022-12-05 19:56:43.667815118 +0100
+++ themes/cupper-hugo-theme/layouts/_default/list.html 2022-12-18 17:11:11.846547314 +0100
@@ -27,6 +27,25 @@
</h2>
</li>
{{ end }}
+ {{ if (eq .Type "post") }}
+ {{ range $.Site.Data.LegacyBlogUrls }}
+ <li>
+ <h2>
+ <a href="{{ .url }}">
+ <svg
+ class="bookmark"
+ aria-hidden="true"
+ viewBox="0 0 40 50"
+ focusable="false"
+ >
+ <use href="#bookmark"></use>
+ </svg>
+ {{ .metas.title }}
+ </a>
+ </h2>
+ </li>
+ {{ end }}
+ {{ end }}
</ul>
</main>
{{ end }}

View File

@ -0,0 +1,19 @@
--- themes/cupper-hugo-theme/layouts/partials/nav.html 2022-12-05 19:58:23.175031691 +0100
+++ themes/cupper-hugo-theme/layouts/partials/nav.html 2022-12-08 13:03:13.995570393 +0100
@@ -11,8 +11,7 @@
{{ range .Site.Menus.nav }}
<li class="pattern">
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
- {{ $active = or $active (eq .Name $current.Title) }}
- {{ $active = or $active (and (eq .Name "Blog") (eq $current.Section "post")) }}
+ {{ $active = or $active (eq .URL $current.RelPermalink) }}
{{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
<a href="{{ .URL }}" {{ if $active }}aria-current="page"{{ end }}>
<svg class="bookmark-icon" aria-hidden="true" focusable="false" viewBox="0 0 40 50">
@@ -23,4 +22,4 @@
</li>
{{ end }}
</ul>
-</nav>
\ No newline at end of file
+</nav>

View File

@ -1,7 +1,7 @@
---
title: "Add Archivarix archives to Hugo"
date: 2022-11-06T14:27:04+01:00
draft: false
date: 2022-12-18T18:27:04+01:00
tags: ["this blog","Archivarix", "gohugo"]
---
I want to add all my old articles to the Hugo posts list page.

4
v2/patching.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
git submodule update --recursive --remote
patch -p0 < add-posts-links-left-menu.patch --output=layouts/partials/nav.html
patch -p0 < add-legacy-urls-to-posts-list.patch --output=layouts/_default/list.html