From 1bb3840c1f6a1df43cde900733c75e408190876e Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Wed, 4 Nov 2020 15:12:56 +0530 Subject: [PATCH] papermod: how-tos : add pin a post guide --- content/posts/papermod/papermod-how-to.md | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/content/posts/papermod/papermod-how-to.md b/content/posts/papermod/papermod-how-to.md index c325ae43..7e09db90 100644 --- a/content/posts/papermod/papermod-how-to.md +++ b/content/posts/papermod/papermod-how-to.md @@ -102,6 +102,32 @@ and contents of `extend_footer.html` will be added to bottom of page. --- +## Pin a Post + +Post can be pinned/ displayed top on the list by adding a `weight=` var to page-variables + +example: + +```yml +--- +title: "My Important post" +date: 2020-09-15T11:30:03+00:00 +weight: 1 +--- + +``` + +```yml +--- +title: "My 2nd Important post" +date: 2020-09-15T11:30:03+00:00 +weight: 2 +--- + +``` + +--- + ## References - [Override a Hugo theme](https://zwbetz.com/override-a-hugo-theme/)