@d-zero/scaffold 5.0.0-beta.1 → 5.0.0-beta.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/.gitignore +9 -0
- package/.vscode/settings.json +0 -1
- package/CHANGELOG.md +74 -0
- package/README.md +8 -7
- package/__assets/_libs/.markuplintrc +6 -0
- package/__assets/_libs/component/c-content-main.css +133 -16
- package/__assets/_libs/component/c-nav-breadcrumb.pug +17 -39
- package/__assets/_libs/component/c-pagination.css +2 -0
- package/__assets/_libs/component/c-title-page.pug +1 -1
- package/__assets/_libs/data/bge-blocks-v2.html +2101 -0
- package/__assets/_libs/data/bge-blocks.html +1040 -1824
- package/__assets/_libs/data/blocks.js +1 -1
- package/__assets/_libs/data/breadcrumbs.js +77 -0
- package/__assets/_libs/data/titlelist.js +16 -0
- package/__assets/_libs/layouts/home.pug +17 -0
- package/__assets/_libs/layouts/sub.pug +25 -0
- package/__assets/_libs/mixin/meta-basercms.pug +14 -0
- package/__assets/_libs/mixin/meta.pug +26 -21
- package/__assets/_libs/style/general/all.css +1 -0
- package/__assets/htdocs/__tmpl/000_home.json +4 -0
- package/__assets/htdocs/__tmpl/000_home.pug +2 -20
- package/__assets/htdocs/__tmpl/100_sub.json +4 -0
- package/__assets/htdocs/__tmpl/100_sub.pug +1 -23
- package/__assets/htdocs/__tmpl/200_blog_index.json +5 -0
- package/__assets/htdocs/__tmpl/200_blog_index.pug +14 -40
- package/__assets/htdocs/__tmpl/210_blog_index.json +5 -0
- package/__assets/htdocs/__tmpl/210_blog_index.pug +14 -40
- package/__assets/htdocs/__tmpl/300_form_input.json +4 -0
- package/__assets/htdocs/__tmpl/300_form_input.pug +529 -568
- package/__assets/htdocs/__tmpl/301_form_confirm.json +4 -0
- package/__assets/htdocs/__tmpl/301_form_confirm.pug +188 -212
- package/__assets/htdocs/__tmpl/302_form_complete.json +4 -0
- package/__assets/htdocs/__tmpl/302_form_complete.pug +3 -27
- package/__assets/htdocs/sample/index.html +15 -0
- package/__assets/htdocs/sub-folder.test/index.pug +1 -3
- package/burgereditor.config.js +25 -0
- package/eleventy.config.mjs +7 -1
- package/markuplint.config.js +4 -0
- package/package.json +36 -19
- package/.clineignore +0 -6
- package/.clinerules +0 -17
- package/__assets/_libs/data/blocks.html +0 -71
- package/ai-tasks/create-component.md +0 -127
- package/ai-tasks/create-page.md +0 -110
- package/ai-tasks/page-to-burger.md +0 -68
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
import { JSDOM } from 'jsdom';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export default function () {
|
|
9
|
+
return (page, collections) => {
|
|
10
|
+
const breadcrumbs = collections.all
|
|
11
|
+
.filter((item) => isAncestor(page, item.filePathStem))
|
|
12
|
+
.map((item) => ({
|
|
13
|
+
title: getTitle(item),
|
|
14
|
+
href: item.page.url,
|
|
15
|
+
depth: item.page.url.split('/').filter(Boolean).length,
|
|
16
|
+
}))
|
|
17
|
+
.sort((a, b) => a.depth - b.depth);
|
|
18
|
+
return breadcrumbs;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param page
|
|
25
|
+
* @param filePathStem
|
|
26
|
+
*/
|
|
27
|
+
function isAncestor(page, filePathStem) {
|
|
28
|
+
const dirname = path.dirname(filePathStem);
|
|
29
|
+
const name = path.basename(filePathStem);
|
|
30
|
+
const included = page.filePathStem.startsWith(dirname);
|
|
31
|
+
const isIndex = name === 'index';
|
|
32
|
+
const isSelf = page.filePathStem === filePathStem;
|
|
33
|
+
return (included && isIndex) || isSelf;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const titleCache = new Map();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param item
|
|
41
|
+
*/
|
|
42
|
+
function getTitle(item) {
|
|
43
|
+
const filePathStem = item.filePathStem;
|
|
44
|
+
if (titleCache.has(filePathStem)) {
|
|
45
|
+
return titleCache.get(filePathStem);
|
|
46
|
+
}
|
|
47
|
+
const title =
|
|
48
|
+
item.data.title?.trim() ||
|
|
49
|
+
getTitleFromDOM(getContent(item)) ||
|
|
50
|
+
item.page.fileSlug?.trim();
|
|
51
|
+
titleCache.set(filePathStem, title);
|
|
52
|
+
return title;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param item
|
|
58
|
+
*/
|
|
59
|
+
function getTitleFromDOM(item) {
|
|
60
|
+
const content = getContent(item);
|
|
61
|
+
const dom = new JSDOM(content);
|
|
62
|
+
const title = dom.window.document.title.trim();
|
|
63
|
+
return title;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param item
|
|
69
|
+
*/
|
|
70
|
+
function getContent(item) {
|
|
71
|
+
try {
|
|
72
|
+
// UsingCircularTemplateContentReferenceError may potentially occur
|
|
73
|
+
return item.templateContent;
|
|
74
|
+
} catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import breadcrumbs from './breadcrumbs.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export default async function () {
|
|
7
|
+
return (page, collections, pkg, separator = ' | ') => {
|
|
8
|
+
const breadcrumbLinkList = breadcrumbs()(page, collections);
|
|
9
|
+
const titleList = breadcrumbLinkList
|
|
10
|
+
.filter((item) => item.href !== '/')
|
|
11
|
+
.toReversed()
|
|
12
|
+
.map((item) => item.title);
|
|
13
|
+
titleList.push(pkg.production?.siteName || '__サイト名__');
|
|
14
|
+
return titleList.join(separator);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
doctype html
|
|
2
|
+
html(lang=lang || "ja")
|
|
3
|
+
head
|
|
4
|
+
include /mixin/meta.pug
|
|
5
|
+
body.c-page-home
|
|
6
|
+
.c-page-home__base
|
|
7
|
+
.c-page-home__header
|
|
8
|
+
- const isHome = true;
|
|
9
|
+
include /component/c-header.pug
|
|
10
|
+
.c-page-home__nav-global
|
|
11
|
+
include /component/c-nav-global.pug
|
|
12
|
+
.c-page-home__main
|
|
13
|
+
main !{ content }
|
|
14
|
+
.c-page-home__nav-sitemap
|
|
15
|
+
include /component/c-nav-sitemap.pug
|
|
16
|
+
.c-page-home__footer
|
|
17
|
+
include /component/c-footer.pug
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
doctype html
|
|
2
|
+
html(lang=lang || "ja")
|
|
3
|
+
head
|
|
4
|
+
include /mixin/meta.pug
|
|
5
|
+
body.c-page-sub
|
|
6
|
+
.c-page-sub__base
|
|
7
|
+
.c-page-sub__header
|
|
8
|
+
include /component/c-header.pug
|
|
9
|
+
.c-page-sub__nav-global
|
|
10
|
+
include /component/c-nav-global.pug
|
|
11
|
+
.c-page-sub__main
|
|
12
|
+
main
|
|
13
|
+
article.c-page-sub__content
|
|
14
|
+
.c-page-sub__title-page
|
|
15
|
+
include /component/c-title-page.pug
|
|
16
|
+
.c-page-sub__nav-breadcrumb
|
|
17
|
+
include /component/c-nav-breadcrumb.pug
|
|
18
|
+
.c-page-sub__content-body !{ content }
|
|
19
|
+
if hasPagination
|
|
20
|
+
.c-page-sub__pagination
|
|
21
|
+
include /component/c-pagination.pug
|
|
22
|
+
.c-page-sub__nav-sitemap
|
|
23
|
+
include /component/c-nav-sitemap.pug
|
|
24
|
+
.c-page-sub__footer
|
|
25
|
+
include /component/c-footer.pug
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
link(
|
|
2
|
+
⚠️="baserCMS組み込み時は削除してください"
|
|
3
|
+
rel="stylesheet"
|
|
4
|
+
href="/__tmpl/__burger_editor/css/colorbox.css")
|
|
5
|
+
script(
|
|
6
|
+
⚠️="baserCMS組み込み時は削除してください"
|
|
7
|
+
src="https://maps.google.com/maps/api/js?key=AIzaSyDc3Vko3MvdrlJuQyEmo0WiT50RIMMtk5g")
|
|
8
|
+
script(
|
|
9
|
+
⚠️="baserCMS組み込み時は削除してください"
|
|
10
|
+
src="/__tmpl/__burger_editor/js/bge_modules/jquery.colorbox-min.js")
|
|
11
|
+
script(
|
|
12
|
+
⚠️="baserCMS組み込み時は削除してください"
|
|
13
|
+
src="/__tmpl/__burger_editor/js/bge_modules/bge_functions.min.js")
|
|
14
|
+
script(src="/js/jquery.min.js")
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
meta(property="og:
|
|
9
|
-
|
|
10
|
-
meta(property="og:description" content="
|
|
11
|
-
|
|
12
|
-
meta(property="og:
|
|
13
|
-
meta(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
meta(name="twitter:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
meta(charset="UTF-8")
|
|
2
|
+
meta(name="viewport" content="width=device-width")
|
|
3
|
+
title= titlelist(page, collections, pkg, " | ")
|
|
4
|
+
meta(name="format-detection" content="telephone=no")
|
|
5
|
+
meta(name="description" content=description || "")
|
|
6
|
+
meta(property="og:type" content=ogType || "website")
|
|
7
|
+
if pkg.production.siteName
|
|
8
|
+
meta(property="og:site_name" content=pkg.production.siteName || "__サイト名__")
|
|
9
|
+
if ogDescription || description
|
|
10
|
+
meta(property="og:description" content=ogDescription || description || "")
|
|
11
|
+
if pkg.production.host
|
|
12
|
+
meta(property="og:url" content=pkg.production.host + page.url)
|
|
13
|
+
meta(property="og:image" content=pkg.production.host + (ogImage || "/img/ogp.png"))
|
|
14
|
+
meta(name="twitter:card" content=ogCard || "summary_large_image")
|
|
15
|
+
meta(name="twitter:url" content=pkg.production.host + page.url)
|
|
16
|
+
if pkg.production.siteName
|
|
17
|
+
meta(name="twitter:title" content=pkg.production.siteName || "__サイト名__")
|
|
18
|
+
if ogDescription || description
|
|
19
|
+
meta(name="twitter:description" content=ogDescription || description || "")
|
|
20
|
+
if pkg.production.host
|
|
21
|
+
meta(name="twitter:image" content=pkg.production.host + (ogImage || "/img/ogp.png"))
|
|
22
|
+
link(rel="icon" href="/favicon.png")
|
|
23
|
+
link(rel="apple-touch-icon" href="/img/apple-touch-icon.png")
|
|
24
|
+
link(href="/css/style.css" rel="stylesheet")
|
|
25
|
+
include meta-basercms.pug
|
|
26
|
+
script(src="/js/script.js" type="module")
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
include /mixin/meta.pug
|
|
4
|
-
+meta("__サイトタイトル__")
|
|
5
|
-
body.c-page-home
|
|
6
|
-
.c-page-home__base
|
|
7
|
-
.c-page-home__header
|
|
8
|
-
- const isHome = true;
|
|
9
|
-
include /component/c-header.pug
|
|
10
|
-
.c-page-home__nav-global
|
|
11
|
-
include /component/c-nav-global.pug
|
|
12
|
-
|
|
13
|
-
.c-page-home__main
|
|
14
|
-
main
|
|
15
|
-
h2 メイン
|
|
16
|
-
|
|
17
|
-
.c-page-home__nav-sitemap
|
|
18
|
-
include /component/c-nav-sitemap.pug
|
|
19
|
-
.c-page-home__footer
|
|
20
|
-
include /component/c-footer.pug
|
|
1
|
+
h2 トップページ
|
|
2
|
+
div トップページ内容
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
head
|
|
3
|
-
include /mixin/meta.pug
|
|
4
|
-
+meta("__ページタイトル__ | __サイトタイトル__")
|
|
5
|
-
body.c-page-sub
|
|
6
|
-
.c-page-sub__base
|
|
7
|
-
.c-page-sub__header
|
|
8
|
-
include /component/c-header.pug
|
|
9
|
-
.c-page-sub__nav-global
|
|
10
|
-
include /component/c-nav-global.pug
|
|
11
|
-
.c-page-sub__main
|
|
12
|
-
main
|
|
13
|
-
article.c-page-sub__content
|
|
14
|
-
.c-page-sub__title-page
|
|
15
|
-
include /component/c-title-page.pug
|
|
16
|
-
.c-page-sub__nav-breadcrumb
|
|
17
|
-
include /component/c-nav-breadcrumb.pug
|
|
18
|
-
.c-page-sub__content-main
|
|
19
|
-
.c-content-main !{ blocks }
|
|
20
|
-
.c-page-sub__nav-sitemap
|
|
21
|
-
include /component/c-nav-sitemap.pug
|
|
22
|
-
.c-page-sub__footer
|
|
23
|
-
include /component/c-footer.pug
|
|
1
|
+
.c-content-main !{ blocks }
|
|
@@ -1,40 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.c-page-sub__title-page
|
|
16
|
-
include /component/c-title-page.pug
|
|
17
|
-
.c-page-sub__nav-breadcrumb
|
|
18
|
-
include /component/c-nav-breadcrumb.pug
|
|
19
|
-
.c-page-sub__content-index
|
|
20
|
-
.c-content-index
|
|
21
|
-
.c-content-index__categories
|
|
22
|
-
// ⚠️ CMS要件:
|
|
23
|
-
// - ページがカテゴリーインデックスの場合は aria-current="page" を付加する
|
|
24
|
-
// - カテゴリーインデックスではなく、カテゴリーに属するページでは aria-current="page" は付加しない
|
|
25
|
-
ul
|
|
26
|
-
li: a(href="__PATH_TO__"): span ALL
|
|
27
|
-
li: a(href="__PATH_TO__" aria-current="page"): span カテゴリー1
|
|
28
|
-
li: a(href="__PATH_TO__"): span カテゴリー2
|
|
29
|
-
li: a(href="__PATH_TO__"): span カテゴリー3
|
|
30
|
-
.c-content-index__body
|
|
31
|
-
.c-media-list
|
|
32
|
-
each article in data.articles
|
|
33
|
-
include /component/c-media.pug
|
|
34
|
-
.c-page-sub__pagination
|
|
35
|
-
include /component/c-pagination.pug
|
|
36
|
-
|
|
37
|
-
.c-page-sub__nav-sitemap
|
|
38
|
-
include /component/c-nav-sitemap.pug
|
|
39
|
-
.c-page-sub__footer
|
|
40
|
-
include /component/c-footer.pug
|
|
1
|
+
.c-content-index
|
|
2
|
+
.c-content-index__categories
|
|
3
|
+
// ⚠️ CMS要件:
|
|
4
|
+
// - ページがカテゴリーインデックスの場合は aria-current="page" を付加する
|
|
5
|
+
// - カテゴリーインデックスではなく、カテゴリーに属するページでは aria-current="page" は付加しない
|
|
6
|
+
ul
|
|
7
|
+
li: a(href="__PATH_TO__"): span ALL
|
|
8
|
+
li: a(href="__PATH_TO__" aria-current="page"): span カテゴリー1
|
|
9
|
+
li: a(href="__PATH_TO__"): span カテゴリー2
|
|
10
|
+
li: a(href="__PATH_TO__"): span カテゴリー3
|
|
11
|
+
.c-content-index__body
|
|
12
|
+
.c-media-list
|
|
13
|
+
each article in data.articles
|
|
14
|
+
include /component/c-media.pug
|
|
@@ -1,40 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.c-page-sub__title-page
|
|
16
|
-
include /component/c-title-page.pug
|
|
17
|
-
.c-page-sub__nav-breadcrumb
|
|
18
|
-
include /component/c-nav-breadcrumb.pug
|
|
19
|
-
.c-page-sub__content-index
|
|
20
|
-
.c-content-index
|
|
21
|
-
.c-content-index__categories
|
|
22
|
-
// ⚠️ CMS要件:
|
|
23
|
-
// - ページがカテゴリーインデックスの場合は aria-current="page" を付加する
|
|
24
|
-
// - カテゴリーインデックスではなく、カテゴリーに属するページでは aria-current="page" は付加しない
|
|
25
|
-
ul
|
|
26
|
-
li: a(href="__PATH_TO__"): span ALL
|
|
27
|
-
li: a(href="__PATH_TO__" aria-current="page"): span カテゴリー1
|
|
28
|
-
li: a(href="__PATH_TO__"): span カテゴリー2
|
|
29
|
-
li: a(href="__PATH_TO__"): span カテゴリー3
|
|
30
|
-
.c-content-index__body
|
|
31
|
-
.c-card-list
|
|
32
|
-
each article in data.articles
|
|
33
|
-
include /component/c-card.pug
|
|
34
|
-
.c-page-sub__pagination
|
|
35
|
-
include /component/c-pagination.pug
|
|
36
|
-
|
|
37
|
-
.c-page-sub__nav-sitemap
|
|
38
|
-
include /component/c-nav-sitemap.pug
|
|
39
|
-
.c-page-sub__footer
|
|
40
|
-
include /component/c-footer.pug
|
|
1
|
+
.c-content-index
|
|
2
|
+
.c-content-index__categories
|
|
3
|
+
// ⚠️ CMS要件:
|
|
4
|
+
// - ページがカテゴリーインデックスの場合は aria-current="page" を付加する
|
|
5
|
+
// - カテゴリーインデックスではなく、カテゴリーに属するページでは aria-current="page" は付加しない
|
|
6
|
+
ul
|
|
7
|
+
li: a(href="__PATH_TO__"): span ALL
|
|
8
|
+
li: a(href="__PATH_TO__" aria-current="page"): span カテゴリー1
|
|
9
|
+
li: a(href="__PATH_TO__"): span カテゴリー2
|
|
10
|
+
li: a(href="__PATH_TO__"): span カテゴリー3
|
|
11
|
+
.c-content-index__body
|
|
12
|
+
.c-card-list
|
|
13
|
+
each article in data.articles
|
|
14
|
+
include /component/c-card.pug
|