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}}

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!

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

Landing page content goes here...

{{#entry.metadata.latest}}
{{#recent_entries}} {{#ﬁrst}}

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

{{/ﬁrst}} {{/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.