Blog

The blog section allows you to create and manage your blog posts. It includes features for authoring, publishing, and managing your blog content.

Create your first article

To create a new article, you need to create a new markdown file in the content/blog directory.

You should use the frontmatter on top of the file to define the article metadata.

Warning

The permalink property is required. If you modify it, the URL of the article will change.

---
title: "Article title"
description: "Article description"
permalink: "article-slug"
icon: "👋"
authors:
  - leadcode_dev
thumbnail: path/to/thumbnail.png
publishedAt: 2024-01-01:23:00:00
---

Article visibility

The article will be visible on the blog page if the publishedAt date is defined and is in the future.

Note

You can also remove or comment the publishedAt date to unpublish the article.

In the blog index page, the articles are sorted by publishedAt date and displayed in descending order.

Author

The authors property is an array of author names.

LeadcodeDev

LeadcodeDev

@leadcode_dev

Add new authors

To add a new author, you need to add a new author in the explainer.config.ts file.

export default defineExplainerConfig({
  blog: {
    authors: {
      leadcode_dev: {
        name: 'LeadcodeDev',
        avatar: 'https://avatars.githubusercontent.com/u/8946317?v=4',
        href: 'https://github.com/LeadcodeDev',
      },
      nathaelb: {
        name: 'NathaelB',
        avatar: 'https://avatars.githubusercontent.com/u/64804778?v=4',
        href: 'https://github.com/NathaelB',
      },
    }
  },
})

The authors property is an object where the key is the author name and the value is an object with the following properties:

  • name : The author name.
  • avatar : The author avatar URL.
  • href : The author URL.

You can then tag your user in the frontmatter of your article.

---
authors:
  - leadcode_dev
  - nathaelb 👈
---