-
Notifications
You must be signed in to change notification settings - Fork 1
Writing posts
alessandro contini edited this page Oct 23, 2017
·
4 revisions
Writing posts for the micro website's blog is very easy, but besides entering text content you need to pay attention to a couple of other details.
Let's open the 2017-09-19-first-post.md inside the Micro Website Template's /_posts/ folder in the root of the repository and start from the top
The frontmatter of a post is where all the metadata about the post live, and looks like this
---
layout: post
title: "First post EN"
subtitle: "The first test post in english"
date: 2017-09-19
image: "http://opencarecc.github.io/MicroWebsiteTemplate/assets/BG-post-img-02.jpg"
categories: ["category1"]
by: "Admin"
excerpt: "This is the excerpt for First Post EN"
lang: en
ref: first-post
---
- the
layouttag is mandatory and always have to be set topost - the
titletag contains the title of the post, it will be displayed on the browser tab or window, at the top of the post and wherever there is a preview of the post (blog page, news widget in home page ecc...)
- the
subtitlecontains a one liner that will only be displayed in the news widget
- the
datetag will be used to order posts (future posts are allowed), and it will be displayed right below the post title IMPORTANT please always keep theYEAR-MONTH-DAYlayout - the
authortag will contain information about the author of the post - The
excerpt:tag contains a brief summary of the post, if present it will only be displayed in the posts lists after the post image (or post title if there is no image), otherwise the system will automagically display the first paragraph of the post
- The
image:tag contains the URL to the post image, this image will be displayed at the top of the post, in the post preview in the posts list and in the news widget IMPORTANT: see the "Media content tips" section below for info about suggested image size - The
categories:tag contains a comma separated list of the post categories, it will be displayed below the post title IMPORTANT: you cannot just enter a category in a post to create the category, please see this page on how to handle posts categories
Please refer to this page for details about how to properly name a post file
All the text content of the post can be written in markdown, using the kramdown library.
- please see this page for a quick reference to layout elements
- for a quick preview of the text before pushing to github we suggest to:
- install the
Markdown Preview PlusorMarkdown Preview Enhancedpackages if you are using the Atom text editor - paste your text into https://kramdown.herokuapp.com/ for a quick preview
- install the
- in terms of content layout you are free to write your posts as you prefer, but we suggest to:
- don't use
h1headers as they are the one used only for main title throughout the website - don't use tables as they will easily break in mobile view
- don't use
- Images will always be placed in the middle of the post content column, this means:
- it won't be possible to wrap text around an image, either on the left or right side of the image
- we suggest to opt for landscape layout images with a resolution of circa 850px Width and 350px Height, so that the image would fit the whole width of the post container and won't steal too much vertical real estate
- if you want to post a tryptic kind of image layout we suggest to assemble the images in a single image
- It is also possible to embed and show other kinds of media in post and pages, to do that please paste the following code snippet into your blog post and point the URL to your file
<iframe src="https://drive.google.com/file/d/0B2Qw-X5Jj_X_LU44S0hHdDdBSTg/preview" width="640" height="480"></iframe>
All post content can (and should) be translated in all available website languages. For more details on how to translate posts please see How to translate posts