Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

How to display complete posts instead of excerpts?

  • #6873
    Avatar photo[anonymous]

    Hello!

    I am brand new to Publii and it seems to be a fantastic tool. I am used to generating static sites via Hugo or Jekyll but for my wife, this is a godsend.

    When setting up her test site I was trying to find a way to publish whole posts instead of just excepts. Is this possible?

    #6874
    Avatar photoBob

    The easiest and more simple way to do this is to use the Readmore button at the end of the post content.
    You can also edit the index.hbs file ‎⁨(Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME) and change the following part of code:

    {{#if hasCustomExcerpt}}
       {{{ excerpt }}}
    {{else}}
       <p>{{{ excerpt }}}</p>
    {{/if}}

    to:

    {{#if hasCustomExcerpt}}
       {{{ excerpt }}}
    {{else}}
       {{{ text }}}
    {{/if}}

    That’s it.

    To preserve your custom code and prevent it being overwritten the next time the theme is updated, please ensure that you have created override files; these are, essentially, copies of the existing theme files that are stored separately from the main theme fileshttps://getpublii.com/dev/theme-overrides/