Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts_page doesn't work in welcome.html #259

Closed
chizmw opened this issue Feb 10, 2021 · 2 comments
Closed

posts_page doesn't work in welcome.html #259

chizmw opened this issue Feb 10, 2021 · 2 comments

Comments

@chizmw
Copy link

chizmw commented Feb 10, 2021

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
@qwtel qwtel closed this as completed in 2b5cfd2 Feb 11, 2021
@qwtel
Copy link
Member

qwtel commented Feb 11, 2021

Ah I see. Jekyll doesn't treat the blog layout as a page, which is why it's missing. However, site.documents only solves the problem for your specific case, because it doesn't include pages. What's missing is a collection of all pages and documents, that Jekyll doesn't provide by itself. Using this in 9.1.2:

{% assign nodes = site.html_pages | concat: site.documents %}

@chizmw
Copy link
Author

chizmw commented Feb 11, 2021

Thanks for this. I had a feeling this wasn't 100% correct in the general case, but couldn't fully get my head round the problem space.

chizmw added a commit to chizmw/site-malik-wright.uk that referenced this issue Feb 11, 2021
This now works after the resolution of
hydecorp/hydejack#259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants