Post
You can create a post by adding a new markdown file with .md
extension to your repository. If you are using a specific folder (blogFolder
specified in truegit.yaml
file) for all your posts, the file must be inside that folder. We support Github Flavored markdown.
Each post can be configured by adding the front matter to your file. The front matter should be at the top of your file
and is enclosed by ---
.
---
title: This is my post title
subTitle: This is a description of this post.
date: 1989/07/11
bannerImage: ./banner.png
slug: this-is-my-slug
disableSuggestEdit: false
tags: [kubernetes, graphql]
weight: 5
draft: true
authors:
- author-1
- author-2
featured: true
---
Hey this is my first post. _How do you like it?_
Below are the fields that can be configured for your posts.
Title
The title of your post.
Default: First H1 tag of your post
title: My post's title
Subtitle
The subtitle of your post.
Default: Empty
subTitle: My post's sub title
Publish Date
The date the post is published on.
Default: The file commit date.
Supports Date.parse method
Examples: "YYYY-MM-DD", "Month Date, Year"
date: 1989/07/11
Banner Image
The banner image of your post. It must be a path to an image file in your repository.
Supports png
, jpeg
, jpg
, and webp
formats.
bannerImage: ./banner.png
Slug
The absolute path for your post shown on the URL.
Default: The path to your post relative to the root folder.
Example: If you have a post located at /blog/collection/my-post.md, it will have the default slug /collection/my-post
.
If you want the slug to be /this-is-my-slug
, you can use
slug: this-is-my-slug
Tags
Tags are a way to organize your posts by hashtags. It allows your viewer to see all the posts with a specific tag.
tags: [kubernetes, graphql]
Weight
Weight can be used to order the post. Higher the weight, higher it is on the list. By default the posts are ordered by publication date.
weight: 5
Authors
The IDs of authors of this post. To reference an author, you must add the author in your blog configuration file.
Default: No authors
Example
authors:
- author-1
- author-2
You must add the authors in truegit.yaml
before referencing them
authors:
author-1:
name: Author 1
title: Short title
description: Long descripiton
author-2:
name: Author 2
title: Short title
description: Long descripiton
Edit Suggestion
By default, the viewers may suggest an edit to your posts on Truegit or on public Github repository. Every suggestion made on Truegit creates a Pull Request in your repository. To disable this for an individual post, you can use
disableSuggestEdit: true
Draft
By default, every post create in your repository is published to your blog. If you want to keep a post in the draft state, you may use the draft
flag.
Note that a draft can only be viewed by you.
draft: true
Skip Listing
Sometimes you may not want a post to be listed but is can be viewed. For instance, you may not want to list the about.md
page. Setting skipListing
flat to true removes the post from any of the lists.
skipListing: true
Featured Post
To feature a post on the landing page of your blog, you can use the featured
flag. Note that we currently feature only one post per blog.
Default: No posts are featured. They are sorted in descending order of the publish date.
featured: true