I am setting my blog up using the fantastic Jekyll. Question is my markdown files are being shown in full on the homepage. How do i make them look more like this? So that only a little bit comes up with the title? Thanks.
EDIT: As of Jekyll 1.0, this is not longer necessary (Answer is outdated).
Jekyll 1.0 exports a post.excerpt
variable that contains the first paragraph of a post by default.
/Edit
So, you want to show an excerpt of the post, instead of the full post?
Theres three ways to do that:
post.content
, use the truncate
filter to truncate it and the markdownify
filter to render it. {{post.excerpt | markdownify}}
{{post.excerpt | markdownify}}
(that is what i do on my blog) Each of those blocks between horizontal lines are links to the actual blog post. Any time I have a question about how someone did something on their webpage I always view-source.
The source for that page is - view-source:http://daverupert.com/
To find out how to do something in markdown I like this site - http://daringfireball.net/projects/markdown/basics
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.