From 117bf0467c40ab0b15e55d0437f5a72a5f99aec9 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Tue, 14 May 2024 02:03:20 +0200 Subject: [PATCH] feat: new archives; show only 10 recent at home --- _config.yml | 9 +++++++++ _layouts/archive.html | 14 ++++++++++++++ _layouts/home.html | 8 ++++++-- archives.html | 19 +++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 _layouts/archive.html create mode 100644 archives.html diff --git a/_config.yml b/_config.yml index 5747617..417f40e 100644 --- a/_config.yml +++ b/_config.yml @@ -48,6 +48,8 @@ defaults: navigation: - text: Home url: / + - text: "Archives" + url: /archives/ - text: "All Topics" url: /categories/ - text: "About" @@ -150,3 +152,10 @@ prose: # - vendor/cache/ # - vendor/gems/ # - vendor/ruby/ + +jekyll-archives: + enabled: + - year + layout: archive + permalinks: + year: 'archives/:year/' diff --git a/_layouts/archive.html b/_layouts/archive.html new file mode 100644 index 0000000..eaf91e9 --- /dev/null +++ b/_layouts/archive.html @@ -0,0 +1,14 @@ +--- +layout: default +--- + +

Archive of posts from {{ page.date | date: "%Y" }}

+ + diff --git a/_layouts/home.html b/_layouts/home.html index 0c2cfce..1e1a22f 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -4,10 +4,14 @@ layout: default
- {% if site.posts.size > 0 %} {% endif %} +

+ See more at the archives. +

diff --git a/archives.html b/archives.html new file mode 100644 index 0000000..75555c2 --- /dev/null +++ b/archives.html @@ -0,0 +1,19 @@ +--- +layout: category +category-name: entertainment +title: Entertainment Posts +permalink: /entertainment/ +--- + +

Entertainment Posts

+ +
+ {% if site.categories.entertainment.size > 0 %} + + {% else %} + No posts to show. + {% endif %} +