ezal-theme-example 0.0.6 → 0.0.7
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/assets/styles/_index/contact.styl +10 -0
- package/layouts/404.tsx +1 -1
- package/layouts/article.tsx +9 -3
- package/layouts/components/Contact.tsx +4 -1
- package/layouts/components/Head.tsx +6 -6
- package/layouts/components/Waline.tsx +8 -4
- package/layouts/home.tsx +2 -2
- package/package.json +2 -2
package/layouts/404.tsx
CHANGED
package/layouts/article.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
1
2
|
import { Article, Time, URL } from 'ezal';
|
|
2
3
|
import type { Context } from 'ezal-markdown';
|
|
3
4
|
import base from './base';
|
|
4
5
|
import Image from './components/Image';
|
|
5
|
-
import { Temporal } from '@js-temporal/polyfill';
|
|
6
6
|
|
|
7
7
|
const { theme } = context;
|
|
8
8
|
const page = context.page as Article;
|
|
@@ -95,11 +95,17 @@ let outdateTemplate: JSX.Element | undefined;
|
|
|
95
95
|
if (page.data.outdate) {
|
|
96
96
|
const outdate = Time.parseDate(page.data.outdate.date, page.updated);
|
|
97
97
|
if (outdate) {
|
|
98
|
-
const outdated =
|
|
98
|
+
const outdated =
|
|
99
|
+
outdate.epochMilliseconds <=
|
|
100
|
+
Temporal.Now.zonedDateTimeISO().epochMilliseconds;
|
|
99
101
|
const classList = ['article-outdate'];
|
|
100
102
|
if (outdated) classList.push('article-outdate-show');
|
|
101
103
|
const time = outdate.toString({ timeZoneName: 'never' });
|
|
102
|
-
outdateTemplate =
|
|
104
|
+
outdateTemplate = (
|
|
105
|
+
<div class={classList} data-time={time}>
|
|
106
|
+
{page.data.outdate.message}
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
103
109
|
}
|
|
104
110
|
}
|
|
105
111
|
|
|
@@ -6,9 +6,12 @@ export default (options?: { style?: JSX.IntrinsicAttributes['style'] }) => (
|
|
|
6
6
|
<a
|
|
7
7
|
class={`icon-${icon}`}
|
|
8
8
|
href={URL.for(url)}
|
|
9
|
+
aria-label={name}
|
|
9
10
|
title={name}
|
|
10
11
|
style={{ $color: color }}
|
|
11
|
-
|
|
12
|
+
>
|
|
13
|
+
<div class="sr-only">{name}</div>
|
|
14
|
+
</a>
|
|
12
15
|
))}
|
|
13
16
|
</div>
|
|
14
17
|
);
|
|
@@ -44,15 +44,15 @@ const mermaidScript =
|
|
|
44
44
|
'const charts=new Map();' +
|
|
45
45
|
`for(const e of document.querySelectorAll('pre.mermaid')){` +
|
|
46
46
|
'charts.set(e,e.textContent);' +
|
|
47
|
-
'}'+
|
|
48
|
-
'const render=()=>{'+
|
|
49
|
-
'for(const[e,t]of charts){'+
|
|
50
|
-
'e.textContent=t;'+
|
|
51
|
-
`e.removeAttribute('data-processed')
|
|
47
|
+
'}' +
|
|
48
|
+
'const render=()=>{' +
|
|
49
|
+
'for(const[e,t]of charts){' +
|
|
50
|
+
'e.textContent=t;' +
|
|
51
|
+
`e.removeAttribute('data-processed');` +
|
|
52
52
|
'}' +
|
|
53
53
|
'mermaid.initialize({theme:theme()});' +
|
|
54
54
|
'mermaid.run();' +
|
|
55
|
-
'};'+
|
|
55
|
+
'};' +
|
|
56
56
|
'render();' +
|
|
57
57
|
'media?.addListener(render);' +
|
|
58
58
|
'})';
|
|
@@ -15,8 +15,12 @@ export default () => {
|
|
|
15
15
|
theme.cdn?.walineJS ?? 'https://unpkg.com/@waline/client@v3/dist/waline.js';
|
|
16
16
|
const script = `import{init}from'${module}';init(${JSON.stringify(options)})`;
|
|
17
17
|
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div id="waline" class="wrap"></div>
|
|
21
|
+
<script type="module" defer>
|
|
22
|
+
<RawHTML html={script} />
|
|
23
|
+
</script>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
22
26
|
};
|
package/layouts/home.tsx
CHANGED
|
@@ -12,11 +12,11 @@ const current = pages.indexOf(page);
|
|
|
12
12
|
const slogan = home?.slogan ? (
|
|
13
13
|
<RawHTML html={home.slogan} />
|
|
14
14
|
) : (
|
|
15
|
-
|
|
15
|
+
<>
|
|
16
16
|
{'Hi there!👋'}
|
|
17
17
|
<br />
|
|
18
18
|
{`I'm ${context.site.author}.`}
|
|
19
|
-
|
|
19
|
+
</>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
const logo = home?.logo ? (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ezal-theme-example",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"author": "jonnyjonny",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"shiki": "^3.15.0",
|
|
34
34
|
"sitemap": "^9.0.0",
|
|
35
35
|
"stylus": "^0.64.0",
|
|
36
|
-
"ezal-layout": "^0.0.
|
|
36
|
+
"ezal-layout": "^0.0.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/better-sqlite3": "^7.6.13",
|