From 643f9de5c8aaeaf16351564418486ef2c6ee5b65 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Fri, 22 Dec 2023 14:53:37 +0100 Subject: [PATCH] Rework blog --- .gitignore | 1 + content/posts/.gitkeep | 0 data/news.json | 14 -------------- layouts/shortcodes/news.html | 35 ++++++++--------------------------- 4 files changed, 9 insertions(+), 41 deletions(-) create mode 100644 content/posts/.gitkeep delete mode 100644 data/news.json diff --git a/.gitignore b/.gitignore index a8ee542..b1098d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ tailwindcss .hugo_build.lock resources/ +public/ diff --git a/content/posts/.gitkeep b/content/posts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/news.json b/data/news.json deleted file mode 100644 index 3b872b5..0000000 --- a/data/news.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "title": "Hello World", - "release": "2023-05-24", - "author": "LinuxSquare", - "content": "## Meow World" - }, - { - "title": "Bye World", - "release": "2023-05-26", - "author": "LinuxSquare", - "content": "" - } -] diff --git a/layouts/shortcodes/news.html b/layouts/shortcodes/news.html index e4a8124..3dab0d3 100644 --- a/layouts/shortcodes/news.html +++ b/layouts/shortcodes/news.html @@ -1,34 +1,15 @@
- {{ range .Site.Data.news }} + {{ range last 4 (site.GetPage "posts").Pages.ByDate }}
-

{{.title}}

- {{.release}} +

{{ .Title }}

+ {{ .Date | time.Format ":date_long" }}
-

- - + href="{{ .RelPermalink }}"> + Read more + {{ end }}
- -