How to Create a Post

Prerequisites

  • You have a GitHub account
  • Git installed on your local machine
  • Node.js - 14.18.0, v16.12.0, or higher.
  • Text editor - We recommend VS Code with the Official Astro extension.
  • Terminal - Astro is accessed through its command-line interface (CLI).

Clone Repo

  • Fork repo from FOSBlog Repo
  • Open Terminal
  • Run git clone <your-forked-repo>
  • Install dependencies with yarn install
  • Start running yarn dev

Writing Post

Thumbnail

It would be better if your post has a thumbnail. We would like to recommend you using Cloudinary for serving image with fast CDN.

Title & Filename

You can use any format for the title, but for filename you must follow rules:

  • lowercase
  • kebab case
  • no special character

you can use this script if you need help generating filename based on your post title

function generateFilename(title) {
  return string
    .toString()
    .trim()
    .toLowerCase()
    .replace(/\s+/g, '-')
    .replace(/[^\w\-]+/g, '')
    .replace(/\-\-+/g, '-')
    .replace(/^-+/, '')
    .replace(/-+$/, '');
}

generateFilename("<your-title-here>");

Author & GitHub

Author will be displayed as your name in the post, and you need pass your GitHub username. We will automatically generate link to your GitHub profile.

Date

Please ensure that you pass the date same as date when you create Pull Request with format MMM DD, YYYY

Tags

You only allowed to put 4 tags and separated by comma (,)

Example

---
layout: "@layouts/Article.astro"
title: "What is FOSBlog ?"
thumbnail: "https://res.cloudinary.com/practicaldev/image/fetch/s--LkjaosP3--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr81jbcgdqaok7143ny3.jpg"
author: "Rully Ardiansyah"
github: "devoresyah"
date: "Aug 23, 2022"
tags: "javascript,framework,blog,cms"
---

Publishing your Post

  • Push your commit into your forked repo
  • Open new Pull Request on FOSBlog Repo