Compare commits
2 Commits
a5ae01212a
...
84baa1d098
Author | SHA1 | Date | |
---|---|---|---|
84baa1d098 | |||
87d86e7f4e |
28
v2/add-legacy-urls-to-posts-list.patch
Normal file
28
v2/add-legacy-urls-to-posts-list.patch
Normal 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 }}
|
19
v2/add-posts-links-left-menu.patch
Normal file
19
v2/add-posts-links-left-menu.patch
Normal 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>
|
|
@ -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
4
v2/patching.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user