ghostcn 1.2.0 → 1.4.0
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/README.md +182 -1
- package/dist/commands/add.d.ts +6 -1
- package/dist/commands/add.js +121 -83
- package/dist/commands/diff.d.ts +5 -0
- package/dist/commands/diff.js +54 -0
- package/dist/commands/playground.d.ts +3 -0
- package/dist/commands/playground.js +29 -0
- package/dist/index.js +16 -2
- package/dist/registry/components/alert.json +62 -0
- package/dist/registry/components/archive-header.json +57 -0
- package/dist/registry/components/author-card.json +23 -2
- package/dist/registry/components/author-list.json +55 -0
- package/dist/registry/components/badge.json +51 -0
- package/dist/registry/components/button.json +74 -0
- package/dist/registry/components/card.json +70 -0
- package/dist/registry/components/featured-posts.json +18 -1
- package/dist/registry/components/input.json +94 -0
- package/dist/registry/components/member-cta.json +15 -1
- package/dist/registry/components/newsletter-form.json +23 -2
- package/dist/registry/components/pagination.json +12 -1
- package/dist/registry/components/post-card.json +25 -2
- package/dist/registry/components/post-grid.json +54 -0
- package/dist/registry/components/post-header.json +18 -1
- package/dist/registry/components/post-navigation.json +41 -0
- package/dist/registry/components/pricing-table.json +31 -2
- package/dist/registry/components/related-posts.json +53 -0
- package/dist/registry/components/site-footer.json +15 -1
- package/dist/registry/components/site-header.json +16 -1
- package/dist/registry/components/table-of-contents.json +47 -0
- package/dist/registry/components/tag-grid.json +64 -0
- package/dist/registry/components/tag-list.json +38 -0
- package/dist/registry/index.json +131 -0
- package/dist/templates/playground/index.html +5 -0
- package/dist/templates/playground/playground.css +18 -0
- package/dist/templates/playground/playground.js +71 -0
- package/dist/templates/playground/preview.css +5 -0
- package/dist/templates/playground/preview.js +12 -0
- package/dist/templates/theme-tools.mjs +1 -1
- package/dist/utils/component-diff.d.ts +18 -0
- package/dist/utils/component-diff.js +93 -0
- package/dist/utils/component-files.d.ts +9 -0
- package/dist/utils/component-files.js +48 -0
- package/dist/utils/component-history.d.ts +11 -0
- package/dist/utils/component-history.js +47 -0
- package/dist/utils/component-installer.d.ts +2 -0
- package/dist/utils/component-installer.js +34 -37
- package/dist/utils/component-plan.d.ts +7 -0
- package/dist/utils/component-plan.js +43 -0
- package/dist/utils/playground-server.d.ts +9 -0
- package/dist/utils/playground-server.js +189 -0
- package/dist/utils/preview-renderer.d.ts +143 -0
- package/dist/utils/preview-renderer.js +70 -0
- package/dist/utils/registry.d.ts +7 -0
- package/dist/utils/registry.js +12 -18
- package/dist/utils/theme-files.d.ts +2 -0
- package/dist/utils/theme-files.js +41 -3
- package/dist/utils/theme-scaffold.js +12 -0
- package/package.json +2 -2
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "newsletter-form.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/newsletter-form.hbs",
|
|
12
|
-
"content": "{{!--\n Component: Newsletter Form\n Usage: {{> \"components/newsletter-form\" title=\"Subscribe to our newsletter\" description=\"Get the latest posts delivered right to your inbox.\"}}\n--}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n{{#unless @member}}\n<section class=\"gh-newsletter-form
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, descriptionClass, formClass, inputClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!--\n Component: Newsletter Form\n Usage: {{> \"components/newsletter-form\" title=\"Subscribe to our newsletter\" description=\"Get the latest posts delivered right to your inbox.\"}}\n--}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n{{#unless @member}}\n<section class=\"gh-newsletter-form{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\">\n <div class=\"gh-newsletter-heading\">\n <h3 class=\"gh-newsletter-title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">\n {{#if title}}{{title}}{{else}}Subscribe to our newsletter{{/if}}\n </h3>\n <p class=\"gh-newsletter-desc{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">\n {{#if description}}{{description}}{{else}}Get the latest stories, news, and perspectives delivered directly to your inbox.{{/if}}\n </p>\n </div>\n\n {{!-- Ghost native members form handling --}}\n {{#if @site.portal_signup_checkbox_required}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{else}}\n <form data-members-form=\"subscribe\" class=\"gh-newsletter-fields{{#if ghostcnStyles.formClass}} {{ghostcnStyles.formClass}}{{/if}}\">\n <input\n data-members-email\n type=\"email\"\n aria-label=\"Email address\"\n autocomplete=\"email\"\n required\n placeholder=\"jamie@example.com\"\n class=\"gh-newsletter-input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\"\n />\n <button type=\"submit\" class=\"gh-newsletter-btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\">\n <span class=\"button-text\">Subscribe</span>\n </button>\n\n {{!-- Ghost automatic states (hidden by default, shown via Ghost Portal JS) --}}\n <div class=\"gh-newsletter-msg-success message-success\" role=\"status\" data-members-success>\n ✓ Check your inbox to confirm your subscription!\n </div>\n <div class=\"gh-newsletter-msg-error message-error\" role=\"alert\" data-members-error>\n ✕ Please enter a valid email address.\n </div>\n </form>\n {{/if}}\n</section>\n{{/unless}}\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "newsletter-form.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/newsletter-form.css",
|
|
18
|
-
"content": "/* ghostcn: Newsletter Form Styles */\n.gh-newsletter-form {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 2em;\n text-align: center;\n max-width: 42em;\n margin: 2em auto;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-newsletter-form *,\n.gh-newsletter-form *::before,\n.gh-newsletter-form *::after {\n box-sizing: border-box;\n}\n\n.gh-newsletter-title {\n font-size: 1.5em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin-bottom: 0.5em;\n color: var(--foreground, #09090b);\n}\n\n.gh-newsletter-desc {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0 auto 1.5em;\n max-width: 28em;\n}\n\n.gh-newsletter-fields {\n display: flex;\n flex-direction: column;\n gap: 0.75em;\n max-width: 28em;\n margin: 0 auto;\n position: relative;\n}\n\n@media (min-width: 640px) {\n .gh-newsletter-fields {\n flex-direction: row;\n }\n}\n\n.gh-newsletter-input {\n flex: 1;\n padding: 0.625em 1em;\n background-color: var(--background, #ffffff);\n color: var(--foreground, #09090b);\n border: 1px solid var(--input, #e4e4e7);\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n outline: none;\n transition: box-shadow 0.15s ease, border-color 0.15s ease;\n}\n\n.gh-newsletter-input:focus {\n border-color: var(--ring, #18181b);\n box-shadow: 0 0 0 2px var(--ring, #18181b);\n}\n\n.gh-newsletter-btn {\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n padding: 0.625em 1.5em;\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n font-weight: 500;\n border: none;\n cursor: pointer;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition: opacity 0.15s ease;\n}\n\n.gh-newsletter-btn:hover {\n opacity: 0.9;\n}\n\n.gh-newsletter-msg-success,\n.gh-newsletter-msg-error {\n display: none;\n position: absolute;\n bottom: -1.75em;\n left: 0;\n right: 0;\n font-size: 0.75em;\n font-weight: 500;\n}\n\n.gh-newsletter-fields.success .gh-newsletter-msg-success,\n.gh-newsletter-fields.error .gh-newsletter-msg-error {\n display: block;\n}\n\n.gh-newsletter-form .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.gh-newsletter-msg-success {\n color: #16a34a;\n}\n\n.gh-newsletter-msg-error {\n color: #dc2626;\n}\n"
|
|
18
|
+
"content": "/* ghostcn: Newsletter Form Styles */\n.gh-newsletter-form {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 2em;\n text-align: center;\n max-width: 42em;\n margin: 2em auto;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-newsletter-form *,\n.gh-newsletter-form *::before,\n.gh-newsletter-form *::after {\n box-sizing: border-box;\n}\n\n.gh-newsletter-heading { margin-bottom: 1.5em; }\n\n.gh-newsletter-title {\n font-size: 1.5em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin-bottom: 0.5em;\n color: var(--foreground, #09090b);\n}\n\n.gh-newsletter-desc {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0 auto 1.5em;\n max-width: 28em;\n}\n\n.gh-newsletter-fields {\n display: flex;\n flex-direction: column;\n gap: 0.75em;\n max-width: 28em;\n margin: 0 auto;\n position: relative;\n}\n\n@media (min-width: 640px) {\n .gh-newsletter-fields {\n flex-direction: row;\n }\n}\n\n.gh-newsletter-input {\n flex: 1;\n padding: 0.625em 1em;\n background-color: var(--background, #ffffff);\n color: var(--foreground, #09090b);\n border: 1px solid var(--input, #e4e4e7);\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n outline: none;\n transition: box-shadow 0.15s ease, border-color 0.15s ease;\n}\n\n.gh-newsletter-input:focus {\n border-color: var(--ring, #18181b);\n box-shadow: 0 0 0 2px var(--ring, #18181b);\n}\n\n.gh-newsletter-btn {\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n padding: 0.625em 1.5em;\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n font-weight: 500;\n border: none;\n cursor: pointer;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition: opacity 0.15s ease;\n}\n\n.gh-newsletter-btn:hover {\n opacity: 0.9;\n}\n\n.gh-newsletter-msg-success,\n.gh-newsletter-msg-error {\n display: none;\n position: absolute;\n bottom: -1.75em;\n left: 0;\n right: 0;\n font-size: 0.75em;\n font-weight: 500;\n}\n\n.gh-newsletter-fields.success .gh-newsletter-msg-success,\n.gh-newsletter-fields.error .gh-newsletter-msg-error {\n display: block;\n}\n\n.gh-newsletter-form .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.gh-newsletter-msg-success {\n color: #16a34a;\n}\n\n.gh-newsletter-msg-error {\n color: #dc2626;\n}\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -24,5 +24,26 @@
|
|
|
24
24
|
"GS050-MEMBERS-FORM"
|
|
25
25
|
],
|
|
26
26
|
"notes": "Uses Ghost's native data-members-form attributes. No custom JS required."
|
|
27
|
+
},
|
|
28
|
+
"styleSlots": {
|
|
29
|
+
"class": [
|
|
30
|
+
".gh-newsletter-form"
|
|
31
|
+
],
|
|
32
|
+
"titleClass": [
|
|
33
|
+
".gh-newsletter-title"
|
|
34
|
+
],
|
|
35
|
+
"descriptionClass": [
|
|
36
|
+
".gh-newsletter-desc"
|
|
37
|
+
],
|
|
38
|
+
"formClass": [
|
|
39
|
+
".gh-newsletter-fields"
|
|
40
|
+
],
|
|
41
|
+
"inputClass": [
|
|
42
|
+
".gh-newsletter-input"
|
|
43
|
+
],
|
|
44
|
+
"buttonClass": [
|
|
45
|
+
".gh-newsletter-btn",
|
|
46
|
+
".ghcn-button"
|
|
47
|
+
]
|
|
27
48
|
}
|
|
28
49
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/pagination.hbs",
|
|
12
12
|
"placement": "theme",
|
|
13
|
-
"content": "<nav class=\"ghcn-pagination\" role=\"navigation\" aria-label=\"Pagination\">\n <div class=\"ghcn-pagination__side\">{{#if prev}}<a class=\"ghcn-button ghcn-button--outline\" href=\"{{page_url prev}}\" rel=\"prev\"><span aria-hidden=\"true\">←</span> Newer</a>{{/if}}</div>\n <span class=\"ghcn-pagination__status\">Page <strong>{{page}}</strong> of <strong>{{pages}}</strong></span>\n <div class=\"ghcn-pagination__side ghcn-pagination__side--end\">{{#if next}}<a class=\"ghcn-button ghcn-button--outline\" href=\"{{page_url next}}\" rel=\"next\">Older <span aria-hidden=\"true\">→</span></a>{{/if}}</div>\n</nav
|
|
13
|
+
"content": "{{!-- Styling parameters: class, buttonClass, statusClass --}}\n{{#with this as |ghostcnStyles|}}\n<nav class=\"ghcn-pagination{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" role=\"navigation\" aria-label=\"Pagination\">\n <div class=\"ghcn-pagination__side\">{{#if prev}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"{{page_url prev}}\" rel=\"prev\"><span aria-hidden=\"true\">←</span> Newer</a>{{/if}}</div>\n <span class=\"ghcn-pagination__status{{#if ghostcnStyles.statusClass}} {{ghostcnStyles.statusClass}}{{/if}}\">Page <strong>{{page}}</strong> of <strong>{{pages}}</strong></span>\n <div class=\"ghcn-pagination__side ghcn-pagination__side--end\">{{#if next}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"{{page_url next}}\" rel=\"next\">Older <span aria-hidden=\"true\">→</span></a>{{/if}}</div>\n</nav>\n{{/with}}"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "pagination.css",
|
|
@@ -24,5 +24,16 @@
|
|
|
24
24
|
"GS010-PJ-VALID"
|
|
25
25
|
],
|
|
26
26
|
"notes": "Installs as partials/pagination.hbs so the native pagination helper uses it."
|
|
27
|
+
},
|
|
28
|
+
"styleSlots": {
|
|
29
|
+
"class": [
|
|
30
|
+
".ghcn-pagination"
|
|
31
|
+
],
|
|
32
|
+
"buttonClass": [
|
|
33
|
+
".ghcn-button"
|
|
34
|
+
],
|
|
35
|
+
"statusClass": [
|
|
36
|
+
".ghcn-pagination__status"
|
|
37
|
+
]
|
|
27
38
|
}
|
|
28
39
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "post-card.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/post-card.hbs",
|
|
12
|
-
"content": "{{!--\n Component: Post Card\n Usage: Inside {{#foreach posts}} ... {{> \"components/post-card\"}} ... {{/foreach}}\n--}}\n<article class=\"gh-post-card
|
|
12
|
+
"content": "{{!-- Styling parameters: class, imageClass, contentClass, titleClass, descriptionClass, metaClass, footerClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!--\n Component: Post Card\n Usage: Inside {{#foreach posts}} ... {{> \"components/post-card\"}} ... {{/foreach}}\n--}}\n<article class=\"gh-post-card{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}} group\">\n {{#if feature_image}}\n <a href=\"{{url}}\" class=\"gh-post-card-image\">\n <img src=\"{{img_url feature_image size=\"m\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" class=\"gh-post-card-img{{#if ghostcnStyles.imageClass}} {{ghostcnStyles.imageClass}}{{/if}}\" loading=\"lazy\" />\n </a>\n {{/if}}\n\n <div class=\"gh-post-card-content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\">\n <div>\n <div class=\"gh-post-card-meta{{#if ghostcnStyles.metaClass}} {{ghostcnStyles.metaClass}}{{/if}}\">\n {{#if primary_tag}}\n <a href=\"{{primary_tag.url}}\" class=\"gh-post-card-tag\">{{primary_tag.name}}</a>\n <span class=\"gh-post-card-separator\">•</span>\n {{/if}}\n <span class=\"gh-post-card-reading-time\">{{reading_time}}</span>\n </div>\n\n <h3 class=\"gh-post-card-title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">\n <a href=\"{{url}}\">{{title}}</a>\n </h3>\n\n {{#if excerpt}}\n <p class=\"gh-post-card-excerpt{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{excerpt words=\"25\"}}</p>\n {{/if}}\n </div>\n\n <div class=\"gh-post-card-footer{{#if ghostcnStyles.footerClass}} {{ghostcnStyles.footerClass}}{{/if}}\">\n <div class=\"gh-post-card-author\">\n {{#primary_author}}\n <span>{{name}}</span>\n {{/primary_author}}\n </div>\n <time datetime=\"{{date format=\"YYYY-MM-DD\"}}\">{{date format=\"D MMM YYYY\"}}</time>\n </div>\n </div>\n</article>\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "post-card.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/post-card.css",
|
|
18
|
-
"content": "/* ghostcn: Post Card Styles */\n.gh-post-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-post-card *,\n.gh-post-card *::before,\n.gh-post-card *::after {\n box-sizing: border-box;\n}\n\n.gh-post-card:hover {\n transform: translateY(-2px);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.gh-post-card-image {\n aspect-ratio: 16 / 9;\n overflow: hidden;\n display: block;\n background-color: var(--muted, #f4f4f5);\n}\n\n.gh-post-card-image img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: transform 0.3s ease;\n}\n\n.gh-post-card:hover .gh-post-card-image img {\n transform: scale(1.03);\n}\n\n.gh-post-card-content {\n padding: 1.25em;\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.gh-post-card-tag {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n font-size: 0.75em;\n font-weight: 600;\n text-decoration: none;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n.gh-post-card-tag:hover {\n text-decoration: underline;\n}\n\n.gh-post-card-title {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0.5em 0;\n line-height: 1.35;\n}\n\n.gh-post-card-title a {\n color:
|
|
18
|
+
"content": "/* ghostcn: Post Card Styles */\n.gh-post-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-post-card *,\n.gh-post-card *::before,\n.gh-post-card *::after {\n box-sizing: border-box;\n}\n\n.gh-post-card:hover {\n transform: translateY(-2px);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.gh-post-card-image {\n aspect-ratio: 16 / 9;\n overflow: hidden;\n display: block;\n background-color: var(--muted, #f4f4f5);\n}\n\n.gh-post-card-image img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: transform 0.3s ease;\n}\n\n.gh-post-card:hover .gh-post-card-image img {\n transform: scale(1.03);\n}\n\n.gh-post-card-content {\n padding: 1.25em;\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.gh-post-card-tag {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n font-size: 0.75em;\n font-weight: 600;\n text-decoration: none;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n.gh-post-card-tag:hover {\n text-decoration: underline;\n}\n\n.gh-post-card-title {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0.5em 0;\n line-height: 1.35;\n color: var(--foreground, #09090b);\n}\n\n.gh-post-card-title a {\n color: inherit;\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-post-card-title:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-post-card-excerpt {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 3;\n overflow: hidden;\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin-bottom: 1em;\n}\n\n.gh-post-card-footer {\n padding-top: 1em;\n border-top: 1px solid var(--border, #e4e4e7);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-post-card-meta { display: flex; align-items: center; gap: 0.5em; margin-bottom: 0.5em; font-size: 0.75em; font-weight: 600; }\n.gh-post-card-reading-time { color: var(--muted-foreground); }\n.gh-post-card-separator { color: color-mix(in srgb, var(--muted-foreground) 40%, transparent); }\n.gh-post-card-author { display: flex; align-items: center; gap: 0.5em; font-weight: 500; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -23,5 +23,28 @@
|
|
|
23
23
|
"GS010-PJ-VALID"
|
|
24
24
|
],
|
|
25
25
|
"notes": "Uses standard Ghost post helpers (feature_image, primary_tag, reading_time, excerpt, date)."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".gh-post-card"
|
|
30
|
+
],
|
|
31
|
+
"imageClass": [
|
|
32
|
+
".gh-post-card-img"
|
|
33
|
+
],
|
|
34
|
+
"contentClass": [
|
|
35
|
+
".gh-post-card-content"
|
|
36
|
+
],
|
|
37
|
+
"titleClass": [
|
|
38
|
+
".gh-post-card-title"
|
|
39
|
+
],
|
|
40
|
+
"descriptionClass": [
|
|
41
|
+
".gh-post-card-excerpt"
|
|
42
|
+
],
|
|
43
|
+
"metaClass": [
|
|
44
|
+
".gh-post-card-meta"
|
|
45
|
+
],
|
|
46
|
+
"footerClass": [
|
|
47
|
+
".gh-post-card-footer"
|
|
48
|
+
]
|
|
26
49
|
}
|
|
27
50
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "post-grid",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "A responsive grid using post-card; pass posts from a loop, archive or get query.",
|
|
5
|
+
"dependencies": [
|
|
6
|
+
"post-card"
|
|
7
|
+
],
|
|
8
|
+
"ghost_version": ">=5.0.0",
|
|
9
|
+
"parameters": {
|
|
10
|
+
"heading": {
|
|
11
|
+
"description": "Optional section heading."
|
|
12
|
+
},
|
|
13
|
+
"emptyText": {
|
|
14
|
+
"description": "Optional message when no content is available; otherwise render nothing."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"name": "post-grid.hbs",
|
|
20
|
+
"type": "partial",
|
|
21
|
+
"target": "partials/components/post-grid.hbs",
|
|
22
|
+
"content": "{{!-- Styling parameters: class, titleClass, gridClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#if posts}}\n<section class=\"ghcn-post-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Posts\">\n {{#if heading}}<h2 class=\"ghcn-post-grid__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{heading}}</h2>{{/if}}\n <div class=\"ghcn-post-grid__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">{{#foreach posts}}\n {{> \"components/post-card\" class=ghostcnStyles.cardClass titleClass=ghostcnStyles.cardTitleClass imageClass=ghostcnStyles.imageClass descriptionClass=ghostcnStyles.descriptionClass}}\n {{/foreach}}</div>\n</section>\n{{else}}{{#if emptyText}}<section class=\"ghcn-post-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"><p class=\"ghcn-post-grid__empty\">{{emptyText}}</p></section>{{/if}}{{/if}}\n{{/with}}"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "post-grid.css",
|
|
26
|
+
"type": "style",
|
|
27
|
+
"target": "assets/css/components/post-grid.css",
|
|
28
|
+
"content": ".ghcn-post-grid { font-size: 16px; color: var(--foreground); margin-block: 2em; }\n.ghcn-post-grid__title { font-size: 1.5em; line-height: 1.25; margin: 0 0 1em; }\n.ghcn-post-grid__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5em; }\n.ghcn-post-grid__grid > * { min-width: 0; }\n.ghcn-post-grid__empty { color: var(--muted-foreground); }\n@media(max-width:900px) { .ghcn-post-grid__grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }\n@media(max-width:620px) { .ghcn-post-grid__grid { grid-template-columns: 1fr; } }"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"styleSlots": {
|
|
32
|
+
"class": [
|
|
33
|
+
".ghcn-post-grid"
|
|
34
|
+
],
|
|
35
|
+
"titleClass": [
|
|
36
|
+
".ghcn-post-grid__title"
|
|
37
|
+
],
|
|
38
|
+
"gridClass": [
|
|
39
|
+
".ghcn-post-grid__grid"
|
|
40
|
+
],
|
|
41
|
+
"cardClass": [
|
|
42
|
+
".gh-post-card"
|
|
43
|
+
],
|
|
44
|
+
"cardTitleClass": [
|
|
45
|
+
".gh-post-card-title"
|
|
46
|
+
],
|
|
47
|
+
"imageClass": [
|
|
48
|
+
".gh-post-card-img"
|
|
49
|
+
],
|
|
50
|
+
"descriptionClass": [
|
|
51
|
+
".gh-post-card-excerpt"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "post-header.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/post-header.hbs",
|
|
12
|
-
"content": "{{!-- Component: Post Header | Usage: inside {{#post}} --}}\n<header class=\"ghcn-post-header ghcn-container\">\n {{#if primary_tag}}<a class=\"ghcn-badge\" href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a>{{/if}}\n <h1>{{title}}</h1>\n {{#if custom_excerpt}}<p class=\"ghcn-post-header__excerpt\">{{custom_excerpt}}</p>{{/if}}\n <div class=\"ghcn-post-header__meta\">\n {{#primary_author}}\n <a class=\"ghcn-post-header__author\" href=\"{{url}}\">\n {{#if profile_image}}<img class=\"ghcn-avatar\" src=\"{{img_url profile_image size=\"xs\"}}\" alt=\"\" />{{/if}}\n <span>{{name}}</span>\n </a>\n {{/primary_author}}\n <span aria-hidden=\"true\">•</span>\n <time datetime=\"{{date format=\"YYYY-MM-DD\"}}\">{{date format=\"D MMM YYYY\"}}</time>\n <span aria-hidden=\"true\">•</span>\n <span>{{reading_time}}</span>\n </div>\n {{#if feature_image}}\n <figure class=\"ghcn-post-header__media\">\n <img srcset=\"{{img_url feature_image size=\"s\"}} 400w, {{img_url feature_image size=\"m\"}} 750w, {{img_url feature_image size=\"l\"}} 1200w, {{img_url feature_image size=\"xl\"}} 2000w\" sizes=\"(min-width: 1200px) 1120px, 92vw\" src=\"{{img_url feature_image size=\"xl\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" />\n {{#if feature_image_caption}}<figcaption>{{feature_image_caption}}</figcaption>{{/if}}\n </figure>\n {{/if}}\n</header
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, descriptionClass, metaClass, imageClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Post Header | Usage: inside {{#post}} --}}\n<header class=\"ghcn-post-header{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}} ghcn-container\">\n {{#if primary_tag}}<a class=\"ghcn-badge\" href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a>{{/if}}\n <h1 class=\"ghcn-post-header__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{title}}</h1>\n {{#if custom_excerpt}}<p class=\"ghcn-post-header__excerpt{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{custom_excerpt}}</p>{{/if}}\n <div class=\"ghcn-post-header__meta{{#if ghostcnStyles.metaClass}} {{ghostcnStyles.metaClass}}{{/if}}\">\n {{#primary_author}}\n <a class=\"ghcn-post-header__author\" href=\"{{url}}\">\n {{#if profile_image}}<img class=\"ghcn-avatar\" src=\"{{img_url profile_image size=\"xs\"}}\" alt=\"\" />{{/if}}\n <span>{{name}}</span>\n </a>\n {{/primary_author}}\n <span aria-hidden=\"true\">•</span>\n <time datetime=\"{{date format=\"YYYY-MM-DD\"}}\">{{date format=\"D MMM YYYY\"}}</time>\n <span aria-hidden=\"true\">•</span>\n <span>{{reading_time}}</span>\n </div>\n {{#if feature_image}}\n <figure class=\"ghcn-post-header__media\">\n <img class=\"ghcn-post-header__image{{#if ghostcnStyles.imageClass}} {{ghostcnStyles.imageClass}}{{/if}}\" srcset=\"{{img_url feature_image size=\"s\"}} 400w, {{img_url feature_image size=\"m\"}} 750w, {{img_url feature_image size=\"l\"}} 1200w, {{img_url feature_image size=\"xl\"}} 2000w\" sizes=\"(min-width: 1200px) 1120px, 92vw\" src=\"{{img_url feature_image size=\"xl\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" />\n {{#if feature_image_caption}}<figcaption>{{feature_image_caption}}</figcaption>{{/if}}\n </figure>\n {{/if}}\n</header>\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "post-header.css",
|
|
@@ -23,5 +23,22 @@
|
|
|
23
23
|
"GS010-PJ-VALID"
|
|
24
24
|
],
|
|
25
25
|
"notes": "Uses native post, author, image, tag, date, and reading-time data."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".ghcn-post-header"
|
|
30
|
+
],
|
|
31
|
+
"titleClass": [
|
|
32
|
+
".ghcn-post-header__title"
|
|
33
|
+
],
|
|
34
|
+
"descriptionClass": [
|
|
35
|
+
".ghcn-post-header__excerpt"
|
|
36
|
+
],
|
|
37
|
+
"metaClass": [
|
|
38
|
+
".ghcn-post-header__meta"
|
|
39
|
+
],
|
|
40
|
+
"imageClass": [
|
|
41
|
+
".ghcn-post-header__image"
|
|
42
|
+
]
|
|
26
43
|
}
|
|
27
44
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "post-navigation",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Accessible chronological previous/next post links, with no dead links at either end.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "post-navigation.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/post-navigation.hbs",
|
|
12
|
+
"content": "{{!-- Styling parameters: class, cardClass, titleClass, labelClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Use inside {{#post}}. Native helpers hide missing neighbors. --}}\n<nav class=\"ghcn-post-navigation{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Post navigation\">{{~#prev_post~}}<a class=\"ghcn-post-navigation__link{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\" href=\"{{url}}\" rel=\"prev\"><span class=\"ghcn-post-navigation__label{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">Previous post</span><span class=\"ghcn-post-navigation__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{title}}</span></a>{{~/prev_post~}}{{~#next_post~}}<a class=\"ghcn-post-navigation__link{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}} ghcn-post-navigation__link--next\" href=\"{{url}}\" rel=\"next\"><span class=\"ghcn-post-navigation__label{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">Next post</span><span class=\"ghcn-post-navigation__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{title}}</span></a>{{~/next_post~}}</nav>\n{{/with}}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "post-navigation.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/post-navigation.css",
|
|
18
|
+
"content": "\n.ghcn-post-navigation { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1em; margin-block: 2em; }\n.ghcn-post-navigation:empty { display: none; }\n.ghcn-post-navigation__link { min-width: 0; display: flex; flex-direction: column; gap: .5em; padding: 1.25em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--card-foreground); text-decoration: none; }\n.ghcn-post-navigation__link--next { grid-column: 2; text-align: right; }\n.ghcn-post-navigation__label { font-size: .75em; color: var(--muted-foreground); }\n.ghcn-post-navigation__title { font-weight: 600; overflow-wrap: anywhere; }\n.ghcn-post-navigation__link:hover .ghcn-post-navigation__title { text-decoration: underline; }\n.ghcn-post-navigation__link:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n@media(max-width:620px) { .ghcn-post-navigation { grid-template-columns: 1fr; } .ghcn-post-navigation__link--next { grid-column: 1; } }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses native Ghost post data and optional progressive enhancement."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".ghcn-post-navigation"
|
|
30
|
+
],
|
|
31
|
+
"cardClass": [
|
|
32
|
+
".ghcn-post-navigation__link"
|
|
33
|
+
],
|
|
34
|
+
"titleClass": [
|
|
35
|
+
".ghcn-post-navigation__title"
|
|
36
|
+
],
|
|
37
|
+
"labelClass": [
|
|
38
|
+
".ghcn-post-navigation__label"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "pricing-table.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/pricing-table.hbs",
|
|
12
|
-
"content": "{{!-- Component: Pricing Table | Usage: {{> \"components/pricing-table\"}} --}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n<section class=\"gh-pricing\" aria-label=\"Membership plans\">\n <h2 class=\"gh-pricing-title\">{{#if title}}{{title}}{{else}}Choose your membership{{/if}}</h2>\n <div class=\"gh-pricing-grid\">\n {{#get \"tiers\" filter=\"visibility:public+active:true\" include=\"monthly_price,yearly_price,benefits\"}}\n {{#foreach tiers}}\n {{#match type \"free\"}}\n <article class=\"gh-pricing-card\">\n <h3>{{name}}</h3>\n {{#if description}}<p>{{description}}</p>{{/if}}\n <p class=\"gh-pricing-price\">Free</p>\n {{#if benefits}}<ul>{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>{{/if}}\n {{#if @member}}<a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Manage account</a>\n {{else}}<a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/signup/free\" data-portal=\"signup/free\">Join free</a>{{/if}}\n </article>\n {{else}}\n {{#if @site.paid_members_enabled}}\n <article class=\"gh-pricing-card\">\n <h3>{{name}}</h3>\n {{#if description}}<p>{{description}}</p>{{/if}}\n {{#if benefits}}<ul>{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>{{/if}}\n {{#if monthly_price}}<p class=\"gh-pricing-price\">{{price monthly_price currency=currency}} <span>/ month</span></p>{{/if}}\n {{#if yearly_price}}<p class=\"gh-pricing-price\">{{price yearly_price currency=currency}} <span>/ year</span></p>{{/if}}\n <div class=\"gh-pricing-actions\">\n {{#if @member}}\n <a class=\"ghcn-button\" href=\"#/portal/account/plans\" data-portal=\"account/plans\">{{#if @member.paid}}Manage plan{{else}}Upgrade membership{{/if}}</a>\n {{else}}\n {{#if monthly_price}}<a class=\"ghcn-button\" href=\"#/portal/signup/{{id}}/monthly\" data-portal=\"signup/{{id}}/monthly\">Subscribe monthly</a>{{/if}}\n {{#if yearly_price}}<a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\">Subscribe yearly</a>{{/if}}\n {{/if}}\n </div>\n </article>\n {{/if}}\n {{/match}}\n {{/foreach}}\n {{else}}\n <p>Membership plans are currently unavailable.</p>\n {{/get}}\n </div>\n</section>\n{{/if}}\n{{/unless}}\n{{/if}}"
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, buttonClass, cardTitleClass, descriptionClass, priceClass, benefitsClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Pricing Table | Usage: {{> \"components/pricing-table\"}} --}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n<section class=\"gh-pricing{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Membership plans\">\n <h2 class=\"gh-pricing-title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if title}}{{title}}{{else}}Choose your membership{{/if}}</h2>\n <div class=\"gh-pricing-grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#get \"tiers\" filter=\"visibility:public+active:true\" include=\"monthly_price,yearly_price,benefits\"}}\n {{#foreach tiers}}\n {{#match type \"free\"}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\">\n <h3 class=\"gh-pricing-card-title{{#if ghostcnStyles.cardTitleClass}} {{ghostcnStyles.cardTitleClass}}{{/if}}\">{{name}}</h3>\n {{#if description}}<p class=\"gh-pricing-description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{description}}</p>{{/if}}\n <p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">Free</p>\n {{#if benefits}}<ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>{{/if}}\n {{#if @member}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Manage account</a>\n {{else}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/signup/free\" data-portal=\"signup/free\">Join free</a>{{/if}}\n </article>\n {{else}}\n {{#if @site.paid_members_enabled}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\">\n <h3 class=\"gh-pricing-card-title{{#if ghostcnStyles.cardTitleClass}} {{ghostcnStyles.cardTitleClass}}{{/if}}\">{{name}}</h3>\n {{#if description}}<p class=\"gh-pricing-description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{description}}</p>{{/if}}\n {{#if benefits}}<ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>{{/if}}\n {{#if monthly_price}}<p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">{{price monthly_price currency=currency}} <span>/ month</span></p>{{/if}}\n {{#if yearly_price}}<p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">{{price yearly_price currency=currency}} <span>/ year</span></p>{{/if}}\n <div class=\"gh-pricing-actions\">\n {{#if @member}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/account/plans\" data-portal=\"account/plans\">{{#if @member.paid}}Manage plan{{else}}Upgrade membership{{/if}}</a>\n {{else}}\n {{#if monthly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup/{{id}}/monthly\" data-portal=\"signup/{{id}}/monthly\">Subscribe monthly</a>{{/if}}\n {{#if yearly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\">Subscribe yearly</a>{{/if}}\n {{/if}}\n </div>\n </article>\n {{/if}}\n {{/match}}\n {{/foreach}}\n {{else}}\n <p>Membership plans are currently unavailable.</p>\n {{/get}}\n </div>\n</section>\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "pricing-table.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/pricing-table.css",
|
|
18
|
-
"content": "/* ghostcn: live membership pricing */\n.gh-pricing { box-sizing: border-box; width: min(100% - 2em, 72em); margin: 3em auto; color: var(--foreground); font-size: 16px; line-height: 1.5; }\n.gh-pricing *, .gh-pricing *::before, .gh-pricing *::after { box-sizing: border-box; }\n.gh-pricing-title { margin: 0 0 1.5em; text-align: center; font-size: 2em; }\n.gh-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr)); gap: 1.25em; }\n.gh-pricing-card { display: flex; flex-direction: column; gap: 1em; padding: 1.5em; border: 1px solid var(--border); border-radius: min(var(--radius), 1.5em); background: var(--card); color: var(--card-foreground); }\n.gh-pricing-card
|
|
18
|
+
"content": "/* ghostcn: live membership pricing */\n.gh-pricing { box-sizing: border-box; width: min(100% - 2em, 72em); margin: 3em auto; color: var(--foreground); font-size: 16px; line-height: 1.5; }\n.gh-pricing *, .gh-pricing *::before, .gh-pricing *::after { box-sizing: border-box; }\n.gh-pricing-title { margin: 0 0 1.5em; text-align: center; font-size: 2em; }\n.gh-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr)); gap: 1.25em; }\n.gh-pricing-card { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 1em; padding: 1.5em; border: 1px solid var(--border); border-radius: min(var(--radius), 1.5em); background: var(--card); color: var(--card-foreground); }\n/* Follow the card's local foreground, not the page's dark/light tokens.\n A custom background must be paired with a readable foreground at the call site. */\n.gh-pricing-card-title { margin: 0; font-size: 1.25em; color: inherit; }\n.gh-pricing-card p { margin: 0; }\n.gh-pricing-description { color: inherit; }\n.gh-pricing-benefits { margin: 0; padding-left: 1.25em; color: inherit; }\n.gh-pricing-benefits li { color: inherit; }\n.gh-pricing-price { font-size: 1.75em; font-weight: 700; color: inherit; }\n.gh-pricing-price span { font-size: 0.875em; font-weight: 400; color: inherit; }\n.gh-pricing-actions { display: flex; flex-wrap: wrap; gap: 0.5em; margin-top: auto; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -23,5 +23,34 @@
|
|
|
23
23
|
"GS010-PJ-VALID"
|
|
24
24
|
],
|
|
25
25
|
"notes": "Reads public Ghost tiers; no placeholder pricing or invented benefits."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".gh-pricing"
|
|
30
|
+
],
|
|
31
|
+
"titleClass": [
|
|
32
|
+
".gh-pricing-title"
|
|
33
|
+
],
|
|
34
|
+
"gridClass": [
|
|
35
|
+
".gh-pricing-grid"
|
|
36
|
+
],
|
|
37
|
+
"cardClass": [
|
|
38
|
+
".gh-pricing-card"
|
|
39
|
+
],
|
|
40
|
+
"buttonClass": [
|
|
41
|
+
".ghcn-button"
|
|
42
|
+
],
|
|
43
|
+
"cardTitleClass": [
|
|
44
|
+
".gh-pricing-card-title"
|
|
45
|
+
],
|
|
46
|
+
"descriptionClass": [
|
|
47
|
+
".gh-pricing-description"
|
|
48
|
+
],
|
|
49
|
+
"priceClass": [
|
|
50
|
+
".gh-pricing-price"
|
|
51
|
+
],
|
|
52
|
+
"benefitsClass": [
|
|
53
|
+
".gh-pricing-benefits"
|
|
54
|
+
]
|
|
26
55
|
}
|
|
27
56
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "related-posts",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Related reading from the same primary tag, excluding the current post; recent posts when untagged.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "related-posts.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/related-posts.hbs",
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, cardTitleClass, imageClass, contentClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Use inside {{#post}}. heading overrides the section title. Empty results render nothing. --}}\n{{#if primary_tag}}\n{{#get \"posts\" filter=\"id:-{{id}}+tag:{{primary_tag.slug}}\" limit=\"3\" include=\"tags,authors\"}}{{#if posts}}\n<section class=\"ghcn-related{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Related posts\">\n <h2 class=\"ghcn-related__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if ghostcnStyles.heading}}{{ghostcnStyles.heading}}{{else}}Keep reading{{/if}}</h2>\n <div class=\"ghcn-related__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#foreach posts}}\n <article class=\"ghcn-related__card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\">\n {{#if feature_image}}<a class=\"ghcn-related__image-link\" href=\"{{url}}\" tabindex=\"-1\" aria-hidden=\"true\"><img class=\"ghcn-related__image{{#if ghostcnStyles.imageClass}} {{ghostcnStyles.imageClass}}{{/if}}\" src=\"{{img_url feature_image size=\"m\"}}\" alt=\"\" loading=\"lazy\" /></a>{{/if}}\n <div class=\"ghcn-related__content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\"><h3 class=\"ghcn-related__card-title{{#if ghostcnStyles.cardTitleClass}} {{ghostcnStyles.cardTitleClass}}{{/if}}\"><a href=\"{{url}}\">{{title}}</a></h3><p class=\"ghcn-related__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{excerpt words=\"20\"}}</p></div>\n </article>\n {{/foreach}}\n </div>\n</section>\n{{/if}}{{/get}}\n{{else}}\n{{#get \"posts\" filter=\"id:-{{id}}\" limit=\"3\" include=\"tags,authors\"}}{{#if posts}}\n<section class=\"ghcn-related{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Related posts\">\n <h2 class=\"ghcn-related__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if ghostcnStyles.heading}}{{ghostcnStyles.heading}}{{else}}Keep reading{{/if}}</h2>\n <div class=\"ghcn-related__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#foreach posts}}\n <article class=\"ghcn-related__card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\">\n {{#if feature_image}}<a class=\"ghcn-related__image-link\" href=\"{{url}}\" tabindex=\"-1\" aria-hidden=\"true\"><img class=\"ghcn-related__image{{#if ghostcnStyles.imageClass}} {{ghostcnStyles.imageClass}}{{/if}}\" src=\"{{img_url feature_image size=\"m\"}}\" alt=\"\" loading=\"lazy\" /></a>{{/if}}\n <div class=\"ghcn-related__content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\"><h3 class=\"ghcn-related__card-title{{#if ghostcnStyles.cardTitleClass}} {{ghostcnStyles.cardTitleClass}}{{/if}}\"><a href=\"{{url}}\">{{title}}</a></h3><p class=\"ghcn-related__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{excerpt words=\"20\"}}</p></div>\n </article>\n {{/foreach}}\n </div>\n</section>\n{{/if}}{{/get}}\n{{/if}}\n{{/with}}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "related-posts.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/related-posts.css",
|
|
18
|
+
"content": "\n.ghcn-related { margin-block: 2em; color: var(--foreground); }\n.ghcn-related__title { margin: 0 0 1em; font-size: 1.5em; line-height: 1.2; }\n.ghcn-related__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1em; }\n.ghcn-related__card { min-width: 0; overflow: hidden; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); }\n.ghcn-related__image-link { display: block; aspect-ratio: 16/9; overflow: hidden; }\n.ghcn-related__image { display: block; width: 100%; height: 100%; object-fit: cover; }\n.ghcn-related__content { padding: 1.25em; }\n.ghcn-related__card-title { font-size: 1.125em; line-height: 1.3; margin: 0 0 .75em; }\n.ghcn-related__card-title a { color: inherit; text-decoration: none; }\n.ghcn-related__card-title a:hover { text-decoration: underline; }\n.ghcn-related__description { color: var(--muted-foreground); font-size: .875em; margin: 0; }\n.ghcn-related a:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n@media(max-width:760px) { .ghcn-related__grid { grid-template-columns: 1fr; } }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses native Ghost post data and optional progressive enhancement."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".ghcn-related"
|
|
30
|
+
],
|
|
31
|
+
"titleClass": [
|
|
32
|
+
".ghcn-related__title"
|
|
33
|
+
],
|
|
34
|
+
"gridClass": [
|
|
35
|
+
".ghcn-related__grid"
|
|
36
|
+
],
|
|
37
|
+
"cardClass": [
|
|
38
|
+
".ghcn-related__card"
|
|
39
|
+
],
|
|
40
|
+
"cardTitleClass": [
|
|
41
|
+
".ghcn-related__card-title"
|
|
42
|
+
],
|
|
43
|
+
"imageClass": [
|
|
44
|
+
".ghcn-related__image"
|
|
45
|
+
],
|
|
46
|
+
"contentClass": [
|
|
47
|
+
".ghcn-related__content"
|
|
48
|
+
],
|
|
49
|
+
"descriptionClass": [
|
|
50
|
+
".ghcn-related__description"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "site-footer.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/site-footer.hbs",
|
|
12
|
-
"content": "{{!-- Component: Site Footer | Usage: {{> \"components/site-footer\"}} --}}\n<footer class=\"ghcn-footer\">\n <div class=\"ghcn-footer__inner ghcn-container\">\n <div class=\"ghcn-footer__brand\">\n <a href=\"{{@site.url}}\">{{@site.title}}</a>\n {{#if @site.description}}<p>{{@site.description}}</p>{{/if}}\n </div>\n <nav class=\"ghcn-footer__nav\" aria-label=\"Footer navigation\">{{navigation type=\"secondary\"}}</nav>\n <div class=\"ghcn-footer__social\">\n {{#if @site.facebook}}<a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener\">Facebook</a>{{/if}}\n {{#if @site.twitter}}<a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener\">X</a>{{/if}}\n <a href=\"{{@site.url}}/rss/\">RSS</a>\n </div>\n </div>\n <div class=\"ghcn-footer__legal ghcn-container\">\n <span>© {{date format=\"YYYY\"}} {{@site.title}}</span>\n <span>Published with <a href=\"https://ghost.org\" target=\"_blank\" rel=\"noopener\">Ghost</a></span>\n </div>\n</footer
|
|
12
|
+
"content": "{{!-- Styling parameters: class, innerClass, navClass, socialClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Site Footer | Usage: {{> \"components/site-footer\"}} --}}\n<footer class=\"ghcn-footer{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\">\n <div class=\"ghcn-footer__inner{{#if ghostcnStyles.innerClass}} {{ghostcnStyles.innerClass}}{{/if}} ghcn-container\">\n <div class=\"ghcn-footer__brand\">\n <a href=\"{{@site.url}}\">{{@site.title}}</a>\n {{#if @site.description}}<p>{{@site.description}}</p>{{/if}}\n </div>\n <nav class=\"ghcn-footer__nav{{#if ghostcnStyles.navClass}} {{ghostcnStyles.navClass}}{{/if}}\" aria-label=\"Footer navigation\">{{navigation type=\"secondary\"}}</nav>\n <div class=\"ghcn-footer__social{{#if ghostcnStyles.socialClass}} {{ghostcnStyles.socialClass}}{{/if}}\">\n {{#if @site.facebook}}<a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener\">Facebook</a>{{/if}}\n {{#if @site.twitter}}<a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener\">X</a>{{/if}}\n <a href=\"{{@site.url}}/rss/\">RSS</a>\n </div>\n </div>\n <div class=\"ghcn-footer__legal ghcn-container\">\n <span>© {{date format=\"YYYY\"}} {{@site.title}}</span>\n <span>Published with <a href=\"https://ghost.org\" target=\"_blank\" rel=\"noopener\">Ghost</a></span>\n </div>\n</footer>\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "site-footer.css",
|
|
@@ -23,5 +23,19 @@
|
|
|
23
23
|
"GS010-PJ-VALID"
|
|
24
24
|
],
|
|
25
25
|
"notes": "Uses Ghost secondary navigation and site globals."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".ghcn-footer"
|
|
30
|
+
],
|
|
31
|
+
"innerClass": [
|
|
32
|
+
".ghcn-footer__inner"
|
|
33
|
+
],
|
|
34
|
+
"navClass": [
|
|
35
|
+
".ghcn-footer__nav"
|
|
36
|
+
],
|
|
37
|
+
"socialClass": [
|
|
38
|
+
".ghcn-footer__social"
|
|
39
|
+
]
|
|
26
40
|
}
|
|
27
41
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "site-header.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/site-header.hbs",
|
|
12
|
-
"content": "{{!-- Component: Site Header | Usage: {{> \"components/site-header\"}} --}}\n<header class=\"ghcn-header\">\n <div class=\"ghcn-header__inner ghcn-container\">\n <a class=\"ghcn-header__brand\" href=\"{{@site.url}}\" aria-label=\"{{@site.title}} home\">\n {{#if @site.logo}}\n <img src=\"{{@site.logo}}\" alt=\"{{@site.title}}\" />\n {{else}}\n <span>{{@site.title}}</span>\n {{/if}}\n </a>\n\n <nav class=\"ghcn-header__nav\" aria-label=\"Primary navigation\">{{navigation}}</nav>\n\n <div class=\"ghcn-header__actions\">\n {{search}}\n {{#if @site.members_enabled}}\n {{#if @member}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-header__signin\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n {{#unless @site.members_invite_only}}\n {{#if @site.allow_self_signup}}\n <a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n {{/unless}}\n {{/if}}\n {{/if}}\n </div>\n\n <details class=\"ghcn-header__mobile\">\n <summary class=\"ghcn-icon-button ghcn-button--outline\" aria-label=\"Open navigation\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M4 7h16M4 12h16M4 17h16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n </summary>\n <div class=\"ghcn-header__panel\">\n <nav aria-label=\"Mobile navigation\">{{navigation}}</nav>\n <div class=\"ghcn-header__mobile-actions\">\n {{search}}\n {{#if @site.members_enabled}}\n {{#if @member}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n {{#unless @site.members_invite_only}}\n {{#if @site.allow_self_signup}}\n <a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n {{/unless}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n </details>\n </div>\n</header
|
|
12
|
+
"content": "{{!-- Styling parameters: class, innerClass, navClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Site Header | Usage: {{> \"components/site-header\"}} --}}\n<header class=\"ghcn-header{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\">\n <div class=\"ghcn-header__inner{{#if ghostcnStyles.innerClass}} {{ghostcnStyles.innerClass}}{{/if}} ghcn-container\">\n <a class=\"ghcn-header__brand\" href=\"{{@site.url}}\" aria-label=\"{{@site.title}} home\">\n {{#if @site.logo}}\n <img src=\"{{@site.logo}}\" alt=\"{{@site.title}}\" />\n {{else}}\n <span>{{@site.title}}</span>\n {{/if}}\n </a>\n\n <nav class=\"ghcn-header__nav{{#if ghostcnStyles.navClass}} {{ghostcnStyles.navClass}}{{/if}}\" aria-label=\"Primary navigation\">{{navigation}}</nav>\n\n <div class=\"ghcn-header__actions\">\n {{search}}\n {{#if @site.members_enabled}}\n {{#if @member}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-header__signin\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n {{#unless @site.members_invite_only}}\n {{#if @site.allow_self_signup}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n {{/unless}}\n {{/if}}\n {{/if}}\n </div>\n\n <details class=\"ghcn-header__mobile\">\n <summary class=\"ghcn-icon-button ghcn-button--outline\" aria-label=\"Open navigation\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M4 7h16M4 12h16M4 17h16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n </summary>\n <div class=\"ghcn-header__panel\">\n <nav class=\"ghcn-header__mobile-nav{{#if ghostcnStyles.navClass}} {{ghostcnStyles.navClass}}{{/if}}\" aria-label=\"Mobile navigation\">{{navigation}}</nav>\n <div class=\"ghcn-header__mobile-actions\">\n {{search}}\n {{#if @site.members_enabled}}\n {{#if @member}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-button--outline\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n {{#unless @site.members_invite_only}}\n {{#if @site.allow_self_signup}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n {{/unless}}\n {{/if}}\n {{/if}}\n </div>\n </div>\n </details>\n </div>\n</header>\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "site-header.css",
|
|
@@ -23,5 +23,20 @@
|
|
|
23
23
|
"GS010-PJ-VALID"
|
|
24
24
|
],
|
|
25
25
|
"notes": "Uses Ghost navigation, search, member state, and Portal triggers."
|
|
26
|
+
},
|
|
27
|
+
"styleSlots": {
|
|
28
|
+
"class": [
|
|
29
|
+
".ghcn-header"
|
|
30
|
+
],
|
|
31
|
+
"innerClass": [
|
|
32
|
+
".ghcn-header__inner"
|
|
33
|
+
],
|
|
34
|
+
"navClass": [
|
|
35
|
+
".ghcn-header__nav",
|
|
36
|
+
".ghcn-header__mobile-nav"
|
|
37
|
+
],
|
|
38
|
+
"buttonClass": [
|
|
39
|
+
".ghcn-button"
|
|
40
|
+
]
|
|
26
41
|
}
|
|
27
42
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "table-of-contents",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Progressively enhanced h2/h3 navigation with collision-safe anchors and keyboard focus.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "table-of-contents.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/table-of-contents.hbs",
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, listClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- add manages the deferred script in default.hbs. Set contentSelector for existing themes. --}}\n<nav class=\"ghcn-toc{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-toc data-toc-content=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\" data-link-class=\"{{linkClass}}\" aria-label=\"On this page\" hidden>\n <h2 class=\"ghcn-toc__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if heading}}{{heading}}{{else}}On this page{{/if}}</h2>\n <ol class=\"ghcn-toc__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" data-toc-list></ol>\n</nav>\n{{/with}}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "table-of-contents.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/table-of-contents.css",
|
|
18
|
+
"content": "\n.ghcn-toc { padding: 1.25em; margin-block: 1.5em; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); }\n.ghcn-toc[hidden] { display: none; }\n.ghcn-toc__title { margin: 0 0 .75em; font-size: 1em; font-weight: 600; }\n.ghcn-toc__list { padding-left: 1.25em; margin: 0; }\n.ghcn-toc__item { padding-block: .25em; }\n.ghcn-toc__item--nested { margin-left: 1em; }\n.ghcn-toc__link { color: inherit; text-decoration: none; overflow-wrap: anywhere; }\n.ghcn-toc__link:hover { text-decoration: underline; }\n.ghcn-toc__link:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "table-of-contents.js",
|
|
22
|
+
"type": "js",
|
|
23
|
+
"target": "assets/js/components/table-of-contents.js",
|
|
24
|
+
"content": "/* ghostcn table of contents: no dependencies, no HTML injection, repeat-safe. */\n(() => {\n const init = () => {\n document.querySelectorAll('[data-ghcn-toc]').forEach(nav => {\n if (nav.dataset.ghcnTocReady) return;\n let content;\n try { content = document.querySelector(nav.dataset.tocContent); } catch { return; }\n if (!content) return;\n // Editor card UI titles are not article sections (e.g. signup or product headings).\n const headings = [...content.querySelectorAll('h2, h3')].filter(h => h.textContent.trim() && !h.closest('.kg-card'));\n if (headings.length < 2) return;\n const list = nav.querySelector('[data-toc-list]');\n if (!list) return;\n const used = new Set([...document.querySelectorAll('[id]')].map(el => el.id));\n headings.forEach((heading, index) => {\n if (!heading.id) {\n const base = 'ghcn-' + (heading.textContent.toLowerCase().normalize('NFKD').replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'section-' + (index + 1));\n let id = base, suffix = 2;\n while (used.has(id)) id = base + '-' + suffix++;\n heading.id = id; used.add(id);\n }\n const item = document.createElement('li');\n item.className = 'ghcn-toc__item' + (heading.tagName === 'H3' ? ' ghcn-toc__item--nested' : '');\n const link = document.createElement('a');\n link.className = 'ghcn-toc__link';\n if (nav.dataset.linkClass) nav.dataset.linkClass.split(/\\s+/).filter(Boolean).forEach(value => link.classList.add(value));\n link.href = '#' + encodeURIComponent(heading.id);\n link.textContent = heading.textContent.trim();\n link.addEventListener('click', event => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n heading.scrollIntoView({ behavior: 'auto', block: 'start' });\n if (!heading.hasAttribute('tabindex')) {\n heading.setAttribute('tabindex', '-1');\n heading.addEventListener('blur', () => heading.removeAttribute('tabindex'), { once: true });\n }\n heading.focus({ preventScroll: true });\n try { history.replaceState(null, '', '#' + encodeURIComponent(heading.id)); } catch {}\n });\n item.append(link); list.append(item);\n });\n nav.dataset.ghcnTocReady = 'true'; nav.hidden = false;\n });\n };\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true }); else init();\n})();"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"gscan": {
|
|
28
|
+
"rules_satisfied": [
|
|
29
|
+
"GS010-PJ-VALID"
|
|
30
|
+
],
|
|
31
|
+
"notes": "Uses native Ghost post data and optional progressive enhancement."
|
|
32
|
+
},
|
|
33
|
+
"styleSlots": {
|
|
34
|
+
"class": [
|
|
35
|
+
".ghcn-toc"
|
|
36
|
+
],
|
|
37
|
+
"titleClass": [
|
|
38
|
+
".ghcn-toc__title"
|
|
39
|
+
],
|
|
40
|
+
"listClass": [
|
|
41
|
+
".ghcn-toc__list"
|
|
42
|
+
],
|
|
43
|
+
"linkClass": [
|
|
44
|
+
".ghcn-toc__link"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|