From bca2f6589222ac70de4b663aa5fdc598cdef3f7a Mon Sep 17 00:00:00 2001 From: jinningwang Date: Mon, 31 Aug 2026 18:22:22 -0700 Subject: [PATCH] Fix showcase related content --- README.md | 2 +- _config.yml | 13 +++++++------ _includes/head.html | 1 + _includes/scripts.html | 1 - _layouts/single.html | 19 +++++++++++-------- _layouts/splash.html | 2 -- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 3be926c..cff715c 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Overview -This repository contains the source code for the LTB project website. The site is hosted using GitHub Pages at `curent.github.io` and redirects to `ltb.curent.org` (see the `CNAME` file for details). The website is built using the Minimal Mistakes Jekyll theme. +This repository contains the source code for the LTB project website. The site is hosted using GitHub Pages at `ltb.curent.org`; the legacy `curent.github.io` address redirects there (see the `CNAME` file for details). The website is built using the Minimal Mistakes Jekyll theme. ## Changes We've Made Based on the Original Template diff --git a/_config.yml b/_config.yml index bcb6f1e..44b92db 100755 --- a/_config.yml +++ b/_config.yml @@ -22,7 +22,7 @@ title_separator : "-" subtitle : Large-scale Testbed # site tagline that appears below site title in masthead name : "LTB" description : "" -url : "https://curent.github.io" # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" +url : "https://ltb.curent.org" # the canonical hostname and protocol for the site baseurl : "" # the subpath of your site, e.g. "/blog" repository : "CURENT/curent.github.io" # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png" @@ -105,7 +105,7 @@ social: # Analytics analytics: - provider : google # false (default), "google", "google-universal", "google-gtag", "custom" + provider : google-gtag # false (default), "google", "google-universal", "google-gtag", "custom" google: tracking_id : G-5R91XH96PB anonymize_ip : # true, false (default) @@ -238,8 +238,8 @@ timezone: # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones # Pagination with jekyll-paginate -paginate: 5 # amount of posts to show -paginate_path: /page:num/ +# The site uses the `showcase` collection rather than blog posts, so the +# inherited post pagination setting is intentionally disabled. # Pagination with jekyll-paginate-v2 # See https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#site-configuration @@ -333,12 +333,13 @@ defaults: # showcase - scope: path: "" - type: pets + type: showcase values: layout: single author_profile: false share: true - comment: true + comments: true + related: true # Collections collections: diff --git a/_includes/head.html b/_includes/head.html index c214bea..b3b1a08 100755 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,6 +1,7 @@ {% include seo.html %} +{% include analytics.html %} {% unless site.atom_feed.hide %} diff --git a/_includes/scripts.html b/_includes/scripts.html index 3d5dcec..ecf64e4 100755 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -18,7 +18,6 @@ {%- endcase -%} {% endif %} -{% include analytics.html %} {% include /comments-providers/scripts.html %} {% if site.after_footer_scripts %} diff --git a/_layouts/single.html b/_layouts/single.html index 543fe47..f5ea7ee 100755 --- a/_layouts/single.html +++ b/_layouts/single.html @@ -70,13 +70,16 @@

{{ site.data.ui-text[site.locale].meta_label }}

- {% comment %}{% endcomment %} - {% if page.id and page.related and site.related_posts.size > 0 %} - {% include page__related.html posts=site.related_posts %} - {% comment %}{% endcomment %} - {% elsif page.id and page.related %} - {% include page__related.html posts=site.posts %} + {% comment %}{% endcomment %} + {% if page.id and page.related %} + {% assign related_posts = site.related_posts %} + {% if related_posts.size == 0 and page.collection %} + {% assign related_posts = site[page.collection] %} + {% endif %} + {% if related_posts.size > 0 %} + {% include page__related.html posts=related_posts %} + {% elsif site.posts.size > 0 %} + {% include page__related.html posts=site.posts %} + {% endif %} {% endif %} - -{% include scripts.html %} diff --git a/_layouts/splash.html b/_layouts/splash.html index 1681376..394209d 100755 --- a/_layouts/splash.html +++ b/_layouts/splash.html @@ -20,5 +20,3 @@ - -{% include scripts.html %}