I need show only partial blog post... with a "Read more" link to full blog post.
HOME: List last 5 partial/intro posts with Read More.
This is possible in Docpad?
Thanks..
I need show only partial blog post... with a "Read more" link to full blog post.
HOME: List last 5 partial/intro posts with Read More.
This is possible in Docpad?
Thanks..
If you are wanting different pages for the before more and after more, you can use the paged plugin with their Splitting a Document into Multiple Pages example.
Something like:
Should do the trick. Then you can just custoimse the logic to handle different use cases. For instance, ths will have the "before more" text shown on both pages. But you could wrap "before more" in a "is page 0" check to prevent that if you wished.
Just as another way, I use the following method in docpad.coffee to truncate posts for display on a home page. It deals with links, which will make text seem longer and blockquotes which you might end up breaking in the middle
May by
more
and
posts
and add to post
If you are not wanting different pages for the before more and after more, but just wanting to use before more in the content listing. You can just put your before more stuff in a "description" meta data attribute like so:
Then you can display the description in your content listing by doing:
Which will fallback to the full content if the description is not defined.
If you want to be able to have your description rendered, the text plugin has you covered. Change your meta data description to the following instead: