liquid - Jekyll for loop can't work as expected -
i created new page, there loop display list of posts, can't work expcted
and here code:
<!doctype html> <html> <head> <title></title> </head> <body> <ul> {% post in site.posts %} <li> <a href="{{ post.url }}">{{ post.title }}</a> {{ post.excerpt }} </li> {% endfor %} </ul> </body> </html>
add front matter jekyll knows has process it.
simply add 2 lines of dashes @ beginning of file:
--- --- <!doctype html> <html> <head> <title></title> </head> <body> <ul> {% post in site.posts %} <li> <a href="{{ post.url }}">{{ post.title }}</a> {{ post.excerpt }} </li> {% endfor %} </ul> </body> </html>
Comments
Post a Comment