Skip to content

Commit fc0b8f5

Browse files
author
wangmengli
committed
first commit
0 parents  commit fc0b8f5

125 files changed

Lines changed: 15829 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
.vscode/

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore artifacts:
2+
build
3+
coverage
4+
5+
/node_modules/*
6+
/public/*

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": false,
3+
"bracketSameLine": true,
4+
"tabWidth": 4,
5+
"singleAttributePerLine": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5"
8+
}

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
10+
11+
## 🚀 Project Structure
12+
13+
Inside of your Astro + Starlight project, you'll see the following folders and files:
14+
15+
```
16+
.
17+
├── public/
18+
├── src/
19+
│ ├── assets/
20+
│ ├── content/
21+
│ │ └── docs/
22+
│ └── content.config.ts
23+
├── astro.config.mjs
24+
├── package.json
25+
└── tsconfig.json
26+
```
27+
28+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
29+
30+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
31+
32+
Static assets, like favicons, can be placed in the `public/` directory.
33+
34+
## 🧞 Commands
35+
36+
All commands are run from the root of the project, from a terminal:
37+
38+
| Command | Action |
39+
| :------------------------ | :----------------------------------------------- |
40+
| `npm install` | Installs dependencies |
41+
| `npm run dev` | Starts local dev server at `localhost:4321` |
42+
| `npm run build` | Build your production site to `./dist/` |
43+
| `npm run preview` | Preview your build locally, before deploying |
44+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
45+
| `npm run astro -- --help` | Get help using the Astro CLI |
46+
47+
## 👀 Want to learn more?
48+
49+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

astro.config.mjs

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config'
3+
import starlight from '@astrojs/starlight'
4+
import starlightImageZoom from 'starlight-image-zoom'
5+
6+
const locales = {
7+
root: {
8+
label: 'English',
9+
lang: 'en', // lang 是 root 语言必须的
10+
},
11+
'zh-cn': {
12+
label: '简体中文',
13+
lang: 'zh-CN',
14+
},
15+
}
16+
17+
// https://astro.build/config
18+
export default defineConfig({
19+
integrations: [
20+
starlight({
21+
plugins: [starlightImageZoom()],
22+
title: 'CafeScraper',
23+
logo: {
24+
src: './src/assets/logo.png',
25+
},
26+
defaultLocale: 'root',
27+
locales,
28+
components: {
29+
Header: './src/components/Header.astro',
30+
MobileMenuFooter: './src/components/MobileMenuFooter.astro',
31+
TableOfContents: './src/components/TableOfContents.astro',
32+
},
33+
customCss: [
34+
'./src/styles/common.css',
35+
'@fontsource-variable/ibm-plex-sans/index.css',
36+
],
37+
favicon: '/favicon.jpg',
38+
sidebar: [
39+
{
40+
label: 'About CafeScraper',
41+
slug: 'about-cafe-scraper',
42+
translations: {
43+
'zh-CN': '关于 CafeScraper',
44+
},
45+
},
46+
{
47+
label: 'User Guide',
48+
collapsed: true,
49+
translations: {
50+
'zh-CN': '用户指南',
51+
},
52+
autogenerate: { directory: 'user-guide' },
53+
},
54+
{
55+
label: 'Developer Guide',
56+
collapsed: true,
57+
translations: {
58+
'zh-CN': '开发者指南',
59+
},
60+
items: [
61+
{
62+
label: 'Web Unlocker',
63+
translations: {
64+
'zh-CN': '网页解锁器',
65+
},
66+
autogenerate: {
67+
directory: 'developer-guide/web-unlocker',
68+
},
69+
},
70+
{
71+
label: 'Script',
72+
translations: {
73+
'zh-CN': '脚本',
74+
},
75+
autogenerate: {
76+
directory: 'developer-guide/script',
77+
},
78+
},
79+
{
80+
label: 'Framework',
81+
translations: {
82+
'zh-CN': '数据采集框架',
83+
},
84+
autogenerate: {
85+
directory: 'developer-guide/framework',
86+
},
87+
},
88+
],
89+
},
90+
{
91+
label: 'API',
92+
translations: {
93+
'zh-CN': 'API',
94+
},
95+
collapsed: true,
96+
autogenerate: {
97+
directory: 'api',
98+
},
99+
},
100+
{
101+
label: 'Partnership & Promotion',
102+
collapsed: true,
103+
translations: {
104+
'zh-CN': '推广合作',
105+
},
106+
autogenerate: { directory: 'partnership-promotion' },
107+
},
108+
{
109+
label: 'Platform Policies',
110+
collapsed: true,
111+
translations: {
112+
'zh-CN': '平台政策',
113+
},
114+
autogenerate: {
115+
directory: 'platform-policies',
116+
},
117+
},
118+
{
119+
label: 'FAQ',
120+
collapsed: true,
121+
translations: {
122+
'zh-CN': '常见问题',
123+
},
124+
items: [
125+
{
126+
label: 'Payment Problem',
127+
translations: {
128+
'zh-CN': '支付问题',
129+
},
130+
autogenerate: {
131+
directory: 'faq/payment-problem',
132+
},
133+
},
134+
],
135+
},
136+
{
137+
label: 'Changelog',
138+
slug: 'changelog',
139+
translations: {
140+
'zh-CN': '更新日志',
141+
},
142+
},
143+
],
144+
}),
145+
],
146+
147+
vite: {
148+
build: {
149+
rollupOptions: {
150+
output: {
151+
hashCharacters: 'hex',
152+
entryFileNames: 'js/[hash].js',
153+
chunkFileNames: 'js/chunks/[hash].js',
154+
assetFileNames: 'static/css/[hash][extname]',
155+
},
156+
},
157+
},
158+
},
159+
build: {
160+
assets: 'static',
161+
},
162+
})

eslint.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import pluginVue from 'eslint-plugin-vue'
4+
import { defineConfig } from 'eslint/config'
5+
6+
export default defineConfig([
7+
{
8+
files: ['**/*.{js,mjs,cjs,vue}'],
9+
plugins: { js },
10+
extends: ['js/recommended'],
11+
languageOptions: { globals: globals.browser },
12+
},
13+
pluginVue.configs['flat/essential'],
14+
])

0 commit comments

Comments
 (0)