Skip to content

Commit 296320a

Browse files
committed
fix(docs): avoid fouc caused by network
1 parent 0a28adf commit 296320a

File tree

14 files changed

+2653
-228
lines changed

14 files changed

+2653
-228
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Docs
22

33
on:
44
push:
5-
branches: ['main']
5+
branches: ["main"]
66
workflow_dispatch:
77

88
permissions:
@@ -11,11 +11,11 @@ permissions:
1111
id-token: write
1212

1313
concurrency:
14-
group: 'pages'
14+
group: "pages"
1515
cancel-in-progress: false
1616

1717
env:
18-
BUILD_PATH: '.'
18+
BUILD_PATH: "."
1919

2020
jobs:
2121
build:
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup Node
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: '20'
32+
node-version: "20"
3333
- name: Setup Pages
3434
id: pages
3535
uses: actions/configure-pages@v5
@@ -38,12 +38,12 @@ jobs:
3838
working-directory: ${{ env.BUILD_PATH }}
3939
- name: Build
4040
run: |
41-
pnpm build
41+
BASE_URL="/themes/" pnpm build:docs
4242
working-directory: ${{ env.BUILD_PATH }}
4343
- name: Upload artifact
4444
uses: actions/upload-pages-artifact@v3
4545
with:
46-
path: ${{ env.BUILD_PATH }}/docs
46+
path: ${{ env.BUILD_PATH }}/docs/dist
4747

4848
deploy:
4949
environment:

docs/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

docs/index.html

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<script src="https://cdn.twind.style" crossorigin></script>
7-
<link rel="stylesheet" href="styles.css" />
86
</head>
97

10-
<body>
8+
<body class="!block" style="display: none">
119
<header>
1210
<div class="overlay">
1311
<div class="home">
1412
<a href="/">@preachjs/themes</a>
1513
</div>
1614
<nav>
17-
<a href="https://github.com/preachjs/themes/#readme.md" target="_blank"
18-
>docs ↗</a
19-
>
15+
<a
16+
href="https://github.com/preachjs/themes/#readme.md"
17+
target="_blank"
18+
>docs ↗</a>
2019
<a href="https://github.com/preachjs/themes" target="_blank"
21-
>source ↗</a
22-
>
20+
>source ↗</a>
2321
</nav>
2422
</div>
2523
</header>
@@ -31,29 +29,6 @@
3129
<section>
3230
<div id="app"></div>
3331
</section>
34-
<script type="importmap">
35-
{
36-
"imports": {
37-
"@dumbjs/persona": "https://unpkg.com/@dumbjs/[email protected]/dist/index.mjs",
38-
"@preact/signals": "https://ga.jspm.io/npm:@preact/[email protected]/dist/signals.module.js",
39-
"preact": "https://ga.jspm.io/npm:[email protected]/dist/preact.module.js",
40-
"preact/hooks": "https://ga.jspm.io/npm:[email protected]/hooks/dist/hooks.module.js",
41-
"preact/jsx-runtime": "https://ga.jspm.io/npm:[email protected]/jsx-runtime/dist/jsxRuntime.module.js",
42-
"preact/compat": "https://ga.jspm.io/npm:[email protected]/compat/dist/compat.module.js"
43-
},
44-
"scopes": {
45-
"https://ga.jspm.io/": {
46-
"@preact/signals-core": "https://ga.jspm.io/npm:@preact/[email protected]/dist/signals-core.module.js"
47-
}
48-
}
49-
}
50-
</script>
51-
<!-- ES Module Shims import maps polyfills -->
52-
<script
53-
async
54-
src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"
55-
crossorigin="anonymous"
56-
></script>
57-
<script type="module" src="./index.js"></script>
32+
<script type="module" src="./src/index.jsx"></script>
5833
</body>
5934
</html>

docs/index.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"preact": "^10.26.2"
13+
},
14+
"devDependencies": {
15+
"@preact/preset-vite": "^2.10.1",
16+
"@tailwindcss/vite": "^4.0.17",
17+
"tailwindcss": "^4.0.17",
18+
"vite": "^6.2.0"
19+
}
20+
}

0 commit comments

Comments
 (0)