ghostcn 1.5.0 → 1.6.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/dist/commands/create.js +10 -3
- package/dist/commands/diff.js +47 -5
- package/dist/commands/init.js +17 -8
- package/dist/commands/list.js +22 -4
- package/dist/registry/components/accordion.json +66 -0
- package/dist/registry/components/announcement-bar.json +79 -0
- package/dist/registry/components/archive-header.json +1 -1
- package/dist/registry/components/author-card.json +2 -2
- package/dist/registry/components/author-list.json +1 -1
- package/dist/registry/components/avatar.json +62 -0
- package/dist/registry/components/breadcrumbs.json +59 -0
- package/dist/registry/components/button.json +1 -1
- package/dist/registry/components/featured-posts.json +2 -2
- package/dist/registry/components/input.json +8 -2
- package/dist/registry/components/member-cta.json +1 -1
- package/dist/registry/components/newsletter-form.json +12 -3
- package/dist/registry/components/pagination.json +2 -2
- package/dist/registry/components/post-card.json +2 -2
- package/dist/registry/components/post-grid.json +1 -1
- package/dist/registry/components/post-header.json +2 -2
- package/dist/registry/components/pricing-table.json +24 -4
- package/dist/registry/components/reading-progress.json +73 -0
- package/dist/registry/components/related-posts.json +6 -0
- package/dist/registry/components/share-buttons.json +76 -0
- package/dist/registry/components/site-footer.json +2 -2
- package/dist/registry/components/site-header.json +1 -1
- package/dist/registry/components/table-of-contents.json +12 -2
- package/dist/registry/components/tag-grid.json +1 -1
- package/dist/registry/components/tag-list.json +1 -1
- package/dist/registry/components/theme-toggle.json +65 -0
- package/dist/registry/components/visibility-badge.json +71 -0
- package/dist/registry/index.json +89 -4
- package/dist/templates/playground/index.html +2 -2
- package/dist/templates/playground/playground.css +8 -1
- package/dist/templates/playground/playground.js +39 -5
- package/dist/templates/playground/preview.css +1 -0
- package/dist/templates/theme-tools.mjs +62 -24
- package/dist/utils/component-diff.d.ts +1 -1
- package/dist/utils/component-diff.js +46 -17
- package/dist/utils/component-files.js +3 -2
- package/dist/utils/component-history.js +1 -1
- package/dist/utils/playground-server.js +34 -12
- package/dist/utils/preview-renderer.d.ts +5 -0
- package/dist/utils/preview-renderer.js +20 -6
- package/dist/utils/registry.js +15 -5
- package/dist/utils/theme-files.js +14 -7
- package/dist/utils/theme-project.js +6 -4
- package/dist/utils/theme-scaffold.js +22 -7
- package/dist/utils/theme.js +39 -32
- package/package.json +1 -1
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "featured-posts.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/featured-posts.hbs",
|
|
12
|
-
"content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, contentClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Featured Posts | Usage: {{> \"components/featured-posts\"}} --}}\n{{#get \"posts\" filter=\"featured:true\" limit=\"3\" include=\"authors,tags\"}}\n{{#if posts}}\n<section class=\"ghcn-featured{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}} ghcn-container\" aria-label=\"Featured posts\">\n <div class=\"ghcn-featured__heading\">\n <div><span class=\"ghcn-badge\">Featured</span><h2 class=\"ghcn-featured__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">Editor’s picks</h2></div>\n <a href=\"{{@site.url}}\">View all posts <span aria-hidden=\"true\">→</span></a>\n </div>\n <div class=\"ghcn-featured__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#foreach posts}}\n <article class=\"ghcn-featured__card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}{{#has index=\"0\"}} ghcn-featured__card--lead{{/has}}\">\n {{#if feature_image}}\n <a class=\"ghcn-featured__image\" href=\"{{url}}\">\n <img src=\"{{img_url feature_image size=\"l\"}}\" alt=\"
|
|
12
|
+
"content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, contentClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Featured Posts | Usage: {{> \"components/featured-posts\"}} --}}\n{{#get \"posts\" filter=\"featured:true\" limit=\"3\" include=\"authors,tags\"}}\n{{#if posts}}\n<section class=\"ghcn-featured{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}} ghcn-container\" aria-label=\"Featured posts\">\n <div class=\"ghcn-featured__heading\">\n <div><span class=\"ghcn-badge\">Featured</span><h2 class=\"ghcn-featured__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">Editor’s picks</h2></div>\n <a href=\"{{@site.url}}\">View all posts <span aria-hidden=\"true\">→</span></a>\n </div>\n <div class=\"ghcn-featured__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#foreach posts}}\n <article class=\"ghcn-featured__card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}{{#has index=\"0\"}} ghcn-featured__card--lead{{/has}}\">\n {{#if feature_image}}\n <a class=\"ghcn-featured__image\" href=\"{{url}}\" tabindex=\"-1\" aria-hidden=\"true\">\n <img src=\"{{img_url feature_image size=\"l\"}}\" alt=\"\" loading=\"{{#has index=\"0\"}}eager{{else}}lazy{{/has}}\" />\n </a>\n {{/if}}\n <div class=\"ghcn-featured__content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\">\n <div class=\"ghcn-featured__meta\">{{#if primary_tag}}<a href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a><span aria-hidden=\"true\">•</span>{{/if}}<span>{{reading_time}}</span></div>\n <h3><a href=\"{{url}}\">{{title}}</a></h3>\n {{#has index=\"0\"}}{{#if excerpt}}<p>{{excerpt words=\"30\"}}</p>{{/if}}{{/has}}\n </div>\n </article>\n {{/foreach}}\n </div>\n</section>\n{{/if}}\n{{/get}}\n{{/with}}"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "featured-posts.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/featured-posts.css",
|
|
18
|
-
"content": "/* ghostcn: Featured Posts */\n.ghcn-featured { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-featured *, .ghcn-featured *::before, .ghcn-featured *::after { box-sizing: border-box; }\n.ghcn-featured__heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: var(--ghcn-section-gap, 20px); }\n.ghcn-featured__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 8px 0 0; }\n.ghcn-featured__heading > a { color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); font-weight: 600; text-decoration: none; }\n.ghcn-featured__grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-featured__card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); display: flex; flex-direction: column; overflow: hidden; }\n.ghcn-featured__card--lead { grid-row: span 2; }\n.ghcn-featured__card:only-child { grid-column: 1 / -1; grid-row: auto; }\n.ghcn-featured__image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); }\n.ghcn-featured__image img { display: block; width: 100%; height: 100%; object-fit: cover; }\n.ghcn-featured__card--lead:not(:only-child) .ghcn-featured__image { flex: 1 1 auto; }\n.ghcn-featured__content { padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.ghcn-featured__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--muted-foreground); font-size: var(--ghcn-text-meta, 13px); }\n.ghcn-featured__meta a, .ghcn-featured__content h3 a { color: inherit; text-decoration: none; }\n.ghcn-featured a:hover { text-decoration: underline; text-underline-offset: 3px; }\n.ghcn-featured__content h3 { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0; }\n.ghcn-featured__card--lead h3 { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; }\n.ghcn-featured__content p { max-width: 60ch; margin: 8px 0 0; color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); }\n.ghcn-featured:focus-visible, :where(.ghcn-featured) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-featured__image:focus-visible { outline-offset: -3px; }\n@media (max-width: 720px) { .ghcn-featured__grid { grid-template-columns: 1fr; } .ghcn-featured__card--lead { grid-row: auto; } }\n"
|
|
18
|
+
"content": "/* ghostcn: Featured Posts */\n.ghcn-featured { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-featured *, .ghcn-featured *::before, .ghcn-featured *::after { box-sizing: border-box; }\n.ghcn-featured__heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: var(--ghcn-section-gap, 20px); }\n.ghcn-featured__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 8px 0 0; }\n.ghcn-featured__heading > a { color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); font-weight: 600; text-decoration: none; }\n.ghcn-featured__grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-featured__card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); display: flex; flex-direction: column; overflow: hidden; transition: border-color 180ms ease; }\n.ghcn-featured__card:hover { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); }\n.ghcn-featured__card--lead { grid-row: span 2; }\n.ghcn-featured__card:only-child { grid-column: 1 / -1; grid-row: auto; }\n.ghcn-featured__image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); }\n.ghcn-featured__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }\n.ghcn-featured__card:hover .ghcn-featured__image img { transform: scale(1.02); }\n@media (prefers-reduced-motion: reduce) { .ghcn-featured__card, .ghcn-featured__image img { transition: none; transform: none; } }\n.ghcn-featured__card--lead:not(:only-child) .ghcn-featured__image { flex: 1 1 auto; }\n.ghcn-featured__content { padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.ghcn-featured__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--muted-foreground); font-size: var(--ghcn-text-meta, 13px); }\n.ghcn-featured__meta a, .ghcn-featured__content h3 a { color: inherit; text-decoration: none; }\n.ghcn-featured a:hover { text-decoration: underline; text-underline-offset: 3px; }\n.ghcn-featured__content h3 { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0; }\n.ghcn-featured__card--lead h3 { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; }\n.ghcn-featured__content p { max-width: 60ch; margin: 8px 0 0; color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); }\n.ghcn-featured:focus-visible, :where(.ghcn-featured) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-featured__image:focus-visible { outline-offset: -3px; }\n@media (max-width: 720px) { .ghcn-featured__grid { grid-template-columns: 1fr; } .ghcn-featured__card--lead { grid-row: auto; } }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
],
|
|
39
39
|
"default": "text"
|
|
40
40
|
},
|
|
41
|
+
"id": {
|
|
42
|
+
"description": "Optional unique input ID."
|
|
43
|
+
},
|
|
41
44
|
"name": {
|
|
42
45
|
"description": "Form field name."
|
|
43
46
|
},
|
|
@@ -47,6 +50,9 @@
|
|
|
47
50
|
"placeholder": {
|
|
48
51
|
"description": "Optional placeholder (not a label)."
|
|
49
52
|
},
|
|
53
|
+
"autocomplete": {
|
|
54
|
+
"description": "Optional HTML autocomplete token (for example: email)."
|
|
55
|
+
},
|
|
50
56
|
"hint": {
|
|
51
57
|
"description": "Optional help text."
|
|
52
58
|
},
|
|
@@ -68,13 +74,13 @@
|
|
|
68
74
|
"name": "input.hbs",
|
|
69
75
|
"type": "partial",
|
|
70
76
|
"target": "partials/components/input.hbs",
|
|
71
|
-
"content": "{{!-- Styling parameters: class, labelClass, inputClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-field{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"filled\"}}filled{{else}}default{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n <label class=\"ghcn-ui-field__label\"><span class=\"ghcn-ui-field__label-text{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Input{{/if}}{{#if required}} (required){{/if}}</span>\n <input class=\"ghcn-ui-field__input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\" type=\"{{#match type \"email\"}}email{{else}}{{#match type \"search\"}}search{{else}}{{#match type \"url\"}}url{{else}}{{#match type \"number\"}}number{{else}}{{#match type \"password\"}}password{{else}}text{{/match}}{{/match}}{{/match}}{{/match}}{{/match}}\" {{#if name}}name=\"{{name}}\"{{/if}} value=\"{{value}}\" placeholder=\"{{placeholder}}\" {{#if required}}required{{/if}}
|
|
77
|
+
"content": "{{!-- Styling parameters: class, labelClass, inputClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-field{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"filled\"}}filled{{else}}default{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n <label class=\"ghcn-ui-field__label\"><span class=\"ghcn-ui-field__label-text{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Input{{/if}}{{#if required}} (required){{/if}}</span>\n <input class=\"ghcn-ui-field__input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\" type=\"{{#match type \"email\"}}email{{else}}{{#match type \"search\"}}search{{else}}{{#match type \"url\"}}url{{else}}{{#match type \"number\"}}number{{else}}{{#match type \"password\"}}password{{else}}text{{/match}}{{/match}}{{/match}}{{/match}}{{/match}}\"{{#if id}} id=\"{{id}}\"{{/if}}{{#if name}} name=\"{{name}}\"{{/if}}{{#if value}} value=\"{{value}}\"{{/if}}{{#if placeholder}} placeholder=\"{{placeholder}}\"{{/if}}{{#if autocomplete}} autocomplete=\"{{autocomplete}}\"{{/if}}{{#if required}} required{{/if}}{{#if disabled}} disabled{{/if}}{{#if invalid}} aria-invalid=\"true\"{{/if}}{{#if hint}}{{#if hintId}} aria-describedby=\"{{hintId}}\"{{/if}}{{/if}} />\n </label>\n {{#if hint}}<p class=\"ghcn-ui-field__hint{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\"{{#if hintId}} id=\"{{hintId}}\"{{/if}}>{{hint}}</p>{{/if}}\n</div>\n{{/with}}"
|
|
72
78
|
},
|
|
73
79
|
{
|
|
74
80
|
"name": "input.css",
|
|
75
81
|
"type": "style",
|
|
76
82
|
"target": "assets/css/components/input.css",
|
|
77
|
-
"content": ".ghcn-ui-field { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-field, .ghcn-ui-field * { box-sizing: border-box; }\n.ghcn-ui-field:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-field:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-field:focus-visible, :where(.ghcn-ui-field) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-field { width: 100%; }\n.ghcn-ui-field__label { display: grid; gap: .375em; font-weight: 500; }\n.ghcn-ui-field__input { min-height: var(--ghcn-control-height, 40px); padding: var(--ghcn-control-padding, 8px 14px); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); font-size: var(--ghcn-text-small, 14px); line-height: 1.25; width: 100%; min-width: 0; border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-family: inherit; }\n:where(.ghcn-ui-field[data-size=\"sm\"]) .ghcn-ui-field__input { min-height: 34px; padding: 5px 11px; font-size: 13px; }\n:where(.ghcn-ui-field[data-size=\"lg\"]) .ghcn-ui-field__input { min-height: 46px; padding: 10px 17px; font-size: 16px; }\n:where(.ghcn-ui-field[data-variant=\"filled\"]) .ghcn-ui-field__input { background: var(--muted); }\n.ghcn-ui-field__input::placeholder { color: var(--muted-foreground); }\n.ghcn-ui-field__input[aria-invalid=\"true\"] { border-color: var(--destructive); }\n.ghcn-ui-field__input:disabled { opacity: .5; cursor: not-allowed; }\n.ghcn-ui-field__hint { color: var(--muted-foreground); font-size: .875em; margin: .5em 0 0; }\n"
|
|
83
|
+
"content": ".ghcn-ui-field { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-field, .ghcn-ui-field * { box-sizing: border-box; }\n.ghcn-ui-field:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-field:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-field:focus-visible, :where(.ghcn-ui-field) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-field { width: 100%; }\n.ghcn-ui-field__label { display: grid; gap: .375em; font-weight: 500; }\n.ghcn-ui-field__input { min-height: var(--ghcn-control-height, 40px); padding: var(--ghcn-control-padding, 8px 14px); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); font-size: var(--ghcn-text-small, 14px); line-height: 1.25; width: 100%; min-width: 0; border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-family: inherit; transition: border-color 150ms ease, background-color 150ms ease; }\n:where(.ghcn-ui-field[data-size=\"sm\"]) .ghcn-ui-field__input { min-height: 34px; padding: 5px 11px; font-size: 13px; }\n:where(.ghcn-ui-field[data-size=\"lg\"]) .ghcn-ui-field__input { min-height: 46px; padding: 10px 17px; font-size: 16px; }\n:where(.ghcn-ui-field[data-variant=\"filled\"]) .ghcn-ui-field__input { background: var(--muted); }\n.ghcn-ui-field__input::placeholder { color: var(--muted-foreground); }\n.ghcn-ui-field__input[aria-invalid=\"true\"] { border-color: var(--destructive); }\n.ghcn-ui-field__input:disabled { opacity: .5; cursor: not-allowed; }\n.ghcn-ui-field__hint { color: var(--muted-foreground); font-size: .875em; margin: .5em 0 0; }\n@media (prefers-reduced-motion: reduce) { .ghcn-ui-field__input { transition: none; } }\n"
|
|
78
84
|
}
|
|
79
85
|
],
|
|
80
86
|
"styleSlots": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"name": "member-cta.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/member-cta.css",
|
|
18
|
-
"content": "/* ghostcn: Member CTA */\n.ghcn-member-cta { box-sizing: border-box; min-width: 0;
|
|
18
|
+
"content": "/* ghostcn: Member CTA */\n.ghcn-member-cta { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; width: min(100% - 32px, 704px); margin-inline: auto; padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); text-align: center; }\n.ghcn-member-cta *, .ghcn-member-cta *::before, .ghcn-member-cta *::after { box-sizing: border-box; }\n.ghcn-member-cta__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 12px 0 8px; color: inherit; }\n.ghcn-member-cta__description { max-width: 60ch; margin: 0 auto 16px; color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); }\n.ghcn-member-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newsletter-form",
|
|
3
|
-
"type": "components:
|
|
3
|
+
"type": "components:members",
|
|
4
4
|
"description": "A native Ghost members subscription form with state handling.",
|
|
5
5
|
"dependencies": [],
|
|
6
6
|
"ghost_version": ">=5.0.0",
|
|
7
|
+
"parameters": {
|
|
8
|
+
"title": {
|
|
9
|
+
"description": "Optional heading override.",
|
|
10
|
+
"default": "Subscribe to our newsletter"
|
|
11
|
+
},
|
|
12
|
+
"description": {
|
|
13
|
+
"description": "Optional introductory text override."
|
|
14
|
+
}
|
|
15
|
+
},
|
|
7
16
|
"files": [
|
|
8
17
|
{
|
|
9
18
|
"name": "newsletter-form.hbs",
|
|
10
19
|
"type": "partial",
|
|
11
20
|
"target": "partials/components/newsletter-form.hbs",
|
|
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
|
|
21
|
+
"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 <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 8.5 6.5 12 13 4\"/></svg>\n <span>Check your inbox to confirm your subscription!</span>\n </div>\n <div class=\"gh-newsletter-msg-error message-error\" role=\"alert\" data-members-error>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 4l8 8M12 4l-8 8\"/></svg>\n <span>Please enter a valid email address.</span>\n </div>\n </form>\n {{/if}}\n</section>\n{{/unless}}\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
|
|
13
22
|
},
|
|
14
23
|
{
|
|
15
24
|
"name": "newsletter-form.css",
|
|
16
25
|
"type": "style",
|
|
17
26
|
"target": "assets/css/components/newsletter-form.css",
|
|
18
|
-
"content": "/* ghostcn: Newsletter Form Styles */\n.gh-newsletter-form {\n box-sizing: border-box; min-width: 0;
|
|
27
|
+
"content": "/* ghostcn: Newsletter Form Styles */\n.gh-newsletter-form {\n box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b);\n margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px));\n font-family: inherit;\n font-size: var(--ghcn-text-body, 16px);\n line-height: 1.5;\n padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px));\n text-align: center;\n width: min(100% - 32px, 704px);\n margin-inline: auto;\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: 16px; }\n\n.gh-newsletter-title {\n font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance;\n margin: 0 0 8px;\n color: inherit;\n}\n\n.gh-newsletter-desc {\n color: var(--muted-foreground, #71717a);\n font-size: var(--ghcn-text-small, 14px);\n line-height: 1.5;\n margin: 0 auto;\n max-width: 448px;\n}\n\n.gh-newsletter-fields {\n display: grid;\n gap: var(--ghcn-control-gap, 8px);\n max-width: 448px;\n margin: 0 auto;\n position: relative;\n}\n\n@media (min-width: 640px) {\n .gh-newsletter-fields {\n grid-template-columns: minmax(0, 1fr) auto;\n }\n}\n\n.gh-newsletter-input {\n min-width: 0;\n min-height: var(--ghcn-control-height, 40px);\n padding: var(--ghcn-control-padding, 8px 14px);\n background-color: var(--background, #ffffff);\n color: var(--foreground, #09090b);\n border: 1px solid var(--input, #e4e4e7);\n border-radius: var(--ghcn-control-radius, var(--radius, 8px));\n font-family: inherit;\n font-size: var(--ghcn-text-small, 14px);\n line-height: 1.25;\n}\n\n.gh-newsletter-form:focus-visible, :where(.gh-newsletter-form) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n\n.gh-newsletter-btn {\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n min-height: var(--ghcn-control-height, 40px);\n padding: var(--ghcn-control-padding, 8px 14px);\n border-radius: var(--ghcn-control-radius, var(--radius, 8px));\n font-family: inherit;\n font-size: var(--ghcn-text-small, 14px);\n font-weight: 600;\n line-height: 1.25;\n border: 1px solid transparent;\n cursor: pointer;\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 grid-column: 1 / -1;\n font-size: 12px;\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: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\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: var(--success, #15803d);\n}\n\n.gh-newsletter-msg-error {\n color: var(--destructive, #dc2626);\n}\n"
|
|
19
28
|
}
|
|
20
29
|
],
|
|
21
30
|
"gscan": {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/pagination.hbs",
|
|
12
12
|
"placement": "theme",
|
|
13
|
-
"content": "{{!-- Styling parameters: class, buttonClass, statusClass --}}\n{{#with this as |ghostcnStyles|}}\n<nav class=\"ghcn-pagination{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"
|
|
13
|
+
"content": "{{!-- Styling parameters: class, buttonClass, statusClass --}}\n{{#with this as |ghostcnStyles|}}\n<nav class=\"ghcn-pagination{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" 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",
|
|
17
17
|
"type": "style",
|
|
18
18
|
"target": "assets/css/components/pagination.css",
|
|
19
|
-
"content": "/* ghostcn: Pagination */\n.ghcn-pagination { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 1152px); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-pagination *, .ghcn-pagination *::before, .ghcn-pagination *::after { box-sizing: border-box; }\n.ghcn-pagination__side { display: flex; }\n.ghcn-pagination__side--end { justify-content: flex-end; }\n.ghcn-pagination__status { color: var(--muted-foreground); font-size:
|
|
19
|
+
"content": "/* ghostcn: Pagination */\n.ghcn-pagination { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 1152px); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-pagination *, .ghcn-pagination *::before, .ghcn-pagination *::after { box-sizing: border-box; }\n.ghcn-pagination__side { display: flex; }\n.ghcn-pagination__side--end { justify-content: flex-end; }\n.ghcn-pagination__status { color: var(--muted-foreground); font-size: 13px; }\n@media (max-width: 480px) { .ghcn-pagination { grid-template-columns: 1fr 1fr; } .ghcn-pagination__status { grid-column: 1 / -1; grid-row: 1; text-align: center; } }\n"
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
22
|
"gscan": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "post-card.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/post-card.hbs",
|
|
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=\"
|
|
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\" tabindex=\"-1\" aria-hidden=\"true\">\n <img src=\"{{img_url feature_image size=\"m\"}}\" alt=\"\" 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\" aria-hidden=\"true\">•</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; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b);\n font-family: inherit;\n font-size: var(--ghcn-text-body, 16px);\n line-height: 1.5;\n isolation: isolate;\n overflow: hidden;\n display: flex;\n flex-direction: column;\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-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 display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.gh-post-card-content {\n padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px));\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.gh-post-card-tag {\n color: inherit;\n font-size: inherit;\n font-weight: 600;\n text-decoration: none;\n}\n\n.gh-post-card-tag:hover {\n text-decoration: underline;\n}\n\n.gh-post-card-title {\n font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit;\n margin: 8px 0;\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 a:hover {\n text-decoration: underline;\n text-underline-offset: 3px;\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: var(--ghcn-text-small, 14px);\n line-height: 1.5;\n margin: 0 0 16px;\n}\n\n.gh-post-card-footer {\n padding-top:
|
|
18
|
+
"content": "/* ghostcn: Post Card Styles */\n.gh-post-card {\n box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b);\n font-family: inherit;\n font-size: var(--ghcn-text-body, 16px);\n line-height: 1.5;\n isolation: isolate;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n transition: border-color 180ms ease;\n}\n\n.gh-post-card:hover {\n border-color: color-mix(in srgb, var(--foreground) 22%, var(--border));\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-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 display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: transform 300ms ease;\n}\n\n.gh-post-card:hover .gh-post-card-image img {\n transform: scale(1.02);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .gh-post-card, .gh-post-card-image img { transition: none; transform: none; }\n}\n\n.gh-post-card-content {\n padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px));\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.gh-post-card-tag {\n color: inherit;\n font-size: inherit;\n font-weight: 600;\n text-decoration: none;\n}\n\n.gh-post-card-tag:hover {\n text-decoration: underline;\n}\n\n.gh-post-card-title {\n font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit;\n margin: 8px 0;\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 a:hover {\n text-decoration: underline;\n text-underline-offset: 3px;\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: var(--ghcn-text-small, 14px);\n line-height: 1.5;\n margin: 0 0 16px;\n}\n\n.gh-post-card-footer {\n padding-top: 16px;\n border-top: 1px solid var(--border, #e4e4e7);\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 4px 12px;\n font-size: var(--ghcn-text-meta, 13px);\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-post-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--muted-foreground); font-size: var(--ghcn-text-meta, 13px); }\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: 8px; font-weight: 500; }\n.gh-post-card:focus-visible, :where(.gh-post-card) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.gh-post-card-image:focus-visible { outline-offset: -3px; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"name": "post-grid.hbs",
|
|
20
20
|
"type": "partial",
|
|
21
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}}"
|
|
22
|
+
"content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, cardTitleClass, imageClass, descriptionClass --}}\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
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "post-grid.css",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "post-header.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/post-header.hbs",
|
|
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
|
|
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 <span aria-hidden=\"true\">•</span>\n {{/primary_author}}\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",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/post-header.css",
|
|
18
|
-
"content": "/* ghostcn: Post Header */\n.ghcn-post-header { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); text-align: center; }\n.ghcn-post-header *, .ghcn-post-header *::before, .ghcn-post-header *::after { box-sizing: border-box; }\n.ghcn-post-header__title { font-size: var(--ghcn-title-display, clamp(32px, 5vw, 56px)); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; overflow-wrap: anywhere; max-width: 24ch; margin: 12px auto; }\n.ghcn-post-header__excerpt { max-width: 60ch; margin: 12px auto; color: var(--muted-foreground); font-size: var(--ghcn-text-body, 16px); }\n.ghcn-post-header__meta, .ghcn-post-header__author { display: flex; align-items: center; justify-content: center; gap:
|
|
18
|
+
"content": "/* ghostcn: Post Header */\n.ghcn-post-header { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); text-align: center; }\n.ghcn-post-header *, .ghcn-post-header *::before, .ghcn-post-header *::after { box-sizing: border-box; }\n.ghcn-post-header__title { font-size: var(--ghcn-title-display, clamp(32px, 5vw, 56px)); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; overflow-wrap: anywhere; max-width: 24ch; margin: 12px auto; }\n.ghcn-post-header__excerpt { max-width: 60ch; margin: 12px auto; color: var(--muted-foreground); font-size: var(--ghcn-text-body, 16px); }\n.ghcn-post-header__meta, .ghcn-post-header__author { display: flex; align-items: center; justify-content: center; gap: 10px; }\n.ghcn-post-header__meta { flex-wrap: wrap; color: var(--muted-foreground); font-size: var(--ghcn-text-meta, 13px); }\n.ghcn-post-header__author { color: var(--foreground); font-weight: 700; text-decoration: none; }\n.ghcn-post-header__author .ghcn-avatar { width: 32px; height: 32px; }\n.ghcn-post-header__media { margin: var(--ghcn-section-gap, 20px) 0 0; }\n.ghcn-post-header__image { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 560px; border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); object-fit: cover; }\n.ghcn-post-header__media figcaption { margin-top: 12px; color: var(--muted-foreground); font-size: 12px; }\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -1,28 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pricing-table",
|
|
3
3
|
"type": "components:members",
|
|
4
|
-
"description": "Live Ghost tiers, prices, currencies and
|
|
4
|
+
"description": "Live Ghost tiers, prices, currencies, benefits, and progressive monthly/yearly toggle with Portal checkout.",
|
|
5
5
|
"dependencies": [],
|
|
6
6
|
"ghost_version": ">=5.0.0",
|
|
7
|
+
"parameters": {
|
|
8
|
+
"title": {
|
|
9
|
+
"description": "Optional section heading override.",
|
|
10
|
+
"default": "Choose your membership"
|
|
11
|
+
},
|
|
12
|
+
"defaultBilling": {
|
|
13
|
+
"description": "Initial interval when the progressive billing toggle activates.",
|
|
14
|
+
"options": [
|
|
15
|
+
"monthly",
|
|
16
|
+
"yearly"
|
|
17
|
+
],
|
|
18
|
+
"default": "monthly"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
7
21
|
"files": [
|
|
8
22
|
{
|
|
9
23
|
"name": "pricing-table.hbs",
|
|
10
24
|
"type": "partial",
|
|
11
25
|
"target": "partials/components/pricing-table.hbs",
|
|
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 <header class=\"gh-pricing-card__header\">\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 </header>\n <div class=\"gh-pricing-card__rates\"><p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">Free</p></div>\n {{#if benefits}}\n <ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\" role=\"list\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>\n {{/if}}\n <div class=\"gh-pricing-actions\">\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}}</div>\n</article>\n {{else}}\n {{#if @site.paid_members_enabled}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}} gh-pricing-card--paid\">\n <header class=\"gh-pricing-card__header\">\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 </header>\n <div class=\"gh-pricing-card__rates\">\n {{#if monthly_price}}\n <p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">{{price monthly_price currency=currency}} <span>/ month</span></p>\n {{#if yearly_price}}<p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}} gh-pricing-price--alternate\">{{price yearly_price currency=currency}} <span>
|
|
26
|
+
"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}}\" data-ghcn-pricing data-default-billing=\"{{#match defaultBilling \"yearly\"}}yearly{{else}}monthly{{/match}}\" 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-billing\" data-ghcn-billing-toggle role=\"group\" aria-label=\"Billing interval\" hidden>\n <button type=\"button\" class=\"gh-pricing-billing__btn\" data-billing-choice=\"monthly\" aria-pressed=\"true\">Monthly</button>\n <button type=\"button\" class=\"gh-pricing-billing__btn\" data-billing-choice=\"yearly\" aria-pressed=\"false\">Yearly <span class=\"gh-pricing-billing__badge\" data-billing-savings hidden></span></button>\n </div>\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 {{#if tiers}}\n {{#foreach tiers}}\n {{#match type \"free\"}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}\">\n <header class=\"gh-pricing-card__header\">\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 </header>\n <div class=\"gh-pricing-card__rates\"><p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\">Free</p></div>\n {{#if benefits}}\n <ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\" role=\"list\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>\n {{/if}}\n <div class=\"gh-pricing-actions\">\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}}</div>\n</article>\n {{else}}\n {{#if @site.paid_members_enabled}}\n {{#if monthly_price}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}} gh-pricing-card--paid\"{{#if monthly_price}} data-monthly-cents=\"{{monthly_price}}\"{{/if}}{{#if yearly_price}} data-yearly-cents=\"{{yearly_price}}\"{{/if}}>\n <header class=\"gh-pricing-card__header\">\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 </header>\n <div class=\"gh-pricing-card__rates\">\n {{#if monthly_price}}\n <p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\"{{#if yearly_price}} data-pricing-interval=\"monthly\"{{/if}}>{{price monthly_price currency=currency}} <span>/ month</span></p>\n {{#if yearly_price}}<p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}} gh-pricing-price--alternate\" data-pricing-interval=\"yearly\">{{price yearly_price currency=currency}} <span>/ year</span></p>{{/if}}\n {{else}}\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 {{/if}}</div>\n {{#if benefits}}\n <ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\" role=\"list\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>\n {{/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}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\"{{#if yearly_price}} data-pricing-interval=\"monthly\"{{/if}} href=\"#/portal/signup/{{id}}/monthly\" data-portal=\"signup/{{id}}/monthly\" aria-label=\"Subscribe monthly to {{name}}\">Subscribe monthly</a>\n {{#if yearly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} gh-pricing-alternate\" data-pricing-interval=\"yearly\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\" aria-label=\"Subscribe yearly to {{name}}\">Subscribe yearly</a>{{/if}}\n {{else}}\n {{#if yearly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\" aria-label=\"Subscribe yearly to {{name}}\">Subscribe yearly</a>{{/if}}\n {{/if}}\n {{/if}}</div>\n</article>\n {{else if yearly_price}}\n <article class=\"gh-pricing-card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}} gh-pricing-card--paid\"{{#if monthly_price}} data-monthly-cents=\"{{monthly_price}}\"{{/if}}{{#if yearly_price}} data-yearly-cents=\"{{yearly_price}}\"{{/if}}>\n <header class=\"gh-pricing-card__header\">\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 </header>\n <div class=\"gh-pricing-card__rates\">\n {{#if monthly_price}}\n <p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}}\"{{#if yearly_price}} data-pricing-interval=\"monthly\"{{/if}}>{{price monthly_price currency=currency}} <span>/ month</span></p>\n {{#if yearly_price}}<p class=\"gh-pricing-price{{#if ghostcnStyles.priceClass}} {{ghostcnStyles.priceClass}}{{/if}} gh-pricing-price--alternate\" data-pricing-interval=\"yearly\">{{price yearly_price currency=currency}} <span>/ year</span></p>{{/if}}\n {{else}}\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 {{/if}}</div>\n {{#if benefits}}\n <ul class=\"gh-pricing-benefits{{#if ghostcnStyles.benefitsClass}} {{ghostcnStyles.benefitsClass}}{{/if}}\" role=\"list\">{{#foreach benefits}}<li>{{this}}</li>{{/foreach}}</ul>\n {{/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}}\n <a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\"{{#if yearly_price}} data-pricing-interval=\"monthly\"{{/if}} href=\"#/portal/signup/{{id}}/monthly\" data-portal=\"signup/{{id}}/monthly\" aria-label=\"Subscribe monthly to {{name}}\">Subscribe monthly</a>\n {{#if yearly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} gh-pricing-alternate\" data-pricing-interval=\"yearly\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\" aria-label=\"Subscribe yearly to {{name}}\">Subscribe yearly</a>{{/if}}\n {{else}}\n {{#if yearly_price}}<a class=\"ghcn-button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup/{{id}}/yearly\" data-portal=\"signup/{{id}}/yearly\" aria-label=\"Subscribe yearly to {{name}}\">Subscribe yearly</a>{{/if}}\n {{/if}}\n {{/if}}</div>\n</article>\n {{/if}}\n {{/if}}\n {{/match}}\n {{/foreach}}\n {{else}}\n <p class=\"gh-pricing-empty\">Membership plans are currently unavailable.</p>\n {{/if}}\n {{else}}\n <p class=\"gh-pricing-empty\">Membership plans are currently unavailable.</p>\n {{/get}}\n </div>\n</section>\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
|
|
13
27
|
},
|
|
14
28
|
{
|
|
15
29
|
"name": "pricing-table.css",
|
|
16
30
|
"type": "style",
|
|
17
31
|
"target": "assets/css/components/pricing-table.css",
|
|
18
|
-
"content": "/* ghostcn: live membership pricing */\n.gh-pricing { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 960px); margin-inline: auto; }\n.gh-pricing *, .gh-pricing *::before, .gh-pricing *::after { box-sizing: border-box; }\n.gh-pricing-title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 var(--ghcn-section-gap, 20px); text-align: center; }\n.gh-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr)); gap: var(--ghcn-grid-gap, 16px); }\n.gh-pricing-card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); display: flex; flex-direction: column; gap: 16px; padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.gh-pricing-card--paid { border-color: color-mix(in srgb, var(--foreground) 24%, var(--border)); }\n.gh-pricing-card:only-child { width: min(100%, 440px); justify-self: center; }\n.gh-pricing-card__header { display: grid; gap: 4px; }\n.gh-pricing-card__rates { display: grid; gap: 4px; }\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 { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0; }\n.gh-pricing-description { margin: 0; color: inherit; font-size: var(--ghcn-text-small, 14px); }\n.gh-pricing-benefits { display: grid; gap: 8px; margin: 0; padding: 14px 0 0; border-block-start: 1px solid var(--border); list-style: none; color: inherit; font-size: var(--ghcn-text-small, 14px); }\n.gh-pricing-benefits li { display: flex; align-items: baseline; gap: 10px; color: inherit; }\n.gh-pricing-benefits li::before { content: \"\"; flex: 0 0 5px; height: 9px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }\n.gh-pricing-price { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0; color: inherit; font-variant-numeric: tabular-nums; }\n.gh-pricing-price span { font-size: var(--ghcn-text-small, 14px); font-weight: 400; letter-spacing: normal; color: inherit; }\n.gh-pricing-price--alternate { font-size: var(--ghcn-text-small, 14px); font-weight: 600; line-height: 1.5; letter-spacing: normal; }\n.gh-pricing-actions { display: grid; align-content: start; gap: 4px; margin-block-start: auto; padding-block-start: 4px; }\n.gh-pricing-actions:empty, .gh-pricing-card__rates:empty { display: none; }\n:where(.gh-pricing-actions) .ghcn-button--outline { background: var(--background); }\n.gh-pricing-alternate { justify-self: center; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; }\n@media (min-width: 640px) {\n :where(.gh-pricing-grid:has(.gh-pricing-price--alternate)) .gh-pricing-card__rates { min-block-size: calc(1.18 * var(--ghcn-title-section, clamp(24px, 3vw, 32px)) + 25px); align-content: start; }\n :where(.gh-pricing-grid:has(.gh-pricing-alternate)) .gh-pricing-actions { min-block-size: calc(2 * var(--ghcn-control-height, 40px) + 8px); }\n}\n"
|
|
32
|
+
"content": "/* ghostcn: live membership pricing */\n.gh-pricing { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); width: min(100% - 32px, 960px); margin-inline: auto; }\n.gh-pricing *, .gh-pricing *::before, .gh-pricing *::after { box-sizing: border-box; }\n.gh-pricing-title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 16px; text-align: center; }\n.gh-pricing-billing { display: flex; align-items: center; justify-content: center; gap: 4px; width: fit-content; margin: 0 auto var(--ghcn-section-gap, 20px); padding: 4px; border: 1px solid var(--border); border-radius: 9999px; background: var(--secondary); }\n.gh-pricing-billing[hidden] { display: none; }\n.gh-pricing-billing__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid transparent; border-radius: 9999px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: var(--ghcn-text-small, 14px); font-weight: 600; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }\n.gh-pricing-billing__btn:hover { color: var(--foreground); }\n.gh-pricing-billing__btn[aria-pressed=\"true\"] { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: 0 1px 2px #0001; }\n.gh-pricing-billing__badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; background: var(--primary); color: var(--primary-foreground); font-size: 11px; font-weight: 700; }\n.gh-pricing-billing__badge[hidden] { display: none; }\n.gh-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr)); gap: var(--ghcn-grid-gap, 16px); }\n.gh-pricing-card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); display: flex; flex-direction: column; gap: 16px; padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.gh-pricing-card--paid { border-color: color-mix(in srgb, var(--foreground) 24%, var(--border)); }\n.gh-pricing-card:only-child { width: min(100%, 440px); justify-self: center; }\n.gh-pricing-card__header { display: grid; gap: 4px; }\n.gh-pricing-card__rates { display: grid; gap: 4px; }\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 { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0; }\n.gh-pricing-description { margin: 0; color: inherit; font-size: var(--ghcn-text-small, 14px); }\n.gh-pricing-benefits { display: grid; gap: 8px; margin: 0; padding: 14px 0 0; border-block-start: 1px solid var(--border); list-style: none; color: inherit; font-size: var(--ghcn-text-small, 14px); }\n.gh-pricing-benefits li { display: flex; align-items: baseline; gap: 10px; color: inherit; }\n.gh-pricing-benefits li::before { content: \"\"; flex: 0 0 5px; height: 9px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }\n.gh-pricing-price { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0; color: inherit; font-variant-numeric: tabular-nums; }\n.gh-pricing-price span { font-size: var(--ghcn-text-small, 14px); font-weight: 400; letter-spacing: normal; color: inherit; }\n.gh-pricing-price--alternate { font-size: var(--ghcn-text-small, 14px); font-weight: 600; line-height: 1.5; letter-spacing: normal; }\n.gh-pricing-actions { display: grid; align-content: start; gap: 4px; margin-block-start: auto; padding-block-start: 4px; }\n.gh-pricing-actions:empty, .gh-pricing-card__rates:empty { display: none; }\n:where(.gh-pricing-actions) .ghcn-button--outline { background: var(--background); }\n.gh-pricing-alternate { justify-self: center; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; }\n/* Progressive billing toggle: when JS activates, promote the selected interval to primary */\n.gh-pricing:where([data-billing=\"monthly\"]) [data-pricing-interval=\"yearly\"],\n.gh-pricing:where([data-billing=\"yearly\"]) [data-pricing-interval=\"monthly\"] { display: none; }\n.gh-pricing:where([data-billing=\"yearly\"]) .gh-pricing-price--alternate { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; }\n.gh-pricing:where([data-billing=\"yearly\"]) .gh-pricing-alternate { justify-self: stretch; background: var(--primary); color: var(--primary-foreground); text-decoration: none; }\n.gh-pricing:focus-visible, :where(.gh-pricing) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n@media (min-width: 640px) {\n :where(.gh-pricing:not([data-billing]) .gh-pricing-grid:has(.gh-pricing-price--alternate)) .gh-pricing-card__rates { min-block-size: calc(1.18 * var(--ghcn-title-section, clamp(24px, 3vw, 32px)) + 25px); align-content: start; }\n :where(.gh-pricing:not([data-billing]) .gh-pricing-grid:has(.gh-pricing-price--alternate)) .gh-pricing-actions { min-block-size: calc(2 * var(--ghcn-control-height, 40px) + 8px); }\n}\n@media (prefers-reduced-motion: reduce) { .gh-pricing-billing__btn { transition: none; } }\n"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "pricing-table.js",
|
|
36
|
+
"type": "js",
|
|
37
|
+
"target": "assets/js/components/pricing-table.js",
|
|
38
|
+
"content": "/* ghostcn pricing billing toggle: progressive enhancement, zero-JS fallback, repeat-safe. */\n(() => {\n function init() {\n document.querySelectorAll('[data-ghcn-pricing]').forEach(section => {\n if (section.dataset.ghcnPricingReady) return;\n const toggle = section.querySelector('[data-ghcn-billing-toggle]');\n if (!toggle) return;\n const dualCards = [...section.querySelectorAll('.gh-pricing-card--paid[data-monthly-cents][data-yearly-cents]')];\n if (!dualCards.length) return;\n section.dataset.ghcnPricingReady = 'true';\n\n let bestSavings = 0;\n for (const card of dualCards) {\n const monthly = Number(card.dataset.monthlyCents);\n const yearly = Number(card.dataset.yearlyCents);\n if (monthly > 0 && yearly > 0 && yearly < monthly * 12) {\n bestSavings = Math.max(bestSavings, Math.round((1 - yearly / (monthly * 12)) * 100));\n }\n }\n const savingsBadge = toggle.querySelector('[data-billing-savings]');\n if (savingsBadge && bestSavings >= 5) {\n savingsBadge.textContent = 'Save ' + bestSavings + '%';\n savingsBadge.hidden = false;\n }\n\n const buttons = [...toggle.querySelectorAll('[data-billing-choice]')];\n const setIntervalMode = (mode) => {\n section.dataset.billing = mode;\n buttons.forEach(btn => btn.setAttribute('aria-pressed', String(btn.dataset.billingChoice === mode)));\n };\n buttons.forEach(btn => btn.addEventListener('click', () => setIntervalMode(btn.dataset.billingChoice)));\n toggle.hidden = false;\n setIntervalMode(section.dataset.defaultBilling === 'yearly' ? 'yearly' : 'monthly');\n });\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
|
|
19
39
|
}
|
|
20
40
|
],
|
|
21
41
|
"gscan": {
|
|
22
42
|
"rules_satisfied": [
|
|
23
43
|
"GS010-PJ-VALID"
|
|
24
44
|
],
|
|
25
|
-
"notes": "Reads public Ghost tiers;
|
|
45
|
+
"notes": "Reads public Ghost tiers; progressive monthly/yearly toggle with zero-JS fallback."
|
|
26
46
|
},
|
|
27
47
|
"styleSlots": {
|
|
28
48
|
"class": [
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "reading-progress",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Thin scroll-linked reading progress bar tracking article scroll depth.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"parameters": {
|
|
8
|
+
"variant": {
|
|
9
|
+
"description": "Progress bar fill style.",
|
|
10
|
+
"options": [
|
|
11
|
+
"default",
|
|
12
|
+
"subtle",
|
|
13
|
+
"gradient"
|
|
14
|
+
],
|
|
15
|
+
"default": "default"
|
|
16
|
+
},
|
|
17
|
+
"size": {
|
|
18
|
+
"description": "Bar thickness (2px, 3px, or 5px).",
|
|
19
|
+
"options": [
|
|
20
|
+
"sm",
|
|
21
|
+
"default",
|
|
22
|
+
"lg"
|
|
23
|
+
],
|
|
24
|
+
"default": "default"
|
|
25
|
+
},
|
|
26
|
+
"contentSelector": {
|
|
27
|
+
"description": "CSS selector for the article element to track.",
|
|
28
|
+
"default": ".ghcn-article-content"
|
|
29
|
+
},
|
|
30
|
+
"ariaLabel": {
|
|
31
|
+
"description": "Accessible label for the progress bar.",
|
|
32
|
+
"default": "Reading progress"
|
|
33
|
+
},
|
|
34
|
+
"initialValue": {
|
|
35
|
+
"description": "Optional initial percentage (0-100) for static previews.",
|
|
36
|
+
"default": "0"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
{
|
|
41
|
+
"name": "reading-progress.hbs",
|
|
42
|
+
"type": "partial",
|
|
43
|
+
"target": "partials/components/reading-progress.hbs",
|
|
44
|
+
"content": "{{!-- Styling parameters: class, barClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-reading-progress{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-reading-progress data-variant=\"{{#match variant \"subtle\"}}subtle{{else}}{{#match variant \"gradient\"}}gradient{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" data-content-selector=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\">\n <progress class=\"ghcn-reading-progress__bar{{#if ghostcnStyles.barClass}} {{ghostcnStyles.barClass}}{{/if}}\" max=\"100\" value=\"{{#if initialValue}}{{initialValue}}{{else}}0{{/if}}\" aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}Reading progress{{/if}}\"></progress>\n</div>\n{{/with}}"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "reading-progress.css",
|
|
48
|
+
"type": "style",
|
|
49
|
+
"target": "assets/css/components/reading-progress.css",
|
|
50
|
+
"content": ".ghcn-reading-progress { box-sizing: border-box; position: sticky; top: 0; z-index: 40; width: 100%; height: 3px; background: color-mix(in srgb, var(--border) 60%, transparent); overflow: hidden; }\n.ghcn-reading-progress:where([data-size=\"sm\"]) { height: 2px; }\n.ghcn-reading-progress:where([data-size=\"lg\"]) { height: 5px; }\n.ghcn-reading-progress__bar { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; appearance: none; background: transparent; color: var(--primary); accent-color: var(--primary); }\n.ghcn-reading-progress__bar::-webkit-progress-bar { background: transparent; }\n.ghcn-reading-progress__bar::-webkit-progress-value { background: var(--primary); transition: width 80ms linear; }\n.ghcn-reading-progress__bar::-moz-progress-bar { background: var(--primary); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar { color: var(--muted-foreground); accent-color: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar::-webkit-progress-value { background: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar::-moz-progress-bar { background: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"gradient\"]) .ghcn-reading-progress__bar::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--foreground))); }\n.ghcn-reading-progress:where([data-variant=\"gradient\"]) .ghcn-reading-progress__bar::-moz-progress-bar { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--foreground))); }\n@media (prefers-reduced-motion: reduce) { .ghcn-reading-progress__bar::-webkit-progress-value { transition: none; } }\n"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "reading-progress.js",
|
|
54
|
+
"type": "js",
|
|
55
|
+
"target": "assets/js/components/reading-progress.js",
|
|
56
|
+
"content": "/* ghostcn reading progress: scroll-linked article progress bar, CSP-safe via native <progress>. */\n(() => {\n function init() {\n const widgets = [...document.querySelectorAll('[data-ghcn-reading-progress]')].filter(el => !el.dataset.ghcnProgressReady);\n if (!widgets.length) return;\n const entries = widgets.map(el => {\n el.dataset.ghcnProgressReady = 'true';\n let target = null;\n try { target = document.querySelector(el.dataset.contentSelector || '.ghcn-article-content'); } catch {}\n const bar = el.querySelector('progress');\n return bar ? { el, bar, target } : null;\n }).filter(Boolean);\n if (!entries.length) return;\n\n let frame = 0;\n const update = () => {\n frame = 0;\n const vh = window.innerHeight || 1;\n for (const { bar, target } of entries) {\n let ratio = 0;\n if (target) {\n const rect = target.getBoundingClientRect();\n if (rect.height <= vh) continue;\n ratio = Math.min(1, Math.max(0, -rect.top / Math.max(1, rect.height - vh)));\n } else {\n const doc = document.scrollingElement || document.documentElement;\n if (doc.scrollHeight <= doc.clientHeight + 4) continue;\n ratio = Math.min(1, Math.max(0, doc.scrollTop / Math.max(1, doc.scrollHeight - doc.clientHeight)));\n }\n const percent = Math.round(ratio * 100);\n bar.value = percent;\n bar.setAttribute('aria-valuenow', String(percent));\n }\n };\n const schedule = () => { if (!frame) frame = requestAnimationFrame(update); };\n update();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"gscan": {
|
|
60
|
+
"rules_satisfied": [
|
|
61
|
+
"GS010-PJ-VALID"
|
|
62
|
+
],
|
|
63
|
+
"notes": "Uses native <progress> element updated on scroll via requestAnimationFrame; zero inline styles."
|
|
64
|
+
},
|
|
65
|
+
"styleSlots": {
|
|
66
|
+
"class": [
|
|
67
|
+
".ghcn-reading-progress"
|
|
68
|
+
],
|
|
69
|
+
"barClass": [
|
|
70
|
+
".ghcn-reading-progress__bar"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
"description": "Related reading from the same primary tag, excluding the current post; recent posts when untagged.",
|
|
5
5
|
"dependencies": [],
|
|
6
6
|
"ghost_version": ">=5.0.0",
|
|
7
|
+
"parameters": {
|
|
8
|
+
"heading": {
|
|
9
|
+
"description": "Optional section heading override.",
|
|
10
|
+
"default": "Keep reading"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
"files": [
|
|
8
14
|
{
|
|
9
15
|
"name": "related-posts.hbs",
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "share-buttons",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Accessible article share links (Copy link, Bluesky, X, LinkedIn, Email, and native Web Share).",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"parameters": {
|
|
8
|
+
"variant": {
|
|
9
|
+
"description": "Button presentation (default pills, icon-only squares, or ghost buttons).",
|
|
10
|
+
"options": [
|
|
11
|
+
"default",
|
|
12
|
+
"icon",
|
|
13
|
+
"ghost"
|
|
14
|
+
],
|
|
15
|
+
"default": "default"
|
|
16
|
+
},
|
|
17
|
+
"size": {
|
|
18
|
+
"description": "Button scale.",
|
|
19
|
+
"options": [
|
|
20
|
+
"sm",
|
|
21
|
+
"default",
|
|
22
|
+
"lg"
|
|
23
|
+
],
|
|
24
|
+
"default": "default"
|
|
25
|
+
},
|
|
26
|
+
"heading": {
|
|
27
|
+
"description": "Optional label displayed before the share buttons."
|
|
28
|
+
},
|
|
29
|
+
"shareUrl": {
|
|
30
|
+
"description": "Optional URL override; defaults to current post absolute URL."
|
|
31
|
+
},
|
|
32
|
+
"shareTitle": {
|
|
33
|
+
"description": "Optional title override; defaults to current post title."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
{
|
|
38
|
+
"name": "share-buttons.hbs",
|
|
39
|
+
"type": "partial",
|
|
40
|
+
"target": "partials/components/share-buttons.hbs",
|
|
41
|
+
"content": "{{!-- Styling parameters: class, titleClass, listClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-share{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-share data-variant=\"{{#match variant \"icon\"}}icon{{else}}{{#match variant \"ghost\"}}ghost{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" data-share-url=\"{{#if shareUrl}}{{shareUrl}}{{else}}{{url absolute=\"true\"}}{{/if}}\" data-share-title=\"{{#if shareTitle}}{{shareTitle}}{{else}}{{title}}{{/if}}\">\n {{#if heading}}<span class=\"ghcn-share__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{heading}}</span>{{/if}}\n <div class=\"ghcn-share__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" role=\"group\" aria-label=\"{{#if heading}}{{heading}}{{else}}Share this post{{/if}}\">\n <button type=\"button\" class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-share-copy aria-label=\"Copy link\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M8.5 11.5a3.5 3.5 0 0 0 5 0l2-2a3.5 3.5 0 0 0-5-5l-1 1\"/><path d=\"M11.5 8.5a3.5 3.5 0 0 0-5 0l-2 2a3.5 3.5 0 0 0 5 5l1-1\"/></svg>\n <span class=\"ghcn-share__label\" data-copy-label>Copy link</span>\n </button>\n <a class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"https://bsky.app/intent/compose?text={{encode title}}%20{{encode (url absolute=\"true\")}}\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Share on Bluesky\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 10.5C8.5 7.4 5.5 4.2 3.6 3.3c-.9-.4-1.6.1-1.6 1.1 0 1 .4 4.2.9 5.3.7 1.4 2.2 1.8 3.6 1.6-2.4.4-4.1 1.7-2.2 4.1 2.2 2.7 4.7-.4 5.7-2.4 1 2 3.5 5.1 5.7 2.4 1.9-2.4.2-3.7-2.2-4.1 1.4.2 2.9-.2 3.6-1.6.5-1.1.9-4.3.9-5.3 0-1-.7-1.5-1.6-1.1-1.9.9-4.9 4.1-6.4 7.2Z\"/></svg>\n <span class=\"ghcn-share__label\">Bluesky</span>\n </a>\n <a class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"https://x.com/intent/tweet?text={{encode title}}&url={{encode (url absolute=\"true\")}}\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Share on X\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3.5 3.5 16.5 16.5M16.5 3.5 3.5 16.5\"/></svg>\n <span class=\"ghcn-share__label\">X</span>\n </a>\n <a class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"https://www.linkedin.com/sharing/share-offsite/?url={{encode (url absolute=\"true\")}}\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Share on LinkedIn\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"14\" height=\"14\" rx=\"2\"/><path d=\"M7 9v4.5M7 6.5v.01M10 13.5V9m0 1.5a2 2 0 0 1 3.5 1.3v1.7\"/></svg>\n <span class=\"ghcn-share__label\">LinkedIn</span>\n </a>\n <a class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"mailto:?subject={{encode title}}&body={{encode (url absolute=\"true\")}}\" aria-label=\"Share by email\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"2.5\" y=\"4.5\" width=\"15\" height=\"11\" rx=\"1.5\"/><path d=\"m3.5 5.5 6.5 5 6.5-5\"/></svg>\n <span class=\"ghcn-share__label\">Email</span>\n </a>\n <button type=\"button\" class=\"ghcn-share__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-share-native hidden aria-label=\"More share options\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 3v9M6.5 6.5 10 3l3.5 3.5M4 12.5v3a1.5 1.5 0 0 0 1.5 1.5h9a1.5 1.5 0 0 0 1.5-1.5v-3\"/></svg>\n <span class=\"ghcn-share__label\">Share</span>\n </button>\n </div>\n <span class=\"ghcn-share__status\" data-share-status role=\"status\" aria-live=\"polite\"></span>\n</div>\n{{/with}}"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "share-buttons.css",
|
|
45
|
+
"type": "style",
|
|
46
|
+
"target": "assets/css/components/share-buttons.css",
|
|
47
|
+
"content": ".ghcn-share { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }\n.ghcn-share *, .ghcn-share *::before, .ghcn-share *::after { box-sizing: border-box; }\n.ghcn-share__title { font-size: var(--ghcn-text-small, 14px); font-weight: 600; color: var(--muted-foreground); }\n.ghcn-share__list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n.ghcn-share__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--card); color: var(--foreground); font: inherit; font-size: var(--ghcn-text-meta, 13px); font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease; }\n.ghcn-share__btn[hidden] { display: none; }\n.ghcn-share__btn:hover { background: var(--muted); border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); }\n.ghcn-share:where([data-size=\"sm\"]) .ghcn-share__btn { min-height: 30px; padding: 4px 9px; font-size: 12px; }\n.ghcn-share:where([data-size=\"lg\"]) .ghcn-share__btn { min-height: 42px; padding: 8px 15px; font-size: 14px; }\n.ghcn-share:where([data-variant=\"icon\"]) .ghcn-share__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n.ghcn-share:where([data-variant=\"icon\"]) .ghcn-share__btn { width: 36px; padding: 0; }\n.ghcn-share:where([data-variant=\"icon\"][data-size=\"sm\"]) .ghcn-share__btn { width: 30px; }\n.ghcn-share:where([data-variant=\"icon\"][data-size=\"lg\"]) .ghcn-share__btn { width: 42px; }\n.ghcn-share:where([data-variant=\"ghost\"]) .ghcn-share__btn { border-color: transparent; background: transparent; color: var(--muted-foreground); }\n.ghcn-share:where([data-variant=\"ghost\"]) .ghcn-share__btn:hover { background: var(--muted); color: var(--foreground); }\n.ghcn-share__status { font-size: var(--ghcn-text-meta, 13px); color: var(--muted-foreground); }\n.ghcn-share__status:empty { display: none; }\n.ghcn-share:focus-visible, :where(.ghcn-share) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n@media (prefers-reduced-motion: reduce) { .ghcn-share__btn { transition: none; } }\n"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "share-buttons.js",
|
|
51
|
+
"type": "js",
|
|
52
|
+
"target": "assets/js/components/share-buttons.js",
|
|
53
|
+
"content": "/* ghostcn share buttons: copy-link feedback and native Web Share progressive enhancement. */\n(() => {\n function init() {\n document.querySelectorAll('[data-ghcn-share]').forEach(root => {\n if (root.dataset.ghcnShareReady) return;\n root.dataset.ghcnShareReady = 'true';\n const status = root.querySelector('[data-share-status]');\n const copyBtn = root.querySelector('[data-share-copy]');\n const nativeBtn = root.querySelector('[data-share-native]');\n const shareUrl = root.dataset.shareUrl || window.location.href;\n const shareTitle = root.dataset.shareTitle || document.title;\n\n if (copyBtn) {\n copyBtn.addEventListener('click', async () => {\n const label = copyBtn.querySelector('[data-copy-label]');\n try {\n if (navigator.clipboard?.writeText) {\n await navigator.clipboard.writeText(shareUrl);\n } else {\n const input = document.createElement('input');\n input.value = shareUrl;\n document.body.append(input);\n input.select();\n document.execCommand('copy');\n input.remove();\n }\n if (label) label.textContent = 'Copied';\n if (status) status.textContent = 'Link copied to clipboard.';\n setTimeout(() => {\n if (label) label.textContent = 'Copy link';\n if (status) status.textContent = '';\n }, 2000);\n } catch {\n if (status) status.textContent = 'Could not copy link automatically.';\n }\n });\n }\n\n if (nativeBtn && typeof navigator.share === 'function') {\n nativeBtn.hidden = false;\n nativeBtn.addEventListener('click', () => {\n navigator.share({ title: shareTitle, url: shareUrl }).catch(() => {});\n });\n }\n });\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"gscan": {
|
|
57
|
+
"rules_satisfied": [
|
|
58
|
+
"GS010-PJ-VALID"
|
|
59
|
+
],
|
|
60
|
+
"notes": "Uses native Ghost url and encode helpers with progressive Clipboard and Web Share API support."
|
|
61
|
+
},
|
|
62
|
+
"styleSlots": {
|
|
63
|
+
"class": [
|
|
64
|
+
".ghcn-share"
|
|
65
|
+
],
|
|
66
|
+
"titleClass": [
|
|
67
|
+
".ghcn-share__title"
|
|
68
|
+
],
|
|
69
|
+
"listClass": [
|
|
70
|
+
".ghcn-share__list"
|
|
71
|
+
],
|
|
72
|
+
"buttonClass": [
|
|
73
|
+
".ghcn-share__btn"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|