How-to: How to add a new blog post?
How to add a new blog post?
Step 1
Add a new json file in the source/pages/blog
directory:
source
+--- pages
+--- blog
+--- my-first-blog-post.html.json
The file must contain all the data for the blog post:
{
"content": "content/blog/my-first-blog-post.html",
"meta_title": "My first blog post",
"meta_description": "This is my first blog post",
"title": "My first blog post",
"date": "2032-12-10",
"author": "John Doe",
"intro": "This is my first blog post.",
"tags": ["post", "sitemap"]
}
Step 2
Create the blog post content file:
source
+--- content
+--- blog
+--- my-first-blog-post.html
Write the HTML content of the new post:
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
Browse to http://127.0.0.1:1985/blog/my-first-blog-post.html
Next
- How to add a new block?
- ✓ How to add a new blog post?
- How to build reusable HTML components?
- How to implement a custom plugin?
- How to display a list of items?
- How to display a list of links?
- How to add dynamic data to a page with a plugin?
- How to use Stapy on Windows?
- How to host my static website for free?
- How to auto-deploy my website with GitHub Action?
- How to write content in Markdown?
- How to add a JSON feed?
- How to use Stapy with Apache HTTP Server?
- How to update Stapy?