10000 GitHub - djyde/blog-2025: My personal blog
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

djyde/blog-2025

 
 

Repository files navigation

Slate blog

English · 中文

✨ Features

  • Minimalist style theme, adaptable to multiple platforms
  • Zero-based quick start, foolproof configuration, easy deployment
  • Support for article drafts, local preview, and automatic draft filtering in production builds
  • Default RSS generation with Follow subscription authentication
  • Integrated Algolia search
  • Complete SEO optimization to improve search engine rankings

🪜 Framework

  • Astro + React + Typescript
  • Tailwindcss + @radix-ui/colors
  • Docsearch

🔨 Usage

# Start local server
npm run dev
# or
yarn dev
# or
pnpm dev

# Build
npm run build
# or
yarn build
# or
pnpm build

🗂 Directory Structure

- plugins/            # Custom plugins
- src/
  ├── assets/         # Asset files
  ├── components/     # Components
  ├── content/        # Content collections
  ├── helpers/        # Business logic
  ├── pages/          # Pages
  └── typings/        # Common types

Articles are stored in the src/content/post directory, supporting markdown and mdx formats. The filename is the path name. For example, src/content/post/my-first-post.md => https://your-blog.com/blog/my-first-post.

Configuration

Theme configuration is done through slate.config.ts in the root directory.

Option Description Type Default
site Final deployment link string -
title Website title string -
description Website description string -
lang Language string zh-CN
avatar Avatar string -
sitemap Website sitemap configuration SitemapOptions -
readTime Show reading time boolean false
lastModified Show last modified time boolean false
algolia Docsearch configuration { appId: string, apiKey: string, indexName: string } -
follow Follow subscription authentication configuration { feedId: string, userId: string } -
footer Website footer configuration { copyright: string } -

Algolia Application

  1. Deploy your site first
  2. Apply for an apiKey at algolia
  3. After successful application, configure algolia in slate.config.ts
  4. Redeploy

Follow Subscription Authentication

  1. Register a follow account
  2. Deploy your site
  3. Click the + button on follow, select RSS subscription, and enter the rss link (usually [site]/rss.xml, where site is the value of site in slate.config.ts)
  4. Redeploy

Article Frontmatter Description

Option Description Type Required
title Article title string Yes
description Article description string No
tags Article tags string[] No
draft Whether it's a draft. When not provided or false, pubDate must be provided; drafts are only visible in local preview boolean No
pubDate Article publication date date No, required when draft is false

For more details, check the src/content/config.ts file

Example

---
title: 40 questions
description: This repo maintains revisons and translations to the list of 40 questions I ask myself each year and each decade.
tags:
  - Life
  - Thinking
  - Writing
pubDate: 2025-01-06
---

Releases

No releases published

Packages

No packages published

Languages

  • XSLT 70.9%
  • TypeScript 11.5%
  • Astro 10.3%
  • JavaScript 4.3%
  • SCSS 3.0%
0