Skip to content

tuyuritio/astro-theme-thought-lite

Repository files navigation

ThoughtLite

A modern Astro theme optimized for Cloudflare, focused on content creation 🌟

English 简体中文 日本語

✨ Features

📱 Responsive Design - Adaptive for mobile, tablet, and desktop.
🌗 Light / Dark Mode - Auto-follows system preference with manual toggle support.
📃 SSR Dynamic Content Filtering - List filtering and pagination via History API.
🌏 i18n Support - Easy to extend and manage multilingual content.
📰 Sitemap & Feed Subscription - Automated generation of Sitemap and RSS, Atom, JSON Feed.
🔗 OpenGraph Support - Built-in Open Graph meta tags for optimized social media sharing.
📝 Comment System - Based on Cloudflare D1, easy deployment with privacy control; supports OAuth authentication and guest comments.
🔔 Desktop Notifications - Real-time notifications using Web Push API.

📋 Prerequisites

Before you begin, make sure you have the following accounts:

📦 Installation

git clone https://github.com/tuyuritio/astro-theme-thought-lite.git
cd astro-theme-thought-lite
git remote rename origin theme
git remote add origin <your-git-repo>
npm install

🔧 Configuration

  1. Create Cloudflare D1, refer to Cloudflare D1 Configuration Guide.

  2. Configure Cloudflare Turnstile, refer to Turnstile Configuration Guide.

  3. Configure OAuth authentication, refer to OAuth Configuration Guide.

  4. Basic site information configuration, refer to Site Configuration Guide.

  5. Create .env file and add variables:

    cp .env.example .env
    Variable Description
    PUBLIC_TIMEZONE* Default display timezone, refer to Timezone List
    PASS_KEY* Used for generating tokens, 16-byte Base64 format key, generate with openssl rand -base64 16
    NOTIFY_PUBLIC_KEY* VAPID public key for desktop push notifications, generate with npx web-push generate-vapid-keys
    NOTIFY_PRIVATE_KEY* VAPID private key for desktop push notifications, generated along with public key
    AUTHOR_ID Author ID for identifying site author in comment section; check in Cloudflare D1 Panel

    * indicates required options.

💻 Start Development

# Generate local test database
npm run db:migrate:local

# Start development server
npm run dev

🚀 Deployment

npm run build
npm run deploy

For automated deployment using GitHub Actions, refer to GitHub Actions Configuration Guide.

🔄 Updates

git checkout main
git pull origin main
git fetch theme
git merge theme/main
npm i
npm run db:migrate:local

✍️ Content Creation

Content creation is centralized in the src/content directory, mainly including:

  • note - Notes
  • jotting - Jottings
  • preface - Preface
  • information - Information

All sections support multiple languages. Please create language subdirectories under the corresponding section directory before writing content. For details, refer to Content Creation Guide.

🙏 Acknowledgments

Tech Stack

Inspiration

📜 License

This project is licensed under GPLv3.

About

A modern Astro theme optimized for Cloudflare, focused on content creation.

Resources

License

Stars

Watchers

Forks