Skip to content

posts_page doesn't work in welcome.html #259

@chizmeeple

Description

@chizmeeple

I've only looked at posts_page, I haven't tried any of the other options in the file.

Jekyll 4.2.0; relies on the localised version mentioned in #258

I've had real trouble getting it to match anything, and after some investigation I believe that this is the required change:

diff --git a/#jekyll-theme-hydejack/_layouts/welcome.html b/#jekyll-theme-hydejack/_layouts/welcome.html
index b3a9e43..26dcbaf 100644
--- a/#jekyll-theme-hydejack/_layouts/welcome.html
+++ b/#jekyll-theme-hydejack/_layouts/welcome.html
@@ -101,7 +101,7 @@ layout: about
 {% assign posts_page = page.posts_page | default:page.more_posts %}
 {% if posts_page %}
   {% if major >= 4 and minor >= 1 %}
-    {% assign more_posts = site.pages | find_exp:"page", "posts_page == page.path or posts_page == page.url" %}
+    {% assign more_posts = site.documents | find_exp:"page", "posts_page == page.path or posts_page == page.url" %}
   {% else %}
                            {% assign more_posts = site.pages | where_exp:"page", "posts_page == page.path" | first %}
     {% unless more_posts %}{% assign more_posts = site.pages | where_exp:"page", "posts_page == page.url"  | first %}{% endunless %}

for this to work:

---
layout: welcome
title:  chisel's place
cover:  true
posts_page: /blog/
---

<!--author-->

## Recent Posts

<!--posts-->

with this featured category:

---
layout: grid
title:  Blog
slug:   blog
description: >
  Sometimes ideas just need writing down.
---

Without this change, I see:

Page with path <code></code> not found.

With this change, I see (the expected):

See Blog for more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions