npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

astro-theme-starread

v1.11.3

Published

既有星光般的璀璨,又不失简洁和高端感的Astro主题

Readme

Star Read - Astro Blog Theme

A brilliant yet clean and sophisticated Astro theme with star-like quality

🚀 Features

  • 🎨 modern UI design
  • 🔍 automatically creates local indexes, supporting both local offline search and Algolia network search
  • 📱 responsive design, compatible with mobile phones and PCS
  • 🌙 dark/light themes switch automatically
  • 🏷️ tag and category support
  • 📊 article statistics and author information display

📂 Project Structure

/
├── src/
│   ├── components/     # Component files
│   ├── content/        # Content configuration
│   ├── layouts/        # Layout templates
│   ├── pages/          # Page routes
│   └── styles/         # Style files
├── public/             # Static assets
└── dist/               # Build output

📦 Installation

Method 1: Initialize via CLI Tool

| Package Manager | Recommended Command | |----------------|-------------------------------------------| | pnpm / pnpx | pnpm dlx astro-theme-starread init or pnpx astro-theme-starread init | | npm (npx) | npx astro-theme-starread init | | Yarn | yarn dlx astro-theme-starread init (Requires Yarn v2+) |

[!note] We provide a create command to facilitate creating a theme in a specified folder

  1. Create Project: Depending on your package manager, choose one of the following commands:
# Using pnpm
pnpm create astro-theme-starread my-blog

# Using npm
npx create-astro-theme-starread my-blog

# Using yarn
yarn create astro-theme-starread my-blog

# Using cnpm
cnpm init astro-theme-starread my-blog
  1. Enter Project Directory:
cd my-blog
  1. Install Dependencies:
pnpm install
  1. Start Development Server:
pnpm dev

Method 2: Install using astro template

[!warning] This method requires accessing the GitHub repository, ensure network connectivity.

| Package Manager | Command | |----------------|---------------------------------------------| | pnpm | pnpm create astro@latest --template passwordgloo/astro-theme-starread | | npm | npm create astro@latest -- --template passwordgloo/astro-theme-starread | | yarn | yarn create astro --template passwordgloo/astro-theme-starread |

Method 3: Install from Source

[!warning] This method requires accessing the GitHub repository, ensure network connectivity.

git clone https://github.com/passwordgloo/astro-theme-starread
cd astro-theme-starread
pnpm install

[!note] After installation, run the development server:

pnpm dev

Method 4: As a dependency in existing Astro project

You can install the theme as a dependency in your existing Astro project and use its components, layouts, and pages directly from node_modules. This is the recommended way to use the theme in Astro 5 projects.

  1. Install the theme package:
# Using pnpm
pnpm add astro-theme-starread

# Using npm
npm install astro-theme-starread

# Using yarn
yarn add astro-theme-starread

Direct access to theme components and layouts in node_modules:

After installation, you can directly import and use components and layouts from the theme package in your Astro files. The components and layouts are accessible through the package's main entry point, making it easy to integrate them into your project.

  1. Import and use components directly from node_modules:
---
// Import components directly from the theme in node_modules
import { NavBar, ThemeToggle, ArticleInfo, AuthorWidget, TagCloud } from 'astro-theme-starread';
---

<html>
  <head>
    <title>My Astro Blog</title>
    <!-- Import theme styles if needed -->
    <link rel="stylesheet" href="node_modules/astro-theme-starread/src/styles/global.css" />
  </head>
  <body>
    <!-- Use the NavBar component from node_modules -->
    <NavBar />
    
    <!-- Use the ThemeToggle component from node_modules -->
    <ThemeToggle />
    
    <article>
      <!-- Use the ArticleInfo component with props -->
      <ArticleInfo 
        title="My Article"
        date="2024-01-01"
        author="Author Name"
      />
      <p>Article content here...</p>
    </article>
    
    <aside>
      <!-- Use sidebar components -->
      <AuthorWidget />
      <TagCloud />
    </aside>
  </body>
</html>
  1. Use layouts directly from node_modules:
---
// Import layout directly from the theme in node_modules
import { article as ArticleLayout } from 'astro-theme-starread';

// Apply the layout from node_modules
export const layout = ArticleLayout;

// Your content
export const content = {
  title: "My Blog Post",
  date: "2024-01-01",
  author: "Author Name",
  tags: ["tech", "blogging"]
};
---

<!-- This content will be rendered inside the layout from node_modules -->
<main>
  <p>This is the content of my blog post. It will be rendered inside the article layout from the theme.</p>
</main>

🧞 Commands

| Command | Description | | :----------------------- | :--------------------------------------------- | | pnpm install | Install dependencies | | pnpm dev | Start local development server localhost:4321 | | pnpm preview | Preview build results locally | | pnpm algolia | Push data to Algolia search | | pnpm release | Version management (update version number, generate commits, etc.) |

🔍 Search

Local Search

Local search is used by default. For first-time use, run pnpm local to build local index

Algolia Search

[!important] It is recommended to use environment variables for configuration in production to avoid exposing sensitive information in code.

  1. Edit starread.config.ts to select Algolia search
export const themeConfig: starreadthemeconfig = {
  search: {
    // Search provider: 'local', 'algolia'
      provider: 'algolia',
    }
}
  1. Create and edit .env file in root directory

[!note] Algolia search requires your Algolia Application ID, Search Key, Index Name, and Admin API Key.

[!tip] If you don't have an Algolia account, you need to register and create an application first.

PUBLIC_ALGOLIA_APP_ID=Your Algolia Application ID
PUBLIC_ALGOLIA_SEARCH_KEY=Your Algolia Search Key
PUBLIC_ALGOLIA_INDEX_NAME=Your Index Name
ALGOLIA_WRITE_API_KEY=Your Write API Key (for index upload)
  1. Push Index to Algolia

By default, local search is used, which is suitable for offline use on the local end and does not require user configuration.

⚙️ Custom Configuration

You can customize theme configuration by modifying the starread.config.ts file in the root directory, including website title, navigation menu, author information, sidebar component display, etc.

Example configuration items:

// Modify website title
site: {
  title: 'My Blog',
  // ...other configurations
}

// Custom navigation menu
nav: [
  { name: 'Home', href: '/' },
  { name: 'About', href: '/about' },
  // ...other menu items
]

🔧 Twikoo Comment Configuration

To enable Twikoo comment system, please modify the envId value on line 13 of src/components/Comment.astro file to your Twikoo environment address.

<script>
  document.addEventListener('DOMContentLoaded', function() {
    if (window.twikoo) {
      window.twikoo.init({
        envId: 'https://example.com',// Your environment address
        el: '#tcomment',
        path: window.location.pathname
      });
    } else {
      console.error('Twikoo failed to load, please check the local Twikoo location or CDN address');
    }
  });
</script>