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 }}
- -