From 378bdd7fb33143b1511111c7c65ce4e820d98e91 Mon Sep 17 00:00:00 2001 From: kaliban Date: Wed, 7 Aug 2024 15:50:30 +0200 Subject: [PATCH] added archives page --- content/archives.md | 6 ++ content/layouts/archive/list.html | 8 ++ hugo.toml | 8 +- layouts/_default/archives.html | 83 +++++++++++++++++++ public/404.html | 4 +- public/about/index.html | 4 +- public/archives/index.html | 9 ++ public/categories/index.html | 4 +- public/categories/index.xml | 8 +- public/index.html | 14 ++-- public/index.xml | 52 ++++++------ public/layouts/index.html | 7 ++ public/layouts/index.xml | 16 ++++ public/layouts/page/1/index.html | 2 + public/page/1/index.html | 4 +- public/page/2/index.html | 12 +-- public/posts/index.html | 14 ++-- public/posts/index.xml | 44 +++++----- .../posts/overthewire-bandit-0-1/index.html | 12 +-- public/posts/overthewire-bandit-0/index.html | 12 +-- .../posts/overthewire-bandit-1-2/index.html | 12 +-- .../posts/overthewire-bandit-2-3/index.html | 12 +-- .../posts/overthewire-bandit-3-4/index.html | 12 +-- .../posts/overthewire-bandit-4-5/index.html | 12 +-- .../posts/overthewire-bandit-5-6/index.html | 12 +-- .../posts/overthewire-bandit-6-7/index.html | 8 +- public/posts/page/1/index.html | 4 +- public/posts/page/2/index.html | 12 +-- public/posts/welcome/index.html | 8 +- public/projects/index.html | 8 +- public/robots.txt | 2 +- public/sitemap.xml | 40 +++++---- public/tags/bandit/index.html | 14 ++-- public/tags/bandit/index.xml | 40 ++++----- public/tags/bandit/page/1/index.html | 4 +- public/tags/bandit/page/2/index.html | 10 +-- public/tags/cyber-security/index.html | 14 ++-- public/tags/cyber-security/index.xml | 40 ++++----- public/tags/cyber-security/page/1/index.html | 4 +- public/tags/cyber-security/page/2/index.html | 10 +-- public/tags/index.html | 4 +- public/tags/index.xml | 20 ++--- public/tags/over-the-wire/index.html | 14 ++-- public/tags/over-the-wire/index.xml | 40 ++++----- public/tags/over-the-wire/page/1/index.html | 4 +- public/tags/over-the-wire/page/2/index.html | 10 +-- 46 files changed, 417 insertions(+), 276 deletions(-) create mode 100644 content/archives.md create mode 100644 content/layouts/archive/list.html create mode 100644 layouts/_default/archives.html create mode 100644 public/archives/index.html create mode 100644 public/layouts/index.html create mode 100644 public/layouts/index.xml create mode 100644 public/layouts/page/1/index.html diff --git a/content/archives.md b/content/archives.md new file mode 100644 index 0000000..5628e34 --- /dev/null +++ b/content/archives.md @@ -0,0 +1,6 @@ +--- +title: "Archive" +layout: "archives" +url: "/archives/" +summary: archives +--- diff --git a/content/layouts/archive/list.html b/content/layouts/archive/list.html new file mode 100644 index 0000000..2d80dae --- /dev/null +++ b/content/layouts/archive/list.html @@ -0,0 +1,8 @@ +--- +title: "Content Placeholder" +_build: + render: never + list: never + publishResources: false +--- + diff --git a/hugo.toml b/hugo.toml index 5af549b..d04a04a 100644 --- a/hugo.toml +++ b/hugo.toml @@ -98,7 +98,7 @@ SiteVerificationTag = "XYZabc" hiddenInSingle = true [params.editPost] - URL = "https://github.com//content" + URL = "https://github.com/kaliban2056/kaliban2056.github.io/content" Text = "Suggest Changes" appendFilePath = true @@ -130,5 +130,11 @@ name = "about" url = "/about/" weight = 30 +[[menu.main]] +identifier = "archives" +name = "archives" +url = "/archives/" +weight = 40 + [markup.highlight] noClasses = false diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html new file mode 100644 index 0000000..eea3fc8 --- /dev/null +++ b/layouts/_default/archives.html @@ -0,0 +1,83 @@ +{{- define "main" }} + + + +{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} + +{{- if site.Params.ShowAllPagesInArchive }} +{{- $pages = site.RegularPages }} +{{- end }} + +{{- range $pages.GroupByPublishDate "2006" }} +{{- if ne .Key "0001" }} +
+ {{- $year := replace .Key "0001" "" }} +

+ + {{- $year -}} + +  {{ len .Pages }} +

+ {{- range .Pages.GroupByDate "January" }} +
+

+ + {{- .Key -}} + +  {{ len .Pages }} +

+
+ {{- range .Pages }} + {{- if eq .Kind "page" }} +
+

+ {{- .Title | markdownify }} + {{- if .Draft }} + + + + + + {{- end }} +

+
+ {{- partial "post_meta.html" . -}} +
+ +
+ {{- end }} + {{- end }} +
+
+ {{- end }} +
+{{- end }} +{{- end }} + +{{- end }}{{/* end main */}} diff --git a/public/404.html b/public/404.html index b44003f..9053270 100644 --- a/public/404.html +++ b/public/404.html @@ -1,5 +1,5 @@ -404 Page not found | Kaliban's Blog -
404