Jekyll new article tutorial, master how to write articles and make your words fly!

🚀💡 JekyllThe new article tutorial will help you master writing skills, let your words fly, and become the king of content! Start today and conquer the world with your creativity! 📝✨

Jekyll is a simple, blog-style framework for building static websites.

it uses Markdown and Liquid template language, allowing you to easily create beautiful, dynamic websites.

Jekyll new article tutorial, master how to write articles and make your words fly!

How to create a new article in Jekyll?

Here are the steps on how to use Jekyll to write articles:

1. Create a new article file

In your Jekyll website folder, create a new Markdown file whose name should end with .md end.

Posts folder

This one_postsThe folder is where your blog posts are stored. You use Markdown to create posts, but HTML is also supported.

To create an article post, just start with .md add the ending file to your_postsdirectory, the format is as follows:

YEAR-MONTH-DAY-title.MARKUP

Among them, YEAR is a four-digit number, MONTH and DAY are both two-digit numbers, and MARKUP is a file extension that indicates the format used in the file. For example, the following are examples of valid post filenames:

2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.md
  • All blog post files must begin with a preamble that sets the layout or other metadata.

2. Add article content

Add your article content using Markdown syntax.

You can use Markdown to format text, add images, create lists, and more...

3. Add article metadata

At the top of the article, add the YAML prefix.

The prefix contains information about your article, such as title, author, and date.

Here is a sample article:

---
layout: post
title: 我的第一篇文章
author: 陈沩亮
date: 2024-4-12
---

# 这是一些文本

## 这是一个标题

![这是一个图像](https://www.example.com/image.jpg)

* 这是一个列表项
* 这是另一个列表项

这是一个链接:[https://www.example.com/](https://www.example.com/)
  • Please use the code with caution.

4. Preview your article

使用 jekyll serve command to start the Jekyll server.

访问 http://localhost:4000/your-article.md to view your article.

5. Structure your article

使用 jekyll build command to build your website.

The constructed article will be located at _site/your-article.html in the file.

Click the link below to learn how to use Jekyll to automatically generate articles, making updating your blog a breeze ▼

No articles found

How to remove the date in Jekyll post URL path?

To remove the date from your Jekyll article URLs, you can modify your Jekyll configuration or use a custom permalink structure.

This can be achieved by modifying the Jekyll configuration.

turn up _config.yml File: This file contains Jekyll's configuration settings and is typically located in the root directory of your Jekyll site.

edit permalink Setting: In _config.yml Found in the file permalink set up.

  • It usually looks like this:
permalink: /:year/:month/:day/:title
  • After Jekyll is installed, there may be no default permalink Settings need to be added by yourself.

Remove the date component: Modify permalink Set to remove the date component (/year/:month/:day).

  • For example, to create a permalink containing only the article title, use:
permalink: /posts/:title:output_ext

Save and regenerate: Save _config.yml document,

Regenerate your Jekyll site: Usejekyll build Or jekyll serve.

Comment

Your email address will not be published. Required fields * Callout

Scroll to Top