Appearance
How to Add a New Blog Post
This document provides instructions on how to add a new blog post to the TechLink Hub website.
Prerequisites
- You have a local copy of the website's source code.
- You have Node.js installed.
Instructions
Create a New Markdown File:
- Navigate to the
blog
directory. - Create a new Markdown file (e.g.,
my-new-post.md
). The filename should be a URL-friendly "slug" of the post's title (e.g.,the-art-of-prompt-engineering.md
).
- Navigate to the
Add Frontmatter to the File:
- Open the new Markdown file and add the following frontmatter at the top:
yaml--- title: "The Title of the Blog Post" date: "YYYY-MM-DD" description: "A brief description of the blog post." image: "/path/to/your/image.webp" --- Your blog post content goes here.
title
: The title of the blog post.date
: The date the blog post was published, inYYYY-MM-DD
format.description
: A short, one-sentence description of the blog post's content.image
(optional): The path to the blog post's banner image.
Update the Data File:
- Open a terminal in the root directory of the project.
- Run the following command to update the website's data file:
bashnode generate_data.mjs
Verify the Changes:
- Start the local development server and open your browser to the blog page to verify that the new blog post is displayed correctly.