Skip to content

Commit 29bc1d2

Browse files
committed
init commit
0 parents  commit 29bc1d2

File tree

178 files changed

+1021365
-0
lines changed

Some content is hidden

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

178 files changed

+1021365
-0
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
npm-debug.log
5+
README.md
6+
.next
7+
.git

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; https://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# build output
2+
dist/
3+
.output/
4+
.json/
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+
yarn.lock
15+
package-lock.json
16+
17+
18+
# environment variables
19+
.env
20+
.env.production
21+
22+
# macOS-specific files
23+
.DS_Store
24+
25+
# ignore .astro directory
26+
.astro
27+
28+
.idea
29+
30+
# ignore vercel/netlify adapter
31+
.vercel
32+
.netlify

.markdownlint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD033": false,
3+
"MD013": false
4+
}

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/pages/works/[id].astro

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": ["prettier-plugin-astro"],
3+
"overrides": [
4+
{
5+
"files": ["*.astro"],
6+
"options": {
7+
"parser": "astro"
8+
}
9+
}
10+
]
11+
}

Dockerfile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ARG INSTALLER=npm
2+
3+
FROM node:20-alpine AS base
4+
5+
# Install dependencies only when needed
6+
FROM base AS deps
7+
ARG INSTALLER
8+
9+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
10+
RUN apk add --no-cache libc6-compat
11+
WORKDIR /app
12+
13+
# Install dependencies based on the preferred package manager
14+
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
15+
RUN \
16+
if [ "${INSTALLER}" == "yarn" ]; then yarn --frozen-lockfile; \
17+
elif [ "${INSTALLER}" == "npm" ]; then npm ci; \
18+
elif [ "${INSTALLER}" == "pnpm" ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
19+
else echo "Valid installer not set." && exit 1; \
20+
fi
21+
22+
23+
# Rebuild the source code only when needed
24+
FROM base AS builder
25+
WORKDIR /app
26+
COPY --from=deps /app/node_modules ./node_modules
27+
COPY . .
28+
29+
# RUN chmod u+x ./installer && ./installer
30+
ARG INSTALLER
31+
RUN \
32+
if [ "${INSTALLER}" == "yarn" ]; then yarn build; \
33+
elif [ "${INSTALLER}" == "npm" ]; then npm run build; \
34+
elif [ "${INSTALLER}" == "pnpm" ]; then pnpm run build; \
35+
else echo "Valid installer not set." && exit 1; \
36+
fi
37+
38+
# Production image, copy all the files and run nginx
39+
FROM nginx:alpine AS runner
40+
COPY ./config/nginx/nginx.conf /etc/nginx/nginx.conf
41+
COPY --from=builder /app/dist /usr/share/nginx/html
42+
43+
WORKDIR /usr/share/nginx/html

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 - Present, Zeon Studio
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<h1 align=center>海棠诗社</h1>
2+
3+
<p align=center>海棠诗社,古诗词的数字桃源</p>
4+
5+
<p align=center>如果觉得这个项目不错的话,可以点个⭐,非常感谢 </p>
6+
7+
## 📌 Key Features
8+
9+
- 🎯 按诗集、朝代、诗人、诗词等方式检索,内容丰富,信息齐全
10+
- 📝 按选集、主题、节日、节气、词牌、时令、地理等方式精选分类
11+
- 🔍 海棠诗社全站响应式布局,兼容移动端,支持暗黑模式,响应速度快
12+
- 👤 海棠诗社支持添加自己喜欢的诗词到个人诗单,永久收藏世间的美好
13+
14+
### 📄 Tech Stacks
15+
16+
- 🖥️ Frontend: @astrodotbuild + @tailwindcss + @shadcn
17+
- 👤 Authentication: @supabase auth
18+
- 📫 Email: @resend
19+
- 📊 Analytics: google analytics + umami
20+
- 🌏 Domain: @Namecheap
21+
- 🗂️ Database: @supabase + @DrizzleORM
22+
23+
## 🔗 Integrations
24+
25+
- astro/react
26+
- astro/sitemap
27+
- astro/tailwind
28+
- astro/vercel
29+
30+
## 🚀 Getting Started
31+
32+
### 📦 Dependencies
33+
34+
- astro 4.0+
35+
- node v20.10+
36+
- npm v10.2+
37+
- tailwind v3.3+
38+
39+
### 👉 Install Dependencies
40+
41+
```bash
42+
npm install
43+
```
44+
45+
### 👉 Development Command
46+
47+
```bash
48+
npm run dev
49+
```
50+
51+
### 👉 Build Command
52+
53+
```bash
54+
npm run build
55+
```
56+
57+
### 👉 Build and Run With Docker
58+
59+
```bash
60+
docker build -t haitang .
61+
# or
62+
# docker --build-arg INSTALLER=npm build -t haitang .
63+
# or
64+
# docker --build-arg INSTALLER=pnpm build -t haitang .
65+
66+
docker run -p 3000:80 haitang
67+
# or
68+
# docker run --rm -p 3000:80 haitang
69+
```
70+
71+
<!-- licence -->
72+
## 📝 License
73+
74+
Copyright (c) 2023 - Present, Designed & Developed by [javayhu](https://javayhu.site)
75+
76+
**Code License:** Released under the [MIT](LICENSE) license.

astro.config.mjs

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import mdx from "@astrojs/mdx";
2+
import react from "@astrojs/react";
3+
import sitemap from "@astrojs/sitemap";
4+
import tailwind from "@astrojs/tailwind";
5+
import AutoImport from "astro-auto-import";
6+
import { defineConfig, squooshImageService } from "astro/config";
7+
import remarkCollapse from "remark-collapse";
8+
import remarkToc from "remark-toc";
9+
import config from "./src/config/config.json";
10+
import icon from "astro-icon";
11+
import partytown from "@astrojs/partytown";
12+
13+
import vercel from "@astrojs/vercel/serverless";
14+
15+
// https://astro.build/config
16+
export default defineConfig({
17+
output: 'server',
18+
adapter: vercel(),
19+
site: config.site.base_url,
20+
base: config.site.base_path ? config.site.base_path : "/",
21+
trailingSlash: config.site.trailing_slash ? "always" : "never",
22+
image: {
23+
service: squooshImageService()
24+
},
25+
integrations: [react(), sitemap(), tailwind({
26+
config: {
27+
applyBaseStyles: false
28+
}
29+
}), AutoImport({
30+
imports: []
31+
}), mdx(), icon({
32+
include: {
33+
tabler: ['*']
34+
}
35+
}), partytown({
36+
config: {
37+
debug: true,
38+
forward: ['dataLayer.push']
39+
}
40+
})
41+
// solidJs()
42+
],
43+
markdown: {
44+
remarkPlugins: [remarkToc, [remarkCollapse, {
45+
test: "Table of contents"
46+
}]],
47+
shikiConfig: {
48+
theme: "one-dark-pro",
49+
wrap: true
50+
},
51+
extendDefaultPlugins: true
52+
}
53+
});

components.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/styles/main.scss",
9+
"baseColor": "gray",
10+
"cssVariables": false,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

config/nginx/nginx.conf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 80;
10+
server_name _;
11+
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
include /etc/nginx/mime.types;
15+
16+
gzip on;
17+
gzip_min_length 1000;
18+
gzip_proxied expired no-cache no-store private auth;
19+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
20+
21+
error_page 404 /404.html;
22+
location = /404.html {
23+
root /usr/share/nginx/html;
24+
internal;
25+
}
26+
27+
location / {
28+
try_files $uri ${uri}.html $uri/index.html =404;
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)