Blog Details Page
To create a new blog details page :
- Open your code editor.
- Create a new file.
- Copy code from the Get Starter Kit Codes section at the bottom of the documentation.
- Set
blogTitlevariable value. - Set
blogDetailsvariable value.
TheblogDetails.illustrationandblogDetails.author.photovalues is name of image file in thesrc/assets/images/folder. - Arrange content as desired between
{# block blogDetailContent #}and{# endblock #}. - Save the file as
blog-details-name.twigin thesrc/twig/directory. - The
gulpcommand will automatically compile changes inblog-details-name.twigtoblog-details-name.htmlin the root project directory.
Get Starter Kit Codes
The following is a Starter Kit Codes that you can use to create a new blog details page. You can copy the codes into your code editor application.
{# blog-details-name.twig : Blog details twig file will be compiled into blog-details-name.html #}
{# extends default layout #}
{% extends "layouts/blog-details.twig" %}
{# set required variables #}
{% set blogTitle = 'Blog-News Title' %}
{% set blogDetails = {
'illustration' : 'blog-detail-illustration.png',
'meta' : {
'tag' : 'Blog Tag',
'description' : 'Month YY · x min read',
},
'author' : {
'name' : 'Author Name',
'position' : 'Author Position',
'photo' : 'author-photo.png',
}
} %}
{% set pageClasses = 'page-blog-details' %}
{# end set required variables #}
{# block blog detail content #}
{% block blogDetailContent %}
{# write blog contents here #}
{% endblock %}
{# end block main content #}