It's time to write your first post
Visit localhost:4000/admin to use admin functions.
This is default login credential
username: admin
password: 123123
Click button New post
to start writing a new post. Default editor is markdown editor.
This is the standard format of a post.
---
title: this is a title
slug: my-first-post
date: 2019-10-01
categories: CategoryA, CateogryB
tags: Tag1, Tag2
draft: true
cover: "your photo url here"
---
this is excerpt
---
your blog content here
The post has 3 sections separated by ---
- title: your post title
- slug[optional]: slug in used to access your article, instead of using id.
slug
will be automatically generated fromtitle
if you don't set it. The slug must be unique for each post. In the above case, the url for this post islocalhost:4000/posts/my-first-post
. - date: published date. It is used to order your posts. Date must follow format
YYYY-MM-DD
- categories[optional]: List of your post's categorie. If category does not exist, it will be added to database.
- tags[optional]: Your post's tags. It will be added to database if not existing.
- draft[optional]: Set it to
true
to unpublish your post. Default isfalse
- cover[optional]: Provide a cover photo for your post if your template use it.
The second sections after the Metadata section is post's exerpt
If there is only 2 sections, the second section will be used as post content. If there are 3 sections, 3rd section is used as post content.
Similar to post, but there are some differences:
- Page has only 2 sections,
metadata
andcontent
. - Page doesn't have
categories
andtags
- Page support
template
options which allow you to set template layout for your page. Templates are placed in<theme>/templates/page_templates
This is a sample page
---
title: this is a page with template
slug: about-markdown
is_draft: false
template: custom_template
---
# hello, This is a page with custom template
----
## what is Markdown?
see [Wikipedia](https://en.wikipedia.org/wiki/Markdown)
> Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)".
----
## usage
1. Write markdown text in this textarea.
2. Click 'HTML Preview' button.
This page URL can be access via: localhost:4000/pages/about-markdown
and it use template custom_template.html.eex