ci: build toolchain
This commit is contained in:
parent
7f31153bbc
commit
b4faab9121
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/site
|
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
8
.idea/GitCommitMessageStorage.xml
generated
Normal file
8
.idea/GitCommitMessageStorage.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitCommitMessageStorage">
|
||||||
|
<option name="messageStorage">
|
||||||
|
<MessageStorage />
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
13
.idea/cherry-website.iml
generated
Normal file
13
.idea/cherry-website.iml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/site" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxProjectSettings">
|
||||||
|
<option name="commitMessageIssueKeyValidationOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
<option name="commitMessageValidationEnabledOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/jsLibraryMappings.xml
generated
Normal file
6
.idea/jsLibraryMappings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<includedPredefinedLibrary name="Node.js Core" />
|
||||||
|
</component>
|
||||||
|
</project>
|
25
.idea/jsonSchemas.xml
generated
Normal file
25
.idea/jsonSchemas.xml
generated
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JsonSchemaMappingsProjectConfiguration">
|
||||||
|
<state>
|
||||||
|
<map>
|
||||||
|
<entry key="Mkdocs">
|
||||||
|
<value>
|
||||||
|
<SchemaInfo>
|
||||||
|
<option name="generatedName" value="新架构" />
|
||||||
|
<option name="name" value="Mkdocs" />
|
||||||
|
<option name="relativePathToSchema" value="https://squidfunk.github.io/mkdocs-material/schema.json" />
|
||||||
|
<option name="patterns">
|
||||||
|
<list>
|
||||||
|
<Item>
|
||||||
|
<option name="path" value="mkdocs.yml" />
|
||||||
|
</Item>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</SchemaInfo>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/cherry-website.iml" filepath="$PROJECT_DIR$/.idea/cherry-website.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
3
.idea/scopes/build_source.xml
generated
Normal file
3
.idea/scopes/build_source.xml
generated
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<component name="DependencyValidationManager">
|
||||||
|
<scope name="build-source" pattern="file[cherry-website]:overrides/*||file[cherry-website]:overrides//*||file[cherry-website]:docs//*||file[cherry-website]:src//*||file:mkdocs.yml||file:scripts/build.js||file:scripts/clear.js" />
|
||||||
|
</component>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
25
.idea/watcherTasks.xml
generated
Normal file
25
.idea/watcherTasks.xml
generated
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectTasksOptions">
|
||||||
|
<TaskOptions isEnabled="true">
|
||||||
|
<option name="arguments" value="run build" />
|
||||||
|
<option name="checkSyntaxErrors" value="true" />
|
||||||
|
<option name="description" />
|
||||||
|
<option name="exitCodeBehavior" value="ERROR" />
|
||||||
|
<option name="fileExtension" value="*" />
|
||||||
|
<option name="immediateSync" value="true" />
|
||||||
|
<option name="name" value="dev-server-rebuild" />
|
||||||
|
<option name="output" value="$ContentRoot$/site/" />
|
||||||
|
<option name="outputFilters">
|
||||||
|
<array />
|
||||||
|
</option>
|
||||||
|
<option name="outputFromStdout" value="false" />
|
||||||
|
<option name="program" value="npm" />
|
||||||
|
<option name="runOnExternalChanges" value="true" />
|
||||||
|
<option name="scopeName" value="build-source" />
|
||||||
|
<option name="trackOnlyRoot" value="false" />
|
||||||
|
<option name="workingDir" value="" />
|
||||||
|
<envs />
|
||||||
|
</TaskOptions>
|
||||||
|
</component>
|
||||||
|
</project>
|
BIN
docs/assets/images/logo.png
Normal file
BIN
docs/assets/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
docs/assets/images/title.png
Normal file
BIN
docs/assets/images/title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
29
mkdocs.yml
29
mkdocs.yml
@ -1 +1,28 @@
|
|||||||
site_name: My Docs
|
site_name: 樱落绘境
|
||||||
|
#site_url: https://mydomain.org/mysite
|
||||||
|
site_description: 樱落绘境官网
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: material
|
||||||
|
custom_dir: overrides
|
||||||
|
language: zh
|
||||||
|
logo: assets/images/title.png
|
||||||
|
favicon: assets/images/logo.png
|
||||||
|
palette:
|
||||||
|
- media: "(prefers-color-scheme)"
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-auto
|
||||||
|
name: 切换到日间模式
|
||||||
|
- media: "(prefers-color-scheme: light)"
|
||||||
|
primary: teal
|
||||||
|
accent: teal
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-7
|
||||||
|
name: 切换到深色模式
|
||||||
|
- media: "(prefers-color-scheme: dark)"
|
||||||
|
scheme: slate
|
||||||
|
primary: teal
|
||||||
|
accent: teal
|
||||||
|
toggle:
|
||||||
|
icon: material/brightness-4
|
||||||
|
name: 切换到系统默认
|
||||||
|
1
overrides/main.html
Normal file
1
overrides/main.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
{% extends "base.html" %}
|
1495
package-lock.json
generated
Normal file
1495
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "cherry-website",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "node scripts/build.js",
|
||||||
|
"clear": "node scripts/clear.js"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^22.1.0",
|
||||||
|
"esbuild": "^0.23.0"
|
||||||
|
}
|
||||||
|
}
|
19
scripts/build.js
Normal file
19
scripts/build.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { exec as _exec } from "node:child_process";
|
||||||
|
import * as esbuild from "esbuild";
|
||||||
|
import clear from "./clear.js";
|
||||||
|
|
||||||
|
const exec = command => new Promise((resolve, reject) =>
|
||||||
|
_exec(command, (error, stdout, stderr) =>
|
||||||
|
error ? reject(error) : resolve(stdout + stderr))
|
||||||
|
);
|
||||||
|
|
||||||
|
clear();
|
||||||
|
|
||||||
|
await exec("mkdocs build");
|
||||||
|
await esbuild.build({
|
||||||
|
entryPoints: [ "./src/index.js" ],
|
||||||
|
target: [ "chrome58", "firefox57", "safari11", "edge16" ],
|
||||||
|
bundle: true,
|
||||||
|
minify: true,
|
||||||
|
outfile: 'site/assets/javascripts/main.js',
|
||||||
|
});
|
15
scripts/clear.js
Normal file
15
scripts/clear.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import fs from "node:fs";
|
||||||
|
import paths from "node:path";
|
||||||
|
|
||||||
|
export default function clear() {
|
||||||
|
deletePathForce("./site")
|
||||||
|
}
|
||||||
|
|
||||||
|
function deletePathForce(path) {
|
||||||
|
if (!fs.existsSync(path)) return;
|
||||||
|
if (fs.lstatSync(path).isFile()) return fs.unlinkSync(path);
|
||||||
|
fs.readdirSync(path)
|
||||||
|
.map(name => paths.resolve(path, name))
|
||||||
|
.forEach(deletePathForce);
|
||||||
|
fs.rmdirSync(path);
|
||||||
|
}
|
0
src/index.js
Normal file
0
src/index.js
Normal file
Loading…
x
Reference in New Issue
Block a user