@t8/docsgen 0.3.4 → 0.3.6
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/dist/bin.js +5 -5
- package/package.json +1 -1
- package/src/bin/parsing/buildNav.ts +1 -1
- package/src/bin/setContent.ts +4 -4
package/dist/bin.js
CHANGED
|
@@ -445,7 +445,7 @@ function buildNav(ctx, dom) {
|
|
|
445
445
|
let isSectionTitle = tagName === "h2";
|
|
446
446
|
let isSubsectionTitle = tagName === "h3";
|
|
447
447
|
let slug = getSlug(element.textContent);
|
|
448
|
-
let sectionId = isSectionTitle ? slug : navItem?.id ?? "";
|
|
448
|
+
let sectionId = isSectionTitle && !singlePage ? slug : navItem?.id ?? "";
|
|
449
449
|
let link = `${root}${contentDir}/${sectionId}`;
|
|
450
450
|
let elementId = element.id || slug.toLowerCase().replace(/_/g, "-");
|
|
451
451
|
if (elementId)
|
|
@@ -702,7 +702,7 @@ async function setContent(ctx) {
|
|
|
702
702
|
join3(dir, "index.html"),
|
|
703
703
|
toFileContent(`
|
|
704
704
|
<!DOCTYPE html>
|
|
705
|
-
<html lang="en" class="blank">
|
|
705
|
+
<html lang="en" data-layout="redirect" class="blank">
|
|
706
706
|
<head>
|
|
707
707
|
${getInjectedContent(ctx, "redirect", "head", "prepend")}
|
|
708
708
|
<meta charset="utf-8">
|
|
@@ -755,7 +755,7 @@ ${getInjectedContent(ctx, "redirect", "body", "append")}
|
|
|
755
755
|
join3(dir, contentDir, `${nav[i]?.id ?? `_untitled_${i}`}.html`),
|
|
756
756
|
toFileContent(`
|
|
757
757
|
<!DOCTYPE html>
|
|
758
|
-
<html lang="en">
|
|
758
|
+
<html lang="en" data-layout="section">
|
|
759
759
|
<head>
|
|
760
760
|
${getInjectedContent(ctx, "section", "head", "prepend")}
|
|
761
761
|
<meta charset="utf-8">
|
|
@@ -808,7 +808,7 @@ ${getInjectedContent(ctx, "section", "body", "append")}
|
|
|
808
808
|
join3(dir, "index.html"),
|
|
809
809
|
toFileContent(`
|
|
810
810
|
<!DOCTYPE html>
|
|
811
|
-
<html lang="en">
|
|
811
|
+
<html lang="en" data-layout="index">
|
|
812
812
|
<head>
|
|
813
813
|
${getInjectedContent(ctx, "index", "head", "prepend")}
|
|
814
814
|
<meta charset="utf-8">
|
|
@@ -869,7 +869,7 @@ ${getInjectedContent(ctx, "index", "body", "append")}
|
|
|
869
869
|
join3(dir, "start.html"),
|
|
870
870
|
toFileContent(`
|
|
871
871
|
<!DOCTYPE html>
|
|
872
|
-
<html lang="en" class="blank">
|
|
872
|
+
<html lang="en" data-layout="start" class="blank">
|
|
873
873
|
<head>
|
|
874
874
|
${getInjectedContent(ctx, "start", "head", "prepend")}
|
|
875
875
|
<meta charset="utf-8">
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ export function buildNav(ctx: Context, dom: JSDOM) {
|
|
|
27
27
|
let isSubsectionTitle = tagName === "h3";
|
|
28
28
|
let slug = getSlug(element.textContent);
|
|
29
29
|
|
|
30
|
-
let sectionId = isSectionTitle ? slug : (navItem?.id ?? "");
|
|
30
|
+
let sectionId = isSectionTitle && !singlePage ? slug : (navItem?.id ?? "");
|
|
31
31
|
let link = `${root}${contentDir}/${sectionId}`;
|
|
32
32
|
|
|
33
33
|
let elementId = element.id || slug.toLowerCase().replace(/_/g, "-");
|
package/src/bin/setContent.ts
CHANGED
|
@@ -92,7 +92,7 @@ export async function setContent(ctx: Context) {
|
|
|
92
92
|
join(dir, "index.html"),
|
|
93
93
|
toFileContent(`
|
|
94
94
|
<!DOCTYPE html>
|
|
95
|
-
<html lang="en" class="blank">
|
|
95
|
+
<html lang="en" data-layout="redirect" class="blank">
|
|
96
96
|
<head>
|
|
97
97
|
${getInjectedContent(ctx, "redirect", "head", "prepend")}
|
|
98
98
|
<meta charset="utf-8">
|
|
@@ -157,7 +157,7 @@ ${getInjectedContent(ctx, "redirect", "body", "append")}
|
|
|
157
157
|
join(dir, contentDir, `${nav[i]?.id ?? `_untitled_${i}`}.html`),
|
|
158
158
|
toFileContent(`
|
|
159
159
|
<!DOCTYPE html>
|
|
160
|
-
<html lang="en">
|
|
160
|
+
<html lang="en" data-layout="section">
|
|
161
161
|
<head>
|
|
162
162
|
${getInjectedContent(ctx, "section", "head", "prepend")}
|
|
163
163
|
<meta charset="utf-8">
|
|
@@ -215,7 +215,7 @@ ${getInjectedContent(ctx, "section", "body", "append")}
|
|
|
215
215
|
join(dir, "index.html"),
|
|
216
216
|
toFileContent(`
|
|
217
217
|
<!DOCTYPE html>
|
|
218
|
-
<html lang="en">
|
|
218
|
+
<html lang="en" data-layout="index">
|
|
219
219
|
<head>
|
|
220
220
|
${getInjectedContent(ctx, "index", "head", "prepend")}
|
|
221
221
|
<meta charset="utf-8">
|
|
@@ -285,7 +285,7 @@ ${getInjectedContent(ctx, "index", "body", "append")}
|
|
|
285
285
|
join(dir, "start.html"),
|
|
286
286
|
toFileContent(`
|
|
287
287
|
<!DOCTYPE html>
|
|
288
|
-
<html lang="en" class="blank">
|
|
288
|
+
<html lang="en" data-layout="start" class="blank">
|
|
289
289
|
<head>
|
|
290
290
|
${getInjectedContent(ctx, "start", "head", "prepend")}
|
|
291
291
|
<meta charset="utf-8">
|