Showing the latest blog post in the home page

How can I show the latest blog post in its entirety on the home page using Essay. The user could them scroll down to see more posts.

3 replies

The latest post inside your template's list of entries can be targeted using the following selector:

{{#entries}}

{{#first}} {{^pagination.previous}}

... Will appear only for the most recent entry ...

{{/pagination.previous}} {{/first}}

... Will appear for all entries ...

{{/entries}}

Answered 2 years ago · Improve this answer

I have a similar question: I want to show my most recent blogpost title (and Link) on my landing page. How would I achieve that? Thank you very much!

Answered 2 years ago · Improve this answer

To show this only on your landing page, you could use custom metadata. In the source file for the landing page, we'll add custom Latest metadata at the start:

Latest: yes
Link: /

Landing page content goes here...

And in your template's entry.html you would add the following:

{{#entry.metadata.latest}}
{{#recent_entries}} {{#first}} 

<a href="{{{url}}}">{{title}}</a>

{{/first}} {{/recent_entries}}
{{/entry.metadata.latest}}

If you wanted the most recent blogpost title after the landing page's main content, you would insert this after {{{html}}} in your template's entry.html file.

Answered 2 years ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 28 questions bug 14 questions posts 9 questions resolved 7 questions request 6 questions google-drive 5 questions configure 4 questions pages 3 questions added 3 questions meta 3 questions More tags →
Subscribe for changes
RSS Feed of latest questions