From 0059239ba294fec16936952a26c7a91c573ed5a6 Mon Sep 17 00:00:00 2001 From: Kang Miao Date: Sat, 26 Dec 2020 16:21:28 +0800 Subject: [PATCH] Add weight flag for pages to allow sort navbar. --- _includes/nav.html | 3 ++- about.html | 1 + archive.html | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/_includes/nav.html b/_includes/nav.html index f24d6457dbd..9837ec19e68 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -23,7 +23,8 @@
  • Home
  • - {% for page in site.pages %} + {% assign sorted_pages = site.pages | sort: "weight" %} + {% for page in sorted_pages %} {% if page.title and page.hide-in-nav != true %}
  • {{ page.title }} diff --git a/about.html b/about.html index b8527fc7b16..166d24d10d3 100644 --- a/about.html +++ b/about.html @@ -1,4 +1,5 @@ --- +weight: 0 layout: page title: "About" description: "你是我的梦想" diff --git a/archive.html b/archive.html index c54495ec92b..cd9fc7e52cf 100644 --- a/archive.html +++ b/archive.html @@ -1,4 +1,5 @@ --- +weight: 1 title: Archive layout: default description: keep hungry keep foolish