Every post at Genics Blog starts as a draft. In this section you’ll learn how to create a draft post.
- An author profile.
- Fork the blog repository to your github profile.
- Get a gist of how to add UI elements to your post.
The content at genicsblog.com is written in Markdown. This means that you can write your content in plain text and it will be rendered to HTML automatically. Let’s create a draft post in markdown!
Once you fork the repository, you can start writing your post. For drafts, even editing on the GitHub interface works fine.
_drafts folder in the editor of your choice. To create a new draft, press the Create a new file button on the right hand side.
In the editor, give your file a name. Let’s say you want to create a draft titled How to write a draft, the file name for this post would become:
- All the alphabets in the file name must be lowercase.
- All the blank spaces and special characters should be avoided, replace with
-to seperate words.
- File must end in extension
.mdto specifiy a markdown file.
Genics Blog requires each post/draft to have a frontmatter that defines the title, description, and other metadata. This is declared at the very top of the file within
Note: To ease the process explained below, you can use the frontmatter generator tool and copy the generated content to the top of your file.
To manually generate frontmatter, here’s an example of a minimal valid frontmatter that Genics Blog understands:
--- layout: post title: "How to write a draft" excerpt: "The complete guide you'll need to refer to create mind blowing drafts." description: "This is shown to the search engines. If undefined, excerpt is used as the description." image: "A url of the hosted image. Paste the image to a comment box on GitHub issues to generate a link quickly." hasCode: true category: coding tags: ["blogging", "tips"] author: gouravkhunger ---
Omit any of the variables if you don’t want to use them!
layoutdefines what kind of page it will be (for articles, always keep it
titleis the title of the post that will be shown in bold at the blog.
excerptis a short sentence - a summary of the artilce.
imageis the image url where the thumbnail of this post is hosted. We do not host images, so you need to drag and drop your preferred thumbnail to the GitHub editor and it will automatically generate a URL for the hosted image.
hasCodeis a boolean value determining if the article has code blocks/snippets. If your post doens’t require snippets, simply remove this key from the front matter. This is used to load
prism.jsif the value of this key is
categorydefines what topic the post is about. Please use only one category per post.
tagdefines what smaller topics the post is about. Please use a maximmum of 3 tags per post. Exceptions can be made, contact us in that case.
authoris the username of the author of the post. It was defined when you made a contributor profile.
Here are some optional values you can define for your post:
--- # Other variables here original: "https://docs.genicsblog.com/author/writing-the-article" notice: "**Markdown** is supported in this _one_ so you could do [such things](https://genicsblog.com)!" ---
originalis used to define the original URL of the post (only applicable if you are cross-posting.)
noticeis a notice that will be shown at the top of the post. You could add some note about the prerequisites for a tutorial, or any other info you want to show.
After you are done with the frontmatter, you can start writing the content of your post below the
Please read the UI Components guide to learn how to add various elements to your post.
Please DO NOT edit any file outside the drafts folder while you are writing your draft, and DO NOT change with other author’s drafts. This will cause the Pull request checks to fail and delay the review process because of the needed investigation.
Repeated attempts to bypass/hack the CI system will result in a permanent ban from the site, the discord community and will result in deletion of your profile.
At this point, you’ll want to preview how the draft would look like on the site.
Once your PR is successfully merged, the draft will appear to a link similar too this:
how-to-write-a-draft with the sluggified name of your file.
A draft is accessible only if someone has its link. This feature is for the authors to preview their posts before they are published and to share with only those whom they want to.
The slug is defined by the name of the file you made. You can preview your changes here, and if needed create new pull requests to change the content of your draft.
Read this guide to get your draft published as a public post!