minearm-website 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Minearm & Website
2
2
  # 本主题是从[HusBlog](https://github.com/KraHsu/HsuBlog.git)改进而来的
3
- 最新的正式版是0.2.0
3
+ 最新的正式版是0.2.1
4
4
  最新的测试版是0.0.3-beta.4
5
5
 
6
- 但是Minearm & Website做出了很大的改变,比如修复了scss警告和升级astro版本到5.1.10
6
+ 但是Minearm & Website做出了很大的改变,比如修复了scss警告和升级astro版本到5.5.4
7
7
 
8
8
  # 效果
9
9
  ![Minearm](https://portal.astro.build/_image?href=https%3A%2F%2Fstorage.googleapis.com%2Fdev-portal-bucket%2Fkotpt1ztaalrk5frua5pnwdvoh185ylgg0rio9.webp)
package/astro.config.ts CHANGED
@@ -1,38 +1,75 @@
1
- import { defineConfig } from "astro/config";
2
- import sitemap from "@astrojs/sitemap";
3
- import { markdownDirectives, remarkFrontmatter, rehypeFrontmatter, remarkRestyling, rehypeRestyling } from "./src/utils/md";
4
- import remarkGfm from "remark-gfm";
5
- import remarkMath from "remark-math";
6
- import rehypeKatex from "rehype-katex";
7
- import rehypeMathjax from "rehype-mathjax";
8
- import remarkDirective from "remark-directive";
9
- import vue from "@astrojs/vue";
10
- import { SiteConfig } from "./src/site_config";
11
- import { generateSearchData } from "./src/utils/generateSearchData.ts";
12
- //import netlify from "@astrojs/netlify";
13
- const remarkPlugins: any = [remarkFrontmatter, remarkGfm, SiteConfig.markdownMath !== false && remarkMath, remarkRestyling, remarkDirective, markdownDirectives, SiteConfig.localSearch && generateSearchData].filter(Boolean);
14
- const rehypePlugins: any = [rehypeFrontmatter, rehypeRestyling, SiteConfig.markdownMath === "Katex" && rehypeKatex, SiteConfig.markdownMath === "Mathjax" && rehypeMathjax].filter(Boolean);
15
- // https://astro.build/config
16
- export default defineConfig({
17
- site: SiteConfig.site,
18
- integrations: [sitemap(), vue()],
19
- output: "static",
20
-
21
- build: {
22
- format: "directory"
23
- },
24
-
25
- markdown: {
26
- syntaxHighlight: "shiki",
27
- shikiConfig: {
28
- theme: "css-variables",
29
- langs: [],
30
- wrap: false
31
- },
32
- remarkPlugins: remarkPlugins,
33
- rehypePlugins: rehypePlugins
34
- },
35
-
36
- trailingSlash: "ignore",
37
- // adapter: netlify()
38
- });
1
+ import { defineConfig } from "astro/config";
2
+ import sitemap from "@astrojs/sitemap";
3
+ import { markdownDirectives, remarkFrontmatter, rehypeFrontmatter, remarkRestyling, rehypeRestyling } from "./src/utils/md";
4
+ import remarkGfm from "remark-gfm";
5
+ import remarkMath from "remark-math";
6
+ import rehypeKatex from "rehype-katex";
7
+ import rehypeMathjax from "rehype-mathjax";
8
+ import remarkDirective from "remark-directive";
9
+ import vue from "@astrojs/vue";
10
+ import { SiteConfig } from "./src/site_config";
11
+ import { generateSearchData } from "./src/utils/generateSearchData.ts";
12
+ import type { Plugin } from "unified";
13
+
14
+ // 定义 remark 插件数组类型
15
+ type RemarkPluginArray = Array<Plugin | false | null | undefined>;
16
+ // 定义 rehype 插件数组类型
17
+ type RehypePluginArray = Array<Plugin | false | null | undefined>;
18
+
19
+ // 生成 remark 插件数组
20
+ const generateRemarkPlugins = (): RemarkPluginArray => [
21
+ remarkFrontmatter,
22
+ remarkGfm,
23
+ SiteConfig.markdownMath === true && remarkMath,
24
+ remarkRestyling,
25
+ remarkDirective,
26
+ markdownDirectives,
27
+ SiteConfig.localSearch && generateSearchData,
28
+ ].filter(Boolean);
29
+
30
+ // 生成 rehype 插件数组
31
+ const generateRehypePlugins = (): RehypePluginArray => [
32
+ rehypeFrontmatter,
33
+ rehypeRestyling,
34
+ SiteConfig.markdownMath === "Katex" && rehypeKatex,
35
+ SiteConfig.markdownMath === "Mathjax" && rehypeMathjax,
36
+ ].filter(Boolean);
37
+
38
+ // 定义 markdown 配置
39
+ const markdownConfig = {
40
+ syntaxHighlight: "shiki",
41
+ shikiConfig: {
42
+ theme: "css-variables",
43
+ langs: [],
44
+ wrap: false,
45
+ },
46
+ remarkPlugins: generateRemarkPlugins(),
47
+ rehypePlugins: generateRehypePlugins(),
48
+ };
49
+
50
+ // 定义 build 配置
51
+ const buildConfig = {
52
+ format: "directory",
53
+ };
54
+
55
+ // 定义 collections 配置
56
+ const collectionsConfig = [
57
+ {
58
+ name: "blog",
59
+ label: "Blog Posts",
60
+ path: "src/pages/blog",
61
+ sort: (a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime(),
62
+ },
63
+ // ... 其他集合
64
+ ];
65
+
66
+ export default defineConfig({
67
+ site: SiteConfig.site,
68
+ integrations: [sitemap(), vue()],
69
+ output: "static",
70
+ build: buildConfig,
71
+ collections: collectionsConfig,
72
+ markdown: markdownConfig,
73
+ edgeMiddleware: true,
74
+ });
75
+
package/minearm.ts CHANGED
@@ -126,9 +126,7 @@ const addAbbrlinkToFile = async (filepath: string) => {
126
126
  const pubDateStr = parsedMatter.data.pubDate;
127
127
  const pubDate = new Date(pubDateStr);
128
128
  const abbrlink = pubDate.getTime().toString(36);
129
-
130
129
  parsedMatter.data.abbrlink = abbrlink;
131
-
132
130
  const fileContent = matter.stringify(content, parsedMatter.data);
133
131
  await writeFileAsync(filepath, fileContent);
134
132
  console.log(`Permalink added: ${filepath}`);
package/package.json CHANGED
@@ -1,64 +1,75 @@
1
- {
2
- "name": "minearm-website",
3
- "description": "Welcome to Minearm & Website.",
4
- "version": "0.2.0",
5
- "homepage": "https://github.com/Minearm-RPM/minearm",
6
- "type": "module",
7
- "license": "MIT",
8
- "scripts": {
9
- "dev": "astro dev",
10
- "start": "astro dev",
11
- "build": "astro build",
12
- "preview": "astro preview",
13
- "astro": "astro",
14
- "new": "ts-node ./minearm.ts new",
15
- "abbr": "ts-node ./minearm.ts abbr",
16
- "newpage": "ts-node ./minearm.ts newPage",
17
- "help": "ts-node ./minearm.ts help",
18
- "pu": "ts-node ./pu.ts"
19
- },
20
- "dependencies": {
21
- "@astrojs/markdown-remark": "6.0.2",
22
- "@astrojs/mdx": "4.0.7",
23
- "@astrojs/rss": "4.0.11",
24
- "@duannx/vue-client-only": "1.0.3",
25
- "@fortawesome/fontawesome-svg-core": "6.7.2",
26
- "@fortawesome/free-solid-svg-icons": "6.7.2",
27
- "@iconify-json/tabler": "1.2.15",
28
- "astro": "5.1.10",
29
- "astro-i18next": "1.0.0-beta.21",
30
- "astro-icon": "1.1.5",
31
- "fuse.js": "7.0.0",
32
- "glob": "11.0.1",
33
- "hastscript": "9.0.0",
34
- "html-loader": "5.1.0",
35
- "markdown-loader": "8.0.0",
36
- "marked": "15.0.6",
37
- "mdast-util-to-string": "4.0.0",
38
- "minearm-website": "^0.1.3",
39
- "pnpm": "9.15.4",
40
- "reading-time": "1.5.0",
41
- "rehype-katex": "7.0.1",
42
- "rehype-mathjax": "6.0.0",
43
- "remark-directive": "3.0.1",
44
- "remark-gfm": "4.0.0",
45
- "remark-math": "6.0.0",
46
- "showdown": "2.1.0",
47
- "yargs": "17.7.2"
48
- },
49
- "devDependencies": {
50
- "@astrojs/sitemap": "3.2.1",
51
- "@astrojs/vue": "5.0.6",
52
- "@types/yargs": "17.0.33",
53
- "sass": "1.70.0",
54
- "scss": "0.2.4",
55
- "ts-node": "10.9.2",
56
- "vue": "^3.5.13"
57
- },
58
- "keywords": [
59
- "astro-component",
60
- "withastro"
61
- ],
62
- "main": "index.js",
63
- "author": ""
64
- }
1
+ {
2
+ "name": "minearm-website",
3
+ "description": "Welcome to Minearm & Website.",
4
+ "version": "0.2.1",
5
+ "homepage": "https://github.com/Minearm-RPM/minearm",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "dev": "astro dev",
10
+ "start": "astro dev",
11
+ "build": "astro build",
12
+ "preview": "astro preview",
13
+ "astro": "astro",
14
+ "new": "ts-node ./minearm.ts new",
15
+ "abbr": "ts-node ./minearm.ts abbr",
16
+ "newpage": "ts-node ./minearm.ts newPage",
17
+ "help": "ts-node ./minearm.ts help",
18
+ "pu": "ts-node ./pu.ts"
19
+ },
20
+ "dependencies": {
21
+ "@astrojs/markdown-remark": "^6.3.1",
22
+ "@astrojs/mdx": "^4.2.1",
23
+ "@astrojs/rss": "4.0.11",
24
+ "@duannx/vue-client-only": "1.0.3",
25
+ "@fortawesome/fontawesome-svg-core": "6.7.2",
26
+ "@fortawesome/free-solid-svg-icons": "6.7.2",
27
+ "@iconify-json/tabler": "1.2.15",
28
+ "astro": "^5.5.4",
29
+ "astro-i18next": "1.0.0-beta.21",
30
+ "astro-icon": "1.1.5",
31
+ "fuse.js": "7.0.0",
32
+ "glob": "11.0.1",
33
+ "gray-matter": "4.0.3",
34
+ "hastscript": "9.0.0",
35
+ "html-loader": "5.1.0",
36
+ "markdown-loader": "8.0.0",
37
+ "marked": "15.0.6",
38
+ "mdast-util-to-string": "4.0.0",
39
+ "pnpm": "10.3.0",
40
+ "reading-time": "1.5.0",
41
+ "rehype-katex": "7.0.1",
42
+ "rehype-mathjax": "6.0.0",
43
+ "remark-directive": "3.0.1",
44
+ "remark-gfm": "4.0.0",
45
+ "remark-math": "6.0.0",
46
+ "showdown": "2.1.0",
47
+ "yargs": "17.7.2"
48
+ },
49
+ "devDependencies": {
50
+ "@astrojs/sitemap": "3.2.1",
51
+ "@astrojs/vue": "5.0.6",
52
+ "@types/yargs": "17.0.33",
53
+ "@waline/api": "^1.0.0",
54
+ "@waline/client": "^3.5.6",
55
+ "recaptcha-v3": "^1.11.3",
56
+ "sass": "1.70.0",
57
+ "scss": "0.2.4",
58
+ "ts-node": "10.9.2",
59
+ "vue": "^3.5.13"
60
+ },
61
+ "keywords": [
62
+ "astro-component",
63
+ "withastro"
64
+ ],
65
+ "main": "index.js",
66
+ "author": "",
67
+ "pnpm": {
68
+ "ignoredBuiltDependencies": [
69
+ "esbuild",
70
+ "esbuild",
71
+ "sharp",
72
+ "sharp"
73
+ ]
74
+ }
75
+ }
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  {
2
- "totalWordCounts": 1172,
3
- "totalPostCounts": 3
2
+ "totalWordCounts": 117580,
3
+ "totalPostCounts": 12
4
4
  }