SOP: Creating a New Blog Post in HugoxAI
Purpose
This Standard Operating Procedure (SOP) outlines the steps required to create and publish a new blog post on the HugoxAI website. Following these steps ensures consistency and proper integration of new content.
Scope
This SOP applies to anyone responsible for adding new content to the HugoxAI blog.
Procedure
Step 1: Navigate to the Content Directory
Open your terminal or command prompt and navigate to the content/posts/ directory within your HugoxAI project:
cd content/posts/
Step 2: Create a New Markdown File
Create a new Markdown file for your blog post. The filename should be descriptive and use hyphens instead of spaces (e.g., my-new-blog-post.md).
touch my-new-blog-post.md
Step 3: Add Front Matter
Open the newly created Markdown file in your preferred text editor and add the following front matter at the very top of the file. This metadata is crucial for Hugo to correctly process your post.
---
title: "Your Blog Post Title Here"
date: YYYY-MM-DDTHH:MM:SS-04:00 # Use current date and time, adjust timezone if necessary
draft: true # Set to 'false' when ready to publish
tags: ["tag1", "tag2"] # Optional: Add relevant tags
categories: ["category1"] # Optional: Add relevant categories
---
title: The title of your blog post.date: The publication date and time. Use the formatYYYY-MM-DDTHH:MM:SS-04:00(adjust timezone offset as needed).draft: Set totruewhile you are working on the post. Change tofalsewhen you are ready for it to be visible on the live site.tags: (Optional) A list of keywords or tags relevant to your post.categories: (Optional) A list of categories your post belongs to.
Step 4: Write Your Content
Below the front matter, write the content of your blog post using Markdown syntax. You can use headings, paragraphs, lists, code blocks, images, and links.
## Introduction
This is the introduction to my new blog post.
### Section Title
Here's some content for a section.
* List item 1
* List item 2
```go
package main
import "fmt"
func main() {
fmt.Println("Hello, Hugo!")
}
### Step 5: Preview Your Post (Optional but Recommended)
While working on your post, you can preview it locally by running the Hugo development server. This allows you to see how your post will look before publishing.
```bash
hugo server -D
Open your web browser and navigate to http://localhost:1313/ (or the address provided by Hugo). Your draft post will be visible.
Step 6: Publish Your Post
Once you are satisfied with your post:
- Change
draft: truetodraft: falsein the front matter. - Save the Markdown file.
- Commit your changes to your version control system (e.g., Git) and deploy your site according to your deployment procedure.
By following this SOP, you can efficiently create and manage blog posts on the HugoxAI platform.