mirror of
https://github.com/darkings/Obsidian-MonokaiSyntax.git
synced 2026-07-22 04:40:26 +00:00
feat: theme.css 输出到仓库根目录,截图调整为社区规范尺寸
为 Obsidian 社区主题提交做准备: - Vite 构建同时输出 theme.css 到根目录 - 同步脚本、审计脚本、Release CI 统一引用根目录路径 - 截图调整为 512×288(社区列表规范尺寸)
This commit is contained in:
parent
f8f56ae8a9
commit
16a65543f1
6 changed files with 144 additions and 4 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -27,7 +27,7 @@ jobs:
|
|||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
dist/theme.css
|
||||
theme.css
|
||||
manifest.json
|
||||
fail_on_unmatched_files: true
|
||||
generate_release_notes: true
|
||||
|
|
|
|||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 214 KiB |
|
|
@ -1,7 +1,7 @@
|
|||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const themeCssPath = resolve(import.meta.dirname, "../dist/theme.css");
|
||||
const themeCssPath = resolve(import.meta.dirname, "../theme.css");
|
||||
const themeCss = readFileSync(themeCssPath, "utf8");
|
||||
|
||||
const urlMatches = [...themeCss.matchAll(/url\((["']?)(.*?)\1\)/gi)].map((match) => match[2]);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const vaultThemeDir = resolve(vaultRoot, ".obsidian/themes/Monokai Syntax");
|
|||
|
||||
mkdirSync(vaultThemeDir, { recursive: true });
|
||||
|
||||
copyFileSync(resolve(rootDir, "dist/theme.css"), resolve(vaultThemeDir, "theme.css"));
|
||||
copyFileSync(resolve(rootDir, "theme.css"), resolve(vaultThemeDir, "theme.css"));
|
||||
copyFileSync(resolve(rootDir, "manifest.json"), resolve(vaultThemeDir, "manifest.json"));
|
||||
|
||||
console.log(`已同步主题到:${vaultThemeDir}`);
|
||||
|
|
|
|||
137
theme.css
Normal file
137
theme.css
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,7 @@ import { defineConfig } from "vite";
|
|||
const rootDir = import.meta.dirname;
|
||||
const outDir = resolve(rootDir, "dist");
|
||||
const themeCssPath = resolve(outDir, "theme.css");
|
||||
const rootThemeCssPath = resolve(rootDir, "theme.css");
|
||||
const licensePath = resolve(rootDir, "src/css/license.css");
|
||||
const styleSettingsDir = resolve(rootDir, "src/css/style-settings");
|
||||
|
||||
|
|
@ -30,8 +31,10 @@ function obsidianThemeBundle() {
|
|||
.trim();
|
||||
const styleSettings = readStyleSettings();
|
||||
const sections = [license, themeCss, styleSettings].filter(Boolean);
|
||||
const bundled = `${sections.join("\n\n")}\n`;
|
||||
|
||||
writeFileSync(themeCssPath, `${sections.join("\n\n")}\n`);
|
||||
writeFileSync(themeCssPath, bundled);
|
||||
writeFileSync(rootThemeCssPath, bundled);
|
||||
|
||||
for (const fileName of readdirSync(outDir)) {
|
||||
if (fileName.endsWith(".js")) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue