From cb392f8fa0d0680be710ca8929e4a2f7e59352d3 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Mon, 1 Nov 2021 22:28:58 -0500 Subject: [PATCH] Speed up page build a bit --- _includes/footer.html | 9 +-------- _includes/nav.html | 18 ++++++++++-------- _layouts/wiki.html | 19 ++++++++----------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/_includes/footer.html b/_includes/footer.html index 30be027c..05a53b15 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -12,14 +12,7 @@
- {% assign source = site.repo | append: "/blob/main/pages" %} - {% if page.collection == "en-US" %} - {% assign source = source | append: "/_en-US" | append: page.url | replace: ".html", ".md" %} - {% else %} - {% assign url = page.url | remove_first: "/" %} - {% assign source = source | append: "/_" | append: url | replace: ".html", ".md" %} - {% endif %} - {% assign source = source | %} + {% assign source = site.repo | append: "/blob/main/pages/" | append: page.path %} {{ site.data[page.collection].strings.published-with | replace: "$1", source }}

diff --git a/_includes/nav.html b/_includes/nav.html index 47b0cf8a..05fd1318 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -37,19 +37,21 @@ diff --git a/_layouts/wiki.html b/_layouts/wiki.html index e0c2f0e0..474c347c 100644 --- a/_layouts/wiki.html +++ b/_layouts/wiki.html @@ -20,12 +20,11 @@ layout: compress {% comment %} Get category list {% endcomment %} {% assign items = site[page.collection] | where: "section", page.section | sort_natural: "title" %} {% comment %} First do the index {% endcomment %} - {% for item in items %} - {% if item.url contains "index.html" %} - {{ item.title }} -
- {% endif %} - {% endfor %} + {% assign item = items | where_exp: "item", "item.url contains 'index.html'" | first %} + {% if item %} + {{ item.title }} +
+ {% endif %}