@sugarat/theme 0.1.48 → 0.1.49
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/node.d.ts +1 -0
- package/node.js +4 -2
- package/package.json +1 -1
- package/src/composables/config/index.ts +1 -0
- package/src/utils/node/theme.ts +5 -2
package/node.d.ts
CHANGED
package/node.js
CHANGED
|
@@ -433,15 +433,17 @@ function getArticles(cfg) {
|
|
|
433
433
|
}).filter((v) => v.meta.layout !== "home");
|
|
434
434
|
return data;
|
|
435
435
|
}
|
|
436
|
+
var svgIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 448 512"><title>RSS</title><path d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM112 416c-26.51 0-48-21.49-48-48s21.49-48 48-48s48 21.49 48 48s-21.49 48-48 48zm157.533 0h-34.335c-6.011 0-11.051-4.636-11.442-10.634c-5.214-80.05-69.243-143.92-149.123-149.123c-5.997-.39-10.633-5.431-10.633-11.441v-34.335c0-6.535 5.468-11.777 11.994-11.425c110.546 5.974 198.997 94.536 204.964 204.964c.352 6.526-4.89 11.994-11.425 11.994zm103.027 0h-34.334c-6.161 0-11.175-4.882-11.427-11.038c-5.598-136.535-115.204-246.161-251.76-251.76C68.882 152.949 64 147.935 64 141.774V107.44c0-6.454 5.338-11.664 11.787-11.432c167.83 6.025 302.21 141.191 308.205 308.205c.232 6.449-4.978 11.787-11.432 11.787z" fill="currentColor"></path></svg>';
|
|
436
437
|
function patchVPThemeConfig(cfg, vpThemeConfig = {}) {
|
|
437
438
|
const RSS = cfg?.RSS;
|
|
438
439
|
if (RSS && RSS.icon !== false) {
|
|
439
440
|
vpThemeConfig.socialLinks = [
|
|
440
441
|
{
|
|
441
442
|
icon: {
|
|
442
|
-
svg:
|
|
443
|
+
svg: svgIcon
|
|
443
444
|
},
|
|
444
|
-
link: RSS?.url
|
|
445
|
+
link: RSS?.url,
|
|
446
|
+
ariaLabel: RSS?.ariaLabel || "RSS"
|
|
445
447
|
}
|
|
446
448
|
];
|
|
447
449
|
}
|
package/package.json
CHANGED
package/src/utils/node/theme.ts
CHANGED
|
@@ -123,6 +123,8 @@ export function patchVPConfig(vpConfig: any, cfg?: Partial<Theme.BlogConfig>) {
|
|
|
123
123
|
// TODO: 待确定场景
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
const svgIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 448 512"><title>RSS</title><path d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM112 416c-26.51 0-48-21.49-48-48s21.49-48 48-48s48 21.49 48 48s-21.49 48-48 48zm157.533 0h-34.335c-6.011 0-11.051-4.636-11.442-10.634c-5.214-80.05-69.243-143.92-149.123-149.123c-5.997-.39-10.633-5.431-10.633-11.441v-34.335c0-6.535 5.468-11.777 11.994-11.425c110.546 5.974 198.997 94.536 204.964 204.964c.352 6.526-4.89 11.994-11.425 11.994zm103.027 0h-34.334c-6.161 0-11.175-4.882-11.427-11.038c-5.598-136.535-115.204-246.161-251.76-251.76C68.882 152.949 64 147.935 64 141.774V107.44c0-6.454 5.338-11.664 11.787-11.432c167.83 6.025 302.21 141.191 308.205 308.205c.232 6.449-4.978 11.787-11.432 11.787z" fill="currentColor"></path></svg>'
|
|
127
|
+
|
|
126
128
|
export function patchVPThemeConfig(
|
|
127
129
|
cfg?: Partial<Theme.BlogConfig>,
|
|
128
130
|
vpThemeConfig: any = {}
|
|
@@ -133,9 +135,10 @@ export function patchVPThemeConfig(
|
|
|
133
135
|
vpThemeConfig.socialLinks = [
|
|
134
136
|
{
|
|
135
137
|
icon: {
|
|
136
|
-
svg:
|
|
138
|
+
svg: svgIcon
|
|
137
139
|
},
|
|
138
|
-
link: RSS?.url
|
|
140
|
+
link: RSS?.url,
|
|
141
|
+
ariaLabel: RSS?.ariaLabel || 'RSS'
|
|
139
142
|
}
|
|
140
143
|
]
|
|
141
144
|
}
|