Every post at Genics Blog starts as a draft. In this section you’ll learn how to create a draft post.
- Get a contributor 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 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
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." image: "https://cdn.hashnode.com/res/hashnode/image/upload/v1631596605889/xCcnwfFVk.png" languages: ["kotlin", "xml"] category: content-writing tags: ["writing-skills", "tips"] author: gouravkhunger ---
Omit any of the variables if you don’t want to use them!
layoutdefines what kind of page it will be (here, a
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.
languagesis a list of programming languages that this post contains snippets of. If your post doens’t require snippets, simply remove this variable. Only add the lowerrcase names of the programming language to this array.
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
Check out 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 your draft won’t be automatically published.
Repeated attempts to bypass/hack the check 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. To do so, commit your finalised changes and make a Pull Request to immediately publish the draft article to the blog. The draft will be published to a private page that is not indexed by search engines.
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.
Once your PR is successfully merged, the draft will appear to a link similar too this:
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 publish your changes.
Read this guide to get your draft published as a public post!