fossbook 0.2.8 → 0.2.10
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/lib/mod/marked.js +17 -1
- package/lib/mod/page.js +1 -1
- package/package.json +1 -1
- package/themes/archie/assets/styles/main.css +8 -0
- package/themes/archie/layouts/all_posts.html +2 -2
- package/themes/archie/layouts/home.html +2 -2
- package/themes/archie/layouts/page.html +3 -3
- package/themes/archie/layouts/post.html +3 -3
- package/themes/archie/layouts/tag.html +2 -2
- package/themes/archie/layouts/tag_list.html +2 -2
package/lib/mod/marked.js
CHANGED
|
@@ -39,6 +39,19 @@ function renderWikipediaCitation(href) {
|
|
|
39
39
|
return `<a href="${escapeAttribute(href)}">${escapeAttribute(citation)}</a>`;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
function renderKoreanBlockquoteQuotes(html) {
|
|
43
|
+
const quoteCount = (html.match(/"/g) || []).length;
|
|
44
|
+
if (quoteCount === 0 || quoteCount % 2 !== 0) return html;
|
|
45
|
+
|
|
46
|
+
let opening = true;
|
|
47
|
+
return html.replace(/"/g, () => {
|
|
48
|
+
const quote = opening ? "“" : "”";
|
|
49
|
+
const position = opening ? "open" : "close";
|
|
50
|
+
opening = !opening;
|
|
51
|
+
return `<span class="dialogue-quote dialogue-quote-${position}">${quote}</span>`;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
42
55
|
function matchFencedContainer(source, name) {
|
|
43
56
|
const opening = new RegExp(`^(:{3,})${name}(?=[ \\t]|\\n)([^\\n]*)\\n`).exec(source);
|
|
44
57
|
if (!opening) return undefined;
|
|
@@ -379,7 +392,10 @@ const renderer = {
|
|
|
379
392
|
}
|
|
380
393
|
},
|
|
381
394
|
blockquote(quote) {
|
|
382
|
-
|
|
395
|
+
const content = this.options.language === "ko"
|
|
396
|
+
? renderKoreanBlockquoteQuotes(quote)
|
|
397
|
+
: quote;
|
|
398
|
+
return `<div class="blockquote-container"><blockquote>${content}</blockquote></div>`;
|
|
383
399
|
},
|
|
384
400
|
paragraph(text) {
|
|
385
401
|
// remove <p> surrounding the image
|
package/lib/mod/page.js
CHANGED
|
@@ -50,7 +50,7 @@ module.exports = class Page extends PageBase {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// generated HTML from markdown
|
|
53
|
-
this.body = marked.parse(content.body);
|
|
53
|
+
this.body = marked.parse(content.body, { language: this.config.language });
|
|
54
54
|
// remove <p></p> and <p> </p> from the beginning and end of the content.body
|
|
55
55
|
this.body = this.body.replace(/<p><\/p>/g, "").replace(/<p> <\/p>/g, "");
|
|
56
56
|
|
package/package.json
CHANGED
|
@@ -147,6 +147,10 @@
|
|
|
147
147
|
line-height: inherit;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
html:lang(ko) .dialogue-quote {
|
|
151
|
+
font-family: 'NanumSquareNeo', sans-serif;
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
@media print {
|
|
151
155
|
.transcript-control {
|
|
152
156
|
display: none;
|
|
@@ -175,6 +179,10 @@
|
|
|
175
179
|
ol > li::marker {
|
|
176
180
|
font-family: 'Roboto Mono', monospace;
|
|
177
181
|
}
|
|
182
|
+
html:lang(ko) ol > li::marker {
|
|
183
|
+
font-family: sans-serif;
|
|
184
|
+
font-variant-numeric: tabular-nums;
|
|
185
|
+
}
|
|
178
186
|
|
|
179
187
|
/*
|
|
180
188
|
ul.pagination {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="description" content="${page.config.blogDescription}" />
|
|
7
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
8
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
7
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
8
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
9
9
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
10
10
|
<!-- Google tag (gtag.js) -->
|
|
11
11
|
${page.config.googleAnalyticsID ? page.googleAnalytics(page.config.googleAnalyticsID) : ""}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
7
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
6
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
7
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
8
8
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
9
9
|
<!-- Google tag (gtag.js) -->
|
|
10
10
|
${page.config.googleAnalyticsID ? page.googleAnalytics(page.config.googleAnalyticsID) : ""}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
7
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
8
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/highlights.css">
|
|
6
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
7
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
8
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/highlights.css?v=${page.config.version}">
|
|
9
9
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
10
10
|
<!-- Google tag (gtag.js) -->
|
|
11
11
|
${page.config.googleAnalyticsID ? page.googleAnalytics(page.config.googleAnalyticsID) : ""}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
7
7
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
8
8
|
<link href="https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Nanum+Pen+Script&family=Playpen+Sans:wght@100..800&display=swap" rel="stylesheet">
|
|
9
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
10
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
11
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/highlights.css">
|
|
9
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
10
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
11
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/highlights.css?v=${page.config.version}">
|
|
12
12
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
13
13
|
<!-- Google tag (gtag.js) -->
|
|
14
14
|
${page.config.googleAnalyticsID ? page.googleAnalytics(page.config.googleAnalyticsID) : ""}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="description" content="${page.config.blogDescription}" />
|
|
7
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
8
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
7
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
8
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
9
9
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
10
10
|
<!-- Google tag (gtag.js) -->
|
|
11
11
|
${page.config.googleAnalyticsID ? page.googleAnalytics(page.config.googleAnalyticsID) : ""}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="description" content="${page.config.blogDescription}" />
|
|
7
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css">
|
|
8
|
-
<link rel="stylesheet" href="${page.config.basePath}styles/main.css">
|
|
7
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/fonts.css?v=${page.config.version}">
|
|
8
|
+
<link rel="stylesheet" href="${page.config.basePath}styles/main.css?v=${page.config.version}">
|
|
9
9
|
<link rel="icon" type="image/png" href="${page.config.basePath}images/favicon.png">
|
|
10
10
|
|
|
11
11
|
<!-- Google tag (gtag.js) -->
|