Skip to content

Commit

Permalink
🐳 chore: publish
Browse files Browse the repository at this point in the history
  • Loading branch information
白云苍狗 committed Oct 25, 2023
1 parent 3bd47b4 commit 52a6b8b
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
cp ./README_zh-CN.md ./packages/vitepress-theme-async
cp ./README.md ./packages/vitepress-theme-async
node ./scripts/publish
node ./scripts/publish.mjs
zip -r vitepress-theme-async ./packages/vitepress-theme-async
env:
RELEASE_VERSION: ${{ github.ref }}
Expand Down
2 changes: 2 additions & 0 deletions demo/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import taskLists from 'markdown-it-task-lists';

export default defineConfig({
cleanUrls: true,
base: 'demosite',
outDir: '../dist/demosite',
vite: {
css: {
preprocessorOptions: {
Expand Down
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hexo-theme-async-docs",
"name": "vitepress-theme-async-demo",
"version": "0.0.0",
"private": true,
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vitepress';

export default defineConfig({
outDir: '../dist',
lang: 'zh-CN',
title: 'Vitepress-Theme-Async',
description: '🎈 A simple, lightweight vitepress blog theme',
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

::: danger 提醒

本插件为 blog 主题,不一定适合当作文档主题使用。主题为 vitepress-Theme-Async 的移植版本,功能配置上会有一定的差异,合理选择您想要版本。
本插件为 blog 主题,不一定适合当作文档主题使用。主题为 Hexo-Theme-Async 的移植版本,功能配置上会有一定的差异,合理选择您想要版本。

- 配置问题

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hexo-theme-async-docs",
"name": "vitepress-theme-async-docs",
"version": "0.0.0",
"private": true,
"type": "module",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/vitepress-theme-async/components/TrmFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ onMounted(() => {
<div v-if="theme?.footer?.powered?.enable" class="trm-footer-item">
<span>
<a href="https://hexo.io" target="_blank" rel="noopener">Vitepress</a>
<a href="https://vitepress.dev" target="_blank" rel="noopener">Vitepress</a>
驱动
</span>
<span class="footer-separator" data-separator=" | "></span>
Expand Down
14 changes: 14 additions & 0 deletions scripts/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"node": true,
"es2021": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["prettier"],
"rules": {},
"globals": {}
}
11 changes: 11 additions & 0 deletions scripts/publish.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { writeFileSync } from "fs";
import { resolve } from "path";
import { fileURLToPath } from "url";
import pkg from "../packages/vitepress-theme-async/package.json" assert { type: "json" };

if (process.env.RELEASE_VERSION) {
const version = process.env.RELEASE_VERSION.split("/").reverse()[0];
console.log("当前版本:", version);
pkg.version = version.replace("v", "");
writeFileSync(resolve(fileURLToPath(import.meta.url), "../../packages/vitepress-theme-async/package.json"), JSON.stringify(pkg, null, 4), "utf-8");
}

0 comments on commit 52a6b8b

Please sign in to comment.