Skip to content
New issue

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

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

Already on GitHub? # to your account

Is there a way to include content in the home page layout? #1773

Closed
mrmanc opened this issue Aug 7, 2018 · 4 comments · Fixed by #1775
Closed

Is there a way to include content in the home page layout? #1773

mrmanc opened this issue Aug 7, 2018 · 4 comments · Fixed by #1775

Comments

@mrmanc
Copy link
Contributor

mrmanc commented Aug 7, 2018

Description

I’d like to be able to include content from the body of the page when using the home page layout. This way I can have an introductory paragraph above a list of recent posts.

It looks like this could be achieved by including {{content}} in the layout, just above the <h3…>…</h3> line.

Environment

  • Ruby gem or remote theme version: 4.12.0
  • Jekyll version: 3.7.3
  • Git repository URL:
  • Operating system:
  • GitHub Pages hosted (if yes provide URL to site):

Expected behavior

The text from the content of the page should be included above the ‘Recent Posts’ heading.

Steps to reproduce the behavior

Create a page with the following contents.

---
layout: home
---
Here is some text to go in the introductory paragraph.
@mmistakes
Copy link
Owner

Yes, that's how you'd do it.
You could also try and use the archive layout which has the {{ content }} tag placed in the appropriate location.

The home layout is very similar to it, just simplified to omit some things.

@mrmanc
Copy link
Contributor Author

mrmanc commented Aug 8, 2018

Thanks for the response. I am keen to retain the list of recent posts, so the archive layout doesn’t seem appropriate.

I realise from your response that it sounded like I was asking how to achieve this result myself; I was actually wondering if there was a reason that the home layout distributed in the theme doesn’t already include content from the body of the page.

It seems a little unintuitive to a newcomer, so I wondered whether I was missing some alternative way of achieving the same effect without creating a new layout.

@mmistakes
Copy link
Owner

No obvious reason why {{ content }} isn't in the home layout. Just a miss on my part.

Happy to look at a pull request if you want to add it.

@mrmanc
Copy link
Contributor Author

mrmanc commented Aug 8, 2018

Fab, that’s what I was hoping to hear 😃I’ve raised a pull request.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants