From ce41555c3d084025d36cecd57da68fa2ad42c1bb Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 10 Oct 2021 10:55:21 -0700 Subject: [PATCH] Move recent posts list to a shortcode and include it in the index content file --- content/_index.md | 4 ++++ layouts/_default/index.html | 28 ---------------------------- layouts/shortcodes/recent_posts.html | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 layouts/shortcodes/recent_posts.html diff --git a/content/_index.md b/content/_index.md index 1e415e2..ad5468e 100644 --- a/content/_index.md +++ b/content/_index.md @@ -10,6 +10,10 @@ where I got a degree in Computer Science. {{< tess >}} is my girlfriend. I speak English natively, and Spanish too, though I always need more practice. +## Recent Posts + +{{< recent_posts >}} + ## Hobbies I have a big appetite for learning new skills, especially things that combine diff --git a/layouts/_default/index.html b/layouts/_default/index.html index c2a79c0..f6f9bd0 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -9,32 +9,4 @@ {{ .Content }} - -{{ $pages := union .RegularPages .Sections }} -{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} -{{ end }} - - -
-

Recent Posts

- -
- - -{{ if gt $paginator.TotalPages 1 }} - -{{ end }} - {{ end }} diff --git a/layouts/shortcodes/recent_posts.html b/layouts/shortcodes/recent_posts.html new file mode 100644 index 0000000..8aa4bca --- /dev/null +++ b/layouts/shortcodes/recent_posts.html @@ -0,0 +1,24 @@ + + +{{ if gt $paginator.TotalPages 1 }} + +{{ end }} \ No newline at end of file