如何创建博客文章

简单方法:直接在对应文件夹创建 qmd 文件

1. 选择专题目录

根据文章内容,在对应的专题目录下创建文章:

  • 生活与个人posts/life/your-post-name/index.qmd
  • 电子产品与软件posts/electronics/your-post-name/index.qmd
  • 实验笔记posts/research/experiments/your-post-name/index.qmd
  • 文献阅读posts/research/papers/your-post-name/index.qmd
  • 生物信息学posts/research/bioinformatics/your-post-name/index.qmd
  • 研究观点posts/research/opinions/your-post-name/index.qmd

2. 创建文章

# 例如:在 bioinformatics 下创建新文章
mkdir -p posts/research/bioinformatics/my-analysis
# 然后创建 index.qmd 文件

3. 文章模板

index.qmd 文件中使用以下模板:

对于 posts/life/posts/electronics/ 下的文章(一级分类):

---
title: "文章标题"
description: "文章简短描述"
author: "Shi Qianchuan"
date: 2025-01-21
categories:
  - Life          # 或 Electronics
draft: false
scroll-progress: true
---

```{=html}
<div class="post-navigation">
  <div class="post-nav-buttons">
    <a href="../index.html" class="post-nav-btn post-nav-btn-secondary">
      <span class="post-nav-icon">📁</span>
      <span>Life & Personal</span>
    </a>
  </div>
</div>

引言

文章内容…


**对于 `posts/research/*/` 下的文章(二级分类):**

```yaml
---
title: "文章标题"
description: "文章简短描述"
author: "Shi Qianchuan"
date: 2025-01-21
categories:
  - Research
  - Bioinformatics    # 或 Experimental Notes, Paper Reading, Research Opinions
draft: false
scroll-progress: true
---

```{=html}
<div class="post-navigation">
  <div class="post-nav-buttons">
    <a href="../index.html" class="post-nav-btn post-nav-btn-secondary">
      <span class="post-nav-icon">📁</span>
      <span>Bioinformatics</span>
    </a>
  </div>
</div>

引言

文章内容…


### 4. 重要字段说明

- **title**: 文章标题(必需)
- **date**: 发布日期,格式 `YYYY-MM-DD`(必需)
- **draft**: `false` 表示发布,`true` 表示草稿(必需)
- **categories**: 分类标签,第一个是主分类,后续是标签(推荐)

### 5. 渲染和预览

```bash
# 渲染整个网站
quarto render

# 预览网站
quarto preview

文章会自动显示在:

  1. Blog 页面 - 点击对应分类板块进入
  2. 主页 - 最新5篇文章(无过滤时)
  3. 主页标签过滤 - 通过 categories 中的标签过滤
  4. 主页搜索 - 搜索标题和描述

示例

创建生物信息学文章

mkdir -p posts/research/bioinformatics/dna-analysis

创建 posts/research/bioinformatics/dna-analysis/index.qmd:

---
title: "DNA Methylation Analysis Workflow"
description: "My workflow for analyzing DNA methylation data"
author: "Shi Qianchuan"
date: 2025-01-21
categories:
  - Research
  - Bioinformatics
draft: false
---

## Introduction

This post describes my workflow...

就这么简单!不需要运行任何脚本。

Visitors