@portosaur/core 0.9.1 → 0.9.3
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/configSchema.json
CHANGED
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"type": "string",
|
|
28
28
|
"default": "Short description about you, your passion, your goals etc."
|
|
29
29
|
},
|
|
30
|
+
"head_tags": {
|
|
31
|
+
"type": "array"
|
|
32
|
+
},
|
|
30
33
|
"on_broken_anchors": {
|
|
31
34
|
"type": "string",
|
|
32
35
|
"default": "throw"
|
|
@@ -35,9 +38,6 @@
|
|
|
35
38
|
"type": "string",
|
|
36
39
|
"default": "throw"
|
|
37
40
|
},
|
|
38
|
-
"head_tags": {
|
|
39
|
-
"type": "array"
|
|
40
|
-
},
|
|
41
41
|
"social_card": {
|
|
42
42
|
"type": "string",
|
|
43
43
|
"default": ""
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"vars": {
|
|
80
80
|
"type": "object",
|
|
81
81
|
"additionalProperties": true
|
|
82
82
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portosaur/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "The engine of portosaur that translates YAML configuration into Docusaurus structures.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"author": "soymadip",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"types": "./src/index.d.ts",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@portosaur/logger": "^0.9.
|
|
34
|
+
"@portosaur/logger": "^0.9.3",
|
|
35
35
|
"favicons": "^7.2.0",
|
|
36
36
|
"js-yaml": "^4.1.1",
|
|
37
37
|
"rehype-katex": "7",
|
|
@@ -54,7 +54,7 @@ export function buildDocuConfig(rawUserConfig, projectDir, context = {}) {
|
|
|
54
54
|
isProd: env.NODE_ENV === "production",
|
|
55
55
|
isDev: env.NODE_ENV === "development",
|
|
56
56
|
nodeEnv: env.NODE_ENV ?? "development",
|
|
57
|
-
|
|
57
|
+
vars: rawGet("vars", {}),
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
const get = (key, ...fallbacks) =>
|
|
@@ -83,6 +83,18 @@ export function buildDocuConfig(rawUserConfig, projectDir, context = {}) {
|
|
|
83
83
|
getPortoDotDir(projectDir),
|
|
84
84
|
].filter((dir) => dir && fs.existsSync(dir));
|
|
85
85
|
|
|
86
|
+
// Process all head tags (from plugins and user config)
|
|
87
|
+
const allHeadTags = buildHeadTags([
|
|
88
|
+
...(context.extraHeadTags || []),
|
|
89
|
+
...get("site.head_tags", []),
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
// Separate regular head tags from meta tags
|
|
93
|
+
const regularHeadTags = allHeadTags.filter((t) => t.tagName !== "meta");
|
|
94
|
+
const customMetaTags = allHeadTags
|
|
95
|
+
.filter((t) => t.tagName === "meta")
|
|
96
|
+
.map((t) => t.attributes);
|
|
97
|
+
|
|
86
98
|
// ------- Configuration Setup -------
|
|
87
99
|
|
|
88
100
|
return {
|
|
@@ -99,16 +111,14 @@ export function buildDocuConfig(rawUserConfig, projectDir, context = {}) {
|
|
|
99
111
|
|
|
100
112
|
staticDirectories,
|
|
101
113
|
|
|
102
|
-
headTags:
|
|
103
|
-
...(context.extraHeadTags || []),
|
|
104
|
-
...get("site.head_tags", []),
|
|
105
|
-
]),
|
|
114
|
+
headTags: regularHeadTags,
|
|
106
115
|
|
|
107
116
|
themeConfig: {
|
|
108
117
|
image: resolveAsset(get("site.social_card", "")) || undefined,
|
|
109
118
|
metadata: [
|
|
110
119
|
{ name: "generator", content: `Portosaur v${porto.version}` },
|
|
111
120
|
{ name: "theme-color", content: "var(--ifm-background-color)" },
|
|
121
|
+
...customMetaTags,
|
|
112
122
|
],
|
|
113
123
|
colorMode: {
|
|
114
124
|
defaultMode: defaultTheme,
|