ghostcn 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -16
- package/dist/commands/add.js +42 -37
- package/dist/commands/create.d.ts +5 -0
- package/dist/commands/create.js +108 -0
- package/dist/commands/init.js +129 -26
- package/dist/commands/list.js +4 -4
- package/dist/index.js +9 -1
- package/dist/registry/components/author-card.json +2 -2
- package/dist/registry/components/featured-posts.json +27 -0
- package/dist/registry/components/member-cta.json +27 -0
- package/dist/registry/components/newsletter-form.json +9 -6
- package/dist/registry/components/pagination.json +28 -0
- package/dist/registry/components/post-card.json +2 -2
- package/dist/registry/components/post-header.json +27 -0
- package/dist/registry/components/pricing-table.json +2 -2
- package/dist/registry/components/site-footer.json +27 -0
- package/dist/registry/components/site-header.json +27 -0
- package/dist/registry/index.json +61 -1
- package/dist/utils/component-installer.d.ts +16 -0
- package/dist/utils/component-installer.js +59 -0
- package/dist/utils/registry.d.ts +1 -0
- package/dist/utils/registry.js +42 -19
- package/dist/utils/theme-files.d.ts +13 -0
- package/dist/utils/theme-files.js +104 -0
- package/dist/utils/theme-project.d.ts +29 -0
- package/dist/utils/theme-project.js +41 -0
- package/dist/utils/theme-scaffold.d.ts +21 -0
- package/dist/utils/theme-scaffold.js +288 -0
- package/dist/utils/theme.d.ts +46 -0
- package/dist/utils/theme.js +427 -0
- package/package.json +2 -1
- package/dist/test/registry.test.d.ts +0 -1
- package/dist/test/registry.test.js +0 -62
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "author-card.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/author-card.hbs",
|
|
12
|
-
"content": "{{
|
|
12
|
+
"content": "{{!--\n Component: Author Card\n Usage: In post context {{> \"components/author-card\"}} or {{#primary_author}}{{> \"components/author-card\"}}{{/primary_author}}\n--}}\n<section class=\"gh-author-card bg-card text-card-foreground border border-border rounded-ghostcn p-6 my-8 max-w-2xl mx-auto flex flex-col sm:flex-row items-center sm:items-start gap-5 shadow-sm\">\n {{#if profile_image}}\n <img src=\"{{img_url profile_image size=\"m\"}}\" alt=\"{{name}}\" class=\"gh-author-avatar w-20 h-20 rounded-full object-cover border-2 border-border shadow-sm\" />\n {{else}}\n <div class=\"gh-author-avatar-fallback w-20 h-20 rounded-full bg-muted text-foreground flex items-center justify-center font-bold text-2xl border-2 border-border shadow-sm\">\n {{name.[0]}}\n </div>\n {{/if}}\n\n <div class=\"gh-author-details flex-1 text-center sm:text-left\">\n <div class=\"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2\">\n <h4 class=\"gh-author-name text-xl font-bold tracking-tight text-foreground\">\n <a href=\"{{url}}\" class=\"hover:text-primary transition-colors\">{{name}}</a>\n </h4>\n {{#if count.posts}}\n <span class=\"gh-author-post-count text-xs text-muted-foreground bg-muted px-2.5 py-1 rounded-full font-medium\">\n {{plural count.posts empty=\"0 posts\" singular=\"% post\" plural=\"% posts\"}}\n </span>\n {{/if}}\n </div>\n\n {{#if bio}}\n <p class=\"gh-author-bio text-muted-foreground text-sm mb-4 leading-relaxed\">{{bio}}</p>\n {{/if}}\n\n <div class=\"gh-author-meta flex flex-wrap items-center justify-center sm:justify-start gap-4 text-xs text-muted-foreground\">\n {{#if location}}\n <span class=\"gh-author-location flex items-center gap-1\">📍 {{location}}</span>\n {{/if}}\n {{#if website}}\n <a href=\"{{website}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Website</a>\n {{/if}}\n {{#if twitter}}\n <a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Twitter/X</a>\n {{/if}}\n {{#if facebook}}\n <a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Facebook</a>\n {{/if}}\n </div>\n </div>\n</section>"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "author-card.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/author-card.css",
|
|
18
|
-
"content": "/*
|
|
18
|
+
"content": "/* ghostcn: Author Card Styles */\n.gh-author-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 1.5em;\n margin: 2em auto;\n max-width: 42em;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25em;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-card *,\n.gh-author-card *::before,\n.gh-author-card *::after {\n box-sizing: border-box;\n}\n\n@media (min-width: 640px) {\n .gh-author-card {\n flex-direction: row;\n align-items: flex-start;\n }\n}\n\n.gh-author-avatar {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n object-fit: cover;\n border: 2px solid var(--border, #e4e4e7);\n}\n\n.gh-author-avatar-fallback {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n background-color: var(--muted, #f4f4f5);\n color: var(--foreground, #09090b);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5em;\n font-weight: 700;\n border: 2px solid var(--border, #e4e4e7);\n}\n\n.gh-author-details {\n flex: 1;\n text-align: center;\n}\n\n@media (min-width: 640px) {\n .gh-author-details {\n text-align: left;\n }\n}\n\n.gh-author-name {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0;\n}\n\n.gh-author-name a {\n color: var(--foreground, #09090b);\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-author-name a:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-author-bio {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0.5em 0 1em;\n}\n\n.gh-author-meta {\n display: flex;\n flex-wrap: wrap;\n gap: 1em;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-author-meta a {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n text-decoration: none;\n}\n\n.gh-author-meta a:hover {\n text-decoration: underline;\n}\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "featured-posts",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Responsive homepage hero populated from Ghost featured posts.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "featured-posts.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/featured-posts.hbs",
|
|
12
|
+
"content": "{{!-- 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 ghcn-container\" aria-labelledby=\"ghcn-featured-title\">\n <div class=\"ghcn-featured__heading\">\n <div><span class=\"ghcn-badge\">Featured</span><h2 id=\"ghcn-featured-title\">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\">\n {{#foreach posts}}\n <article class=\"ghcn-featured__card{{#has index=\"0\"}} ghcn-featured__card--lead{{/has}}\">\n <a class=\"ghcn-featured__image\" href=\"{{url}}\">\n {{#if feature_image}}<img src=\"{{img_url feature_image size=\"l\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" loading=\"{{#has index=\"0\"}}eager{{else}}lazy{{/has}}\" />{{/if}}\n </a>\n <div class=\"ghcn-featured__content\">\n <div class=\"ghcn-featured__meta\">{{#if primary_tag}}<a href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a><span>•</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}}"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "featured-posts.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/featured-posts.css",
|
|
18
|
+
"content": "/* ghostcn: Featured Posts */\n.ghcn-featured { box-sizing: border-box; margin-block: 3em; color: var(--foreground); font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\n.ghcn-featured *, .ghcn-featured *::before, .ghcn-featured *::after { box-sizing: border-box; }\n.ghcn-featured__heading { display: flex; align-items: end; justify-content: space-between; gap: 1em; margin-bottom: 1.25em; }\n.ghcn-featured__heading h2 { margin: 0.75em 0 0; font-size: clamp(1.75em,4vw,2.5em); line-height: 1.05; letter-spacing: -0.04em; }\n.ghcn-featured__heading > a { color: var(--muted-foreground); font-size: 0.875em; font-weight: 600; text-decoration: none; }\n.ghcn-featured__grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(15em,1fr); gap: 1em; }\n.ghcn-featured__card { position: relative; min-height: 15em; overflow: hidden; border-radius: min(var(--radius),1.25em); background: var(--muted); }\n.ghcn-featured__card--lead { grid-row: span 2; min-height: 31em; }\n.ghcn-featured__image, .ghcn-featured__image::after { position: absolute; inset: 0; }\n.ghcn-featured__image::after { content: \"\"; background: linear-gradient(to top,rgba(0,0,0,.82),rgba(0,0,0,.02) 70%); }\n.ghcn-featured__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }\n.ghcn-featured__card:hover img { transform: scale(1.025); }\n.ghcn-featured__content { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; padding: 1.25em; color: #fff; }\n.ghcn-featured__card--lead .ghcn-featured__content { padding: 2em; }\n.ghcn-featured__meta { display: flex; gap: 0.5em; margin-bottom: 0.5em; color: rgba(255,255,255,.78); font-size: 0.75em; }\n.ghcn-featured__meta a, .ghcn-featured h3 a { color: inherit; text-decoration: none; }\n.ghcn-featured h3 { margin: 0; font-size: 1.25em; line-height: 1.15; letter-spacing: -0.025em; }\n.ghcn-featured__card--lead h3 { font-size: clamp(1.75em,4vw,3em); }\n.ghcn-featured__content p { max-width: 42em; margin: 0.75em 0 0; color: rgba(255,255,255,.82); }\n@media (max-width: 720px) { .ghcn-featured__grid { grid-template-columns: 1fr; } .ghcn-featured__card--lead { grid-row: auto; min-height: 25em; } }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses the Ghost get helper and featured post filter."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "member-cta",
|
|
3
|
+
"type": "components:members",
|
|
4
|
+
"description": "Context-aware member CTA for visitors, free members, paid members, and protected posts.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "member-cta.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/member-cta.hbs",
|
|
12
|
+
"content": "{{!-- Component: Member CTA | Usage: inside {{#post}} after {{content}} --}}\n<aside class=\"ghcn-member-cta\">\n {{#if access}}\n {{#if @member}}\n <span class=\"ghcn-badge\">Member access</span>\n <h2>You’re all caught up</h2>\n <p>Manage your subscription, email preferences, and account details in Portal.</p>\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Manage account</a>\n {{else}}\n <span class=\"ghcn-badge\">Join the publication</span>\n <h2>Enjoying this story?</h2>\n <p>Subscribe for new posts and member updates delivered directly to your inbox.</p>\n <div class=\"ghcn-member-cta__actions\"><a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a><a class=\"ghcn-button ghcn-button--ghost\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a></div>\n {{/if}}\n {{else}}\n {{#if @member.paid}}\n <span class=\"ghcn-badge\">Account required</span>\n <h2>This post isn’t included in your plan</h2>\n <p>Open your account to review your membership and available plans.</p>\n <a class=\"ghcn-button\" href=\"#/portal/account/plans\" data-portal=\"account/plans\">View plans</a>\n {{else if @member}}\n <span class=\"ghcn-badge\">Paid members</span>\n <h2>Upgrade to continue reading</h2>\n <p>Become a paid member to unlock this post and the complete archive.</p>\n <a class=\"ghcn-button\" href=\"#/portal/account/plans\" data-portal=\"account/plans\">Upgrade membership</a>\n {{else}}\n <span class=\"ghcn-badge\">Members only</span>\n <h2>Continue reading with a membership</h2>\n <p>Sign up to unlock this post. Already a member? Sign in to continue.</p>\n <div class=\"ghcn-member-cta__actions\"><a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Become a member</a><a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a></div>\n {{/if}}\n {{/if}}\n</aside>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "member-cta.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/member-cta.css",
|
|
18
|
+
"content": "/* ghostcn: Member CTA */\n.ghcn-member-cta { box-sizing: border-box; max-width: 44em; margin: 3em auto; overflow: hidden; border: 1px solid var(--border); border-radius: min(var(--radius),1.25em); padding: clamp(1.5em,5vw,3em); color: var(--card-foreground); background: radial-gradient(circle at top right,color-mix(in srgb,var(--primary) 18%,transparent),transparent 48%),var(--card); text-align: center; font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\n.ghcn-member-cta *, .ghcn-member-cta *::before, .ghcn-member-cta *::after { box-sizing: border-box; }\n.ghcn-member-cta h2 { margin: 1em 0 0.625em; color: var(--foreground); font-size: clamp(1.5em,4vw,2.25em); line-height: 1.1; letter-spacing: -0.035em; }\n.ghcn-member-cta p { max-width: 34em; margin: 0 auto 1.5em; color: var(--muted-foreground); }\n.ghcn-member-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75em; }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses post access, member state, paid status, and native Portal triggers."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newsletter-form",
|
|
3
3
|
"type": "components:ui",
|
|
4
|
-
"description": "A native Ghost members subscription form.",
|
|
4
|
+
"description": "A native Ghost members subscription form with state handling.",
|
|
5
5
|
"dependencies": [],
|
|
6
6
|
"ghost_version": ">=5.0.0",
|
|
7
7
|
"files": [
|
|
@@ -9,17 +9,20 @@
|
|
|
9
9
|
"name": "newsletter-form.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/newsletter-form.hbs",
|
|
12
|
-
"content": "{{
|
|
12
|
+
"content": "{{!--\n Component: Newsletter Form\n Usage: {{> \"components/newsletter-form\" title=\"Subscribe to our newsletter\" description=\"Get the latest posts delivered right to your inbox.\"}}\n--}}\n<section class=\"gh-newsletter-form bg-card text-card-foreground border border-border p-8 rounded-ghostcn text-center max-w-2xl mx-auto my-8 shadow-sm\">\n <div class=\"mb-6\">\n <h3 class=\"gh-newsletter-title text-2xl font-bold tracking-tight mb-2 text-foreground\">\n {{#if title}}{{title}}{{else}}Subscribe to our newsletter{{/if}}\n </h3>\n <p class=\"gh-newsletter-desc text-muted-foreground max-w-md mx-auto text-sm leading-relaxed\">\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 <form data-members-form=\"subscribe\" class=\"gh-newsletter-fields flex flex-col sm:flex-row gap-3 max-w-md mx-auto relative\">\n <label for=\"gh-email\" class=\"sr-only\">Email address</label>\n <input\n data-members-email\n type=\"email\"\n id=\"gh-email\"\n required\n placeholder=\"jamie@example.com\"\n class=\"gh-newsletter-input flex-1 px-4 py-2.5 bg-background text-foreground border border-input rounded-ghostcn text-sm focus:outline-none focus:ring-2 focus:ring-ring transition-shadow\"\n />\n <button type=\"submit\" class=\"gh-newsletter-btn bg-primary text-primary-foreground px-6 py-2.5 rounded-ghostcn text-sm font-medium hover:opacity-90 transition-opacity flex items-center justify-center shadow-sm\">\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 hidden absolute -bottom-7 left-0 right-0 text-xs text-green-600 dark:text-green-400 font-medium\" data-members-success>\n ✓ Check your inbox to confirm your subscription!\n </div>\n <div class=\"gh-newsletter-msg-error message-error hidden absolute -bottom-7 left-0 right-0 text-xs text-red-600 dark:text-red-400 font-medium\" data-members-error>\n ✕ Please enter a valid email address.\n </div>\n </form>\n</section>"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "newsletter-form.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/newsletter-form.css",
|
|
18
|
-
"content": "/*
|
|
18
|
+
"content": "/* ghostcn: Newsletter Form Styles */\n.gh-newsletter-form {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 2em;\n text-align: center;\n max-width: 42em;\n margin: 2em auto;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-newsletter-form *,\n.gh-newsletter-form *::before,\n.gh-newsletter-form *::after {\n box-sizing: border-box;\n}\n\n.gh-newsletter-title {\n font-size: 1.5em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin-bottom: 0.5em;\n color: var(--foreground, #09090b);\n}\n\n.gh-newsletter-desc {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0 auto 1.5em;\n max-width: 28em;\n}\n\n.gh-newsletter-fields {\n display: flex;\n flex-direction: column;\n gap: 0.75em;\n max-width: 28em;\n margin: 0 auto;\n position: relative;\n}\n\n@media (min-width: 640px) {\n .gh-newsletter-fields {\n flex-direction: row;\n }\n}\n\n.gh-newsletter-input {\n flex: 1;\n padding: 0.625em 1em;\n background-color: var(--background, #ffffff);\n color: var(--foreground, #09090b);\n border: 1px solid var(--input, #e4e4e7);\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n outline: none;\n transition: box-shadow 0.15s ease, border-color 0.15s ease;\n}\n\n.gh-newsletter-input:focus {\n border-color: var(--ring, #18181b);\n box-shadow: 0 0 0 2px var(--ring, #18181b);\n}\n\n.gh-newsletter-btn {\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n padding: 0.625em 1.5em;\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n font-weight: 500;\n border: none;\n cursor: pointer;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition: opacity 0.15s ease;\n}\n\n.gh-newsletter-btn:hover {\n opacity: 0.9;\n}\n\n.gh-newsletter-msg-success,\n.gh-newsletter-msg-error {\n display: none;\n position: absolute;\n bottom: -1.75em;\n left: 0;\n right: 0;\n font-size: 0.75em;\n font-weight: 500;\n}\n\n.gh-newsletter-fields.success .gh-newsletter-msg-success,\n.gh-newsletter-fields.error .gh-newsletter-msg-error {\n display: block;\n}\n\n.gh-newsletter-form .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.gh-newsletter-msg-success {\n color: #16a34a;\n}\n\n.gh-newsletter-msg-error {\n color: #dc2626;\n}\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
22
|
-
"rules_satisfied": [
|
|
23
|
-
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID",
|
|
24
|
+
"GS050-MEMBERS-FORM"
|
|
25
|
+
],
|
|
26
|
+
"notes": "Uses Ghost's native data-members-form attributes. No custom JS required."
|
|
24
27
|
}
|
|
25
|
-
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pagination",
|
|
3
|
+
"type": "components:navigation",
|
|
4
|
+
"description": "Accessible, responsive replacement for Ghost’s native pagination markup.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "pagination.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/pagination.hbs",
|
|
12
|
+
"placement": "theme",
|
|
13
|
+
"content": "<nav class=\"ghcn-pagination\" role=\"navigation\" aria-label=\"Pagination\">\n <div class=\"ghcn-pagination__side\">{{#if prev}}<a class=\"ghcn-button ghcn-button--outline\" href=\"{{page_url prev}}\" rel=\"prev\"><span aria-hidden=\"true\">←</span> Newer</a>{{/if}}</div>\n <span class=\"ghcn-pagination__status\">Page <strong>{{page}}</strong> of <strong>{{pages}}</strong></span>\n <div class=\"ghcn-pagination__side ghcn-pagination__side--end\">{{#if next}}<a class=\"ghcn-button ghcn-button--outline\" href=\"{{page_url next}}\" rel=\"next\">Older <span aria-hidden=\"true\">→</span></a>{{/if}}</div>\n</nav>"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "pagination.css",
|
|
17
|
+
"type": "style",
|
|
18
|
+
"target": "assets/css/components/pagination.css",
|
|
19
|
+
"content": "/* ghostcn: Pagination */\n.ghcn-pagination { box-sizing: border-box; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1em; width: min(100% - 2em,72em); margin: 3em auto; color: var(--foreground); font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\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: 0.8125em; }\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
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"gscan": {
|
|
23
|
+
"rules_satisfied": [
|
|
24
|
+
"GS010-PJ-VALID"
|
|
25
|
+
],
|
|
26
|
+
"notes": "Installs as partials/pagination.hbs so the native pagination helper uses it."
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "post-card.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/post-card.hbs",
|
|
12
|
-
"content": "{{
|
|
12
|
+
"content": "{{!--\n Component: Post Card\n Usage: Inside {{#foreach posts}} ... {{> \"components/post-card\"}} ... {{/foreach}}\n--}}\n<article class=\"gh-post-card group bg-card text-card-foreground border border-border rounded-ghostcn overflow-hidden hover:shadow-lg transition-all duration-200 flex flex-col\">\n {{#if feature_image}}\n <a href=\"{{url}}\" class=\"gh-post-card-image block aspect-video overflow-hidden bg-muted\">\n <img src=\"{{img_url feature_image size=\"m\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" class=\"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300\" loading=\"lazy\" />\n </a>\n {{/if}}\n\n <div class=\"gh-post-card-content p-5 flex-1 flex flex-col justify-between\">\n <div>\n <div class=\"flex items-center gap-2 mb-2 text-xs font-semibold\">\n {{#if primary_tag}}\n <a href=\"{{primary_tag.url}}\" class=\"gh-post-card-tag text-primary uppercase tracking-wider hover:underline\">{{primary_tag.name}}</a>\n <span class=\"text-muted-foreground/40\">•</span>\n {{/if}}\n <span class=\"gh-post-card-reading-time text-muted-foreground\">{{reading_time}}</span>\n </div>\n\n <h3 class=\"gh-post-card-title text-xl font-bold tracking-tight text-foreground mb-2 leading-snug group-hover:text-primary transition-colors\">\n <a href=\"{{url}}\">{{title}}</a>\n </h3>\n\n {{#if excerpt}}\n <p class=\"gh-post-card-excerpt text-muted-foreground text-sm line-clamp-3 mb-4 leading-relaxed\">{{excerpt words=\"25\"}}</p>\n {{/if}}\n </div>\n\n <div class=\"gh-post-card-footer pt-4 border-t border-border flex items-center justify-between text-xs text-muted-foreground\">\n <div class=\"flex items-center gap-2 font-medium\">\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>"
|
|
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": "/*
|
|
18
|
+
"content": "/* ghostcn: Post Card Styles */\n.gh-post-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-post-card *,\n.gh-post-card *::before,\n.gh-post-card *::after {\n box-sizing: border-box;\n}\n\n.gh-post-card:hover {\n transform: translateY(-2px);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.gh-post-card-image {\n aspect-ratio: 16 / 9;\n overflow: hidden;\n display: block;\n background-color: var(--muted, #f4f4f5);\n}\n\n.gh-post-card-image img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n transition: transform 0.3s ease;\n}\n\n.gh-post-card:hover .gh-post-card-image img {\n transform: scale(1.03);\n}\n\n.gh-post-card-content {\n padding: 1.25em;\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.gh-post-card-tag {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n font-size: 0.75em;\n font-weight: 600;\n text-decoration: none;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n\n.gh-post-card-tag:hover {\n text-decoration: underline;\n}\n\n.gh-post-card-title {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0.5em 0;\n line-height: 1.35;\n}\n\n.gh-post-card-title a {\n color: var(--foreground, #09090b);\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-post-card-title a:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-post-card-excerpt {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin-bottom: 1em;\n}\n\n.gh-post-card-footer {\n padding-top: 1em;\n border-top: 1px solid var(--border, #e4e4e7);\n display: flex;\n justify-content: space-between;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "post-header",
|
|
3
|
+
"type": "components:content",
|
|
4
|
+
"description": "Editorial post heading with tags, author metadata, reading time, and responsive feature image.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "post-header.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/post-header.hbs",
|
|
12
|
+
"content": "{{!-- Component: Post Header | Usage: inside {{#post}} --}}\n<header class=\"ghcn-post-header ghcn-container\">\n {{#if primary_tag}}<a class=\"ghcn-badge\" href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a>{{/if}}\n <h1>{{title}}</h1>\n {{#if custom_excerpt}}<p class=\"ghcn-post-header__excerpt\">{{custom_excerpt}}</p>{{/if}}\n <div class=\"ghcn-post-header__meta\">\n {{#primary_author}}\n <a class=\"ghcn-post-header__author\" href=\"{{url}}\">\n {{#if profile_image}}<img class=\"ghcn-avatar\" src=\"{{img_url profile_image size=\"xs\"}}\" alt=\"\" />{{/if}}\n <span>{{name}}</span>\n </a>\n {{/primary_author}}\n <span aria-hidden=\"true\">•</span>\n <time datetime=\"{{date format=\"YYYY-MM-DD\"}}\">{{date format=\"D MMM YYYY\"}}</time>\n <span aria-hidden=\"true\">•</span>\n <span>{{reading_time}}</span>\n </div>\n {{#if feature_image}}\n <figure class=\"ghcn-post-header__media\">\n <img srcset=\"{{img_url feature_image size=\"s\"}} 400w, {{img_url feature_image size=\"m\"}} 750w, {{img_url feature_image size=\"l\"}} 1200w, {{img_url feature_image size=\"xl\"}} 2000w\" sizes=\"(min-width: 1200px) 1120px, 92vw\" src=\"{{img_url feature_image size=\"xl\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" />\n {{#if feature_image_caption}}<figcaption>{{feature_image_caption}}</figcaption>{{/if}}\n </figure>\n {{/if}}\n</header>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "post-header.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/post-header.css",
|
|
18
|
+
"content": "/* ghostcn: Post Header */\n.ghcn-post-header { box-sizing: border-box; margin-block: 4em 2.5em; color: var(--foreground); text-align: center; font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\n.ghcn-post-header *, .ghcn-post-header *::before, .ghcn-post-header *::after { box-sizing: border-box; }\n.ghcn-post-header h1 { max-width: 58em; margin: 1em auto; font-size: clamp(2.5em,7vw,5em); line-height: 0.98; letter-spacing: -0.055em; text-wrap: balance; }\n.ghcn-post-header__excerpt { max-width: 44em; margin: 1.25em auto; color: var(--muted-foreground); font-size: clamp(1.05em,2vw,1.25em); }\n.ghcn-post-header__meta, .ghcn-post-header__author { display: flex; align-items: center; justify-content: center; gap: 0.625em; }\n.ghcn-post-header__meta { flex-wrap: wrap; color: var(--muted-foreground); font-size: 0.8125em; }\n.ghcn-post-header__author { color: var(--foreground); font-weight: 700; text-decoration: none; }\n.ghcn-post-header__author .ghcn-avatar { width: 2em; height: 2em; }\n.ghcn-post-header__media { margin: 3em 0 0; }\n.ghcn-post-header__media img { display: block; width: 100%; max-height: 44em; border-radius: min(var(--radius),1.25em); object-fit: cover; }\n.ghcn-post-header__media figcaption { margin-top: 0.75em; color: var(--muted-foreground); font-size: 0.75em; }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses native post, author, image, tag, date, and reading-time data."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"name": "pricing-table.hbs",
|
|
10
10
|
"type": "partial",
|
|
11
11
|
"target": "partials/components/pricing-table.hbs",
|
|
12
|
-
"content": "{{
|
|
12
|
+
"content": "{{!--\n Component: Pricing Table\n Usage: {{> \"components/pricing-table\" title=\"Choose your plan\"}}\n--}}\n<section class=\"gh-pricing bg-background py-12 px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto my-8\">\n <div class=\"text-center mb-12\">\n <h2 class=\"gh-pricing-title text-3xl font-extrabold tracking-tight text-foreground mb-3\">\n {{#if title}}{{title}}{{else}}Choose the right plan for you{{/if}}\n </h2>\n <p class=\"gh-pricing-desc text-muted-foreground text-base max-w-xl mx-auto\">\n {{#if description}}{{description}}{{else}}Unlock unlimited access to exclusive content, newsletters, and member-only discussions.{{/if}}\n </p>\n </div>\n\n <div class=\"gh-pricing-grid grid grid-cols-1 md:grid-cols-3 gap-8 items-stretch\">\n {{!-- Free Tier --}}\n <div class=\"gh-pricing-card bg-card text-card-foreground border border-border rounded-ghostcn p-6 flex flex-col justify-between shadow-sm hover:shadow-md transition-shadow\">\n <div>\n <h3 class=\"text-xl font-bold text-foreground mb-1\">Free</h3>\n <p class=\"text-muted-foreground text-sm mb-4\">Preview public posts</p>\n <div class=\"text-3xl font-extrabold text-foreground mb-6\">$0 <span class=\"text-sm font-normal text-muted-foreground\">/ forever</span></div>\n <ul class=\"space-y-3 text-sm text-muted-foreground mb-6\">\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Access to public posts</li>\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Regular email newsletters</li>\n </ul>\n </div>\n <a href=\"#/portal/signup/free\" data-portal=\"signup/free\" class=\"gh-pricing-btn block w-full text-center py-2.5 px-4 rounded-ghostcn text-sm font-medium border border-input text-foreground bg-background hover:bg-muted transition-colors\">\n Sign up free\n </a>\n </div>\n\n {{!-- Monthly Tier (Featured) --}}\n <div class=\"gh-pricing-card gh-pricing-card-featured bg-card text-card-foreground border-2 border-primary rounded-ghostcn p-6 flex flex-col justify-between shadow-lg relative\">\n <span class=\"gh-pricing-badge absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground text-xs font-semibold px-3 py-1 rounded-full uppercase tracking-wider shadow-sm\">\n Most Popular\n </span>\n <div>\n <h3 class=\"text-xl font-bold text-foreground mb-1\">Monthly</h3>\n <p class=\"text-muted-foreground text-sm mb-4\">Full access billed monthly</p>\n <div class=\"text-3xl font-extrabold text-primary mb-6\">$5 <span class=\"text-sm font-normal text-muted-foreground\">/ month</span></div>\n <ul class=\"space-y-3 text-sm text-muted-foreground mb-6\">\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Full archive access</li>\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Member-only newsletter</li>\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Community discussions</li>\n </ul>\n </div>\n <a href=\"#/portal/signup/monthly\" data-portal=\"signup/monthly\" class=\"gh-pricing-btn gh-pricing-btn-primary block w-full text-center py-2.5 px-4 rounded-ghostcn text-sm font-medium text-primary-foreground bg-primary hover:opacity-90 transition-opacity shadow-sm\">\n Subscribe monthly\n </a>\n </div>\n\n {{!-- Annual Tier --}}\n <div class=\"gh-pricing-card bg-card text-card-foreground border border-border rounded-ghostcn p-6 flex flex-col justify-between shadow-sm hover:shadow-md transition-shadow\">\n <div>\n <h3 class=\"text-xl font-bold text-foreground mb-1\">Annual</h3>\n <p class=\"text-muted-foreground text-sm mb-4\">Save 20% with annual billing</p>\n <div class=\"text-3xl font-extrabold text-foreground mb-6\">$48 <span class=\"text-sm font-normal text-muted-foreground\">/ year</span></div>\n <ul class=\"space-y-3 text-sm text-muted-foreground mb-6\">\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> Everything in Monthly</li>\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> 2 months free included</li>\n <li class=\"flex items-center gap-2\"><span class=\"text-primary font-bold\">✓</span> VIP priority support</li>\n </ul>\n </div>\n <a href=\"#/portal/signup/yearly\" data-portal=\"signup/yearly\" class=\"gh-pricing-btn block w-full text-center py-2.5 px-4 rounded-ghostcn text-sm font-medium border border-input text-foreground bg-background hover:bg-muted transition-colors\">\n Subscribe yearly\n </a>\n </div>\n </div>\n</section>"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "pricing-table.css",
|
|
16
16
|
"type": "style",
|
|
17
17
|
"target": "assets/css/components/pricing-table.css",
|
|
18
|
-
"content": "/*
|
|
18
|
+
"content": "/* ghostcn: Pricing Table Styles */\n.gh-pricing {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n max-width: 64em;\n margin: 2em auto;\n padding: 2em 1em;\n}\n\n.gh-pricing *,\n.gh-pricing *::before,\n.gh-pricing *::after {\n box-sizing: border-box;\n}\n\n.gh-pricing-title {\n font-size: 1.875em;\n font-weight: 800;\n letter-spacing: -0.025em;\n text-align: center;\n color: var(--foreground, #09090b);\n margin-bottom: 0.75em;\n}\n\n.gh-pricing-desc {\n text-align: center;\n color: var(--muted-foreground, #71717a);\n margin-bottom: 2.5em;\n}\n\n.gh-pricing-grid {\n display: grid;\n grid-template-columns: 1fr;\n gap: 2em;\n}\n\n@media (min-width: 768px) {\n .gh-pricing-grid {\n grid-template-columns: repeat(3, 1fr);\n }\n}\n\n.gh-pricing-card {\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 1.5em;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n position: relative;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n transition: box-shadow 0.2s ease;\n}\n\n.gh-pricing-card:hover {\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n}\n\n.gh-pricing-card-featured {\n border: 2px solid var(--primary, var(--ghost-accent-color, #18181b));\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n}\n\n.gh-pricing-badge {\n position: absolute;\n top: -0.75em;\n left: 50%;\n transform: translateX(-50%);\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n font-size: 0.75em;\n font-weight: 600;\n padding: 0.25em 0.75em;\n border-radius: 9999px;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n}\n\n.gh-pricing-btn {\n display: block;\n width: 100%;\n text-align: center;\n padding: 0.625em 1em;\n border-radius: var(--radius, 0.5em);\n font-size: 0.875em;\n font-weight: 500;\n text-decoration: none;\n border: 1px solid var(--input, #e4e4e7);\n color: var(--foreground, #09090b);\n background-color: var(--background, #ffffff);\n margin-top: 1.5em;\n transition: background-color 0.15s ease;\n}\n\n.gh-pricing-btn:hover {\n background-color: var(--muted, #f4f4f5);\n}\n\n.gh-pricing-btn-primary {\n background-color: var(--primary, var(--ghost-accent-color, #18181b));\n border-color: var(--primary, var(--ghost-accent-color, #18181b));\n color: var(--primary-foreground, #ffffff);\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-pricing-btn-primary:hover {\n opacity: 0.9;\n}\n"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"gscan": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "site-footer",
|
|
3
|
+
"type": "components:layout",
|
|
4
|
+
"description": "Publication footer with secondary navigation, social links, and Ghost attribution.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "site-footer.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/site-footer.hbs",
|
|
12
|
+
"content": "{{!-- Component: Site Footer | Usage: {{> \"components/site-footer\"}} --}}\n<footer class=\"ghcn-footer\">\n <div class=\"ghcn-footer__inner ghcn-container\">\n <div class=\"ghcn-footer__brand\">\n <a href=\"{{@site.url}}\">{{@site.title}}</a>\n {{#if @site.description}}<p>{{@site.description}}</p>{{/if}}\n </div>\n <nav class=\"ghcn-footer__nav\" aria-label=\"Footer navigation\">{{navigation type=\"secondary\"}}</nav>\n <div class=\"ghcn-footer__social\">\n {{#if @site.facebook}}<a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener\">Facebook</a>{{/if}}\n {{#if @site.twitter}}<a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener\">X</a>{{/if}}\n <a href=\"{{@site.url}}/rss/\">RSS</a>\n </div>\n </div>\n <div class=\"ghcn-footer__legal ghcn-container\">\n <span>© {{date format=\"YYYY\"}} {{@site.title}}</span>\n <span>Published with <a href=\"https://ghost.org\" target=\"_blank\" rel=\"noopener\">Ghost</a></span>\n </div>\n</footer>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "site-footer.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/site-footer.css",
|
|
18
|
+
"content": "/* ghostcn: Site Footer */\n.ghcn-footer { box-sizing: border-box; border-top: 1px solid var(--border); color: var(--foreground); background: var(--card); font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\n.ghcn-footer *, .ghcn-footer *::before, .ghcn-footer *::after { box-sizing: border-box; }\n.ghcn-footer__inner { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) auto; gap: 3em; padding-block: 3em; }\n.ghcn-footer__brand a { color: var(--foreground); font-size: 1.125em; font-weight: 800; text-decoration: none; }\n.ghcn-footer__brand p { max-width: 30em; margin: 0.5em 0 0; color: var(--muted-foreground); font-size: 0.875em; }\n.ghcn-footer .nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.5em 1.5em; margin: 0; padding: 0; list-style: none; }\n.ghcn-footer a { color: var(--muted-foreground); font-size: 0.875em; text-decoration: none; }\n.ghcn-footer a:hover { color: var(--foreground); }\n.ghcn-footer__social { display: flex; flex-direction: column; gap: 0.5em; }\n.ghcn-footer__legal { display: flex; justify-content: space-between; gap: 1em; border-top: 1px solid var(--border); padding-block: 1.25em; color: var(--muted-foreground); font-size: 0.75em; }\n@media (max-width: 720px) { .ghcn-footer__inner { grid-template-columns: 1fr; gap: 2em; } .ghcn-footer__social { flex-direction: row; flex-wrap: wrap; } }\n@media (max-width: 480px) { .ghcn-footer__legal { align-items: flex-start; flex-direction: column; } }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses Ghost secondary navigation and site globals."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "site-header",
|
|
3
|
+
"type": "components:layout",
|
|
4
|
+
"description": "Responsive Ghost navigation with search, member actions, and an accessible mobile menu.",
|
|
5
|
+
"dependencies": [],
|
|
6
|
+
"ghost_version": ">=5.0.0",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"name": "site-header.hbs",
|
|
10
|
+
"type": "partial",
|
|
11
|
+
"target": "partials/components/site-header.hbs",
|
|
12
|
+
"content": "{{!-- Component: Site Header | Usage: {{> \"components/site-header\"}} --}}\n<header class=\"ghcn-header\">\n <div class=\"ghcn-header__inner ghcn-container\">\n <a class=\"ghcn-header__brand\" href=\"{{@site.url}}\" aria-label=\"{{@site.title}} home\">\n {{#if @site.logo}}\n <img src=\"{{@site.logo}}\" alt=\"{{@site.title}}\" />\n {{else}}\n <span>{{@site.title}}</span>\n {{/if}}\n </a>\n\n <nav class=\"ghcn-header__nav\" aria-label=\"Primary navigation\">{{navigation}}</nav>\n\n <div class=\"ghcn-header__actions\">\n {{search}}\n {{#if @member}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-header__signin\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n <a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n </div>\n\n <details class=\"ghcn-header__mobile\">\n <summary class=\"ghcn-icon-button ghcn-button--outline\" aria-label=\"Open navigation\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\"><path d=\"M4 7h16M4 12h16M4 17h16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n </summary>\n <div class=\"ghcn-header__panel\">\n <nav aria-label=\"Mobile navigation\">{{navigation}}</nav>\n <div class=\"ghcn-header__mobile-actions\">\n {{search}}\n {{#if @member}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/account\" data-portal=\"account\">Account</a>\n {{else}}\n <a class=\"ghcn-button ghcn-button--outline\" href=\"#/portal/signin\" data-portal=\"signin\">Sign in</a>\n <a class=\"ghcn-button\" href=\"#/portal/signup\" data-portal=\"signup\">Subscribe</a>\n {{/if}}\n </div>\n </div>\n </details>\n </div>\n</header>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "site-header.css",
|
|
16
|
+
"type": "style",
|
|
17
|
+
"target": "assets/css/components/site-header.css",
|
|
18
|
+
"content": "/* ghostcn: Site Header */\n.ghcn-header { box-sizing: border-box; position: relative; z-index: 30; border-bottom: 1px solid var(--border); color: var(--foreground); background: color-mix(in srgb, var(--background) 92%, transparent); font-family: inherit; font-size: 16px; line-height: 1.5; isolation: isolate; }\n.ghcn-header *, .ghcn-header *::before, .ghcn-header *::after { box-sizing: border-box; }\n.ghcn-header__inner { display: flex; min-height: 4.5em; align-items: center; gap: 1.5em; }\n.ghcn-header__brand { display: inline-flex; flex: 0 0 auto; align-items: center; color: var(--foreground); font-size: 1.125em; font-weight: 800; letter-spacing: -0.025em; text-decoration: none; }\n.ghcn-header__brand img { display: block; width: auto; max-width: 11em; max-height: 2.25em; }\n.ghcn-header__nav { min-width: 0; flex: 1; }\n.ghcn-header .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25em; margin: 0; padding: 0; list-style: none; }\n.ghcn-header .nav a, .ghcn-header__signin { color: var(--muted-foreground); font-size: 0.875em; font-weight: 600; text-decoration: none; }\n.ghcn-header .nav a:hover, .ghcn-header .nav-current a, .ghcn-header__signin:hover { color: var(--foreground); }\n.ghcn-header__actions { display: flex; align-items: center; gap: 0.75em; }\n.ghcn-header__actions .gh-search-icon { color: var(--foreground) !important; }\n.ghcn-header__mobile { display: none; margin-left: auto; }\n.ghcn-header__mobile summary { list-style: none; }\n.ghcn-header__mobile summary::-webkit-details-marker { display: none; }\n.ghcn-header__panel { position: absolute; top: calc(100% + 0.5em); right: 1em; left: 1em; border: 1px solid var(--border); border-radius: min(var(--radius), 1em); padding: 1em; background: var(--popover); box-shadow: 0 1em 2.5em rgba(0,0,0,.14); }\n.ghcn-header__panel .nav { align-items: stretch; flex-direction: column; gap: 0.25em; }\n.ghcn-header__panel .nav a { display: block; border-radius: var(--radius); padding: 0.625em 0.75em; }\n.ghcn-header__panel .nav a:hover { background: var(--muted); }\n.ghcn-header__mobile-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 0.5em; margin-top: 1em; padding-top: 1em; border-top: 1px solid var(--border); }\n@media (max-width: 800px) { .ghcn-header__nav, .ghcn-header__actions { display: none; } .ghcn-header__mobile { display: block; } }\n"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"gscan": {
|
|
22
|
+
"rules_satisfied": [
|
|
23
|
+
"GS010-PJ-VALID"
|
|
24
|
+
],
|
|
25
|
+
"notes": "Uses Ghost navigation, search, member state, and Portal triggers."
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/registry/index.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"name": "newsletter-form",
|
|
4
|
-
"description": "A native Ghost members subscription form.",
|
|
4
|
+
"description": "A native Ghost members subscription form with state handling.",
|
|
5
5
|
"category": "components:ui",
|
|
6
6
|
"ghost_version": ">=5.0.0",
|
|
7
7
|
"files": [
|
|
@@ -38,5 +38,65 @@
|
|
|
38
38
|
"post-card.hbs",
|
|
39
39
|
"post-card.css"
|
|
40
40
|
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "site-header",
|
|
44
|
+
"description": "Responsive Ghost navigation with search, member actions, and an accessible mobile menu.",
|
|
45
|
+
"category": "components:layout",
|
|
46
|
+
"ghost_version": ">=5.0.0",
|
|
47
|
+
"files": [
|
|
48
|
+
"site-header.hbs",
|
|
49
|
+
"site-header.css"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "site-footer",
|
|
54
|
+
"description": "Publication footer with secondary navigation, social links, and Ghost attribution.",
|
|
55
|
+
"category": "components:layout",
|
|
56
|
+
"ghost_version": ">=5.0.0",
|
|
57
|
+
"files": [
|
|
58
|
+
"site-footer.hbs",
|
|
59
|
+
"site-footer.css"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "featured-posts",
|
|
64
|
+
"description": "Responsive homepage hero populated from Ghost featured posts.",
|
|
65
|
+
"category": "components:content",
|
|
66
|
+
"ghost_version": ">=5.0.0",
|
|
67
|
+
"files": [
|
|
68
|
+
"featured-posts.hbs",
|
|
69
|
+
"featured-posts.css"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "pagination",
|
|
74
|
+
"description": "Accessible, responsive replacement for Ghost’s native pagination markup.",
|
|
75
|
+
"category": "components:navigation",
|
|
76
|
+
"ghost_version": ">=5.0.0",
|
|
77
|
+
"files": [
|
|
78
|
+
"pagination.hbs",
|
|
79
|
+
"pagination.css"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "post-header",
|
|
84
|
+
"description": "Editorial post heading with tags, author metadata, reading time, and responsive feature image.",
|
|
85
|
+
"category": "components:content",
|
|
86
|
+
"ghost_version": ">=5.0.0",
|
|
87
|
+
"files": [
|
|
88
|
+
"post-header.hbs",
|
|
89
|
+
"post-header.css"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "member-cta",
|
|
94
|
+
"description": "Context-aware member CTA for visitors, free members, paid members, and protected posts.",
|
|
95
|
+
"category": "components:members",
|
|
96
|
+
"ghost_version": ">=5.0.0",
|
|
97
|
+
"files": [
|
|
98
|
+
"member-cta.hbs",
|
|
99
|
+
"member-cta.css"
|
|
100
|
+
]
|
|
41
101
|
}
|
|
42
102
|
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GhostcnConfig } from './theme-project';
|
|
2
|
+
import { StyleSyncResult } from './theme-files';
|
|
3
|
+
export interface InstallComponentOptions {
|
|
4
|
+
themeRoot: string;
|
|
5
|
+
componentName: string;
|
|
6
|
+
config: GhostcnConfig;
|
|
7
|
+
overwrite?: boolean;
|
|
8
|
+
shouldOverwrite?: (relativePath: string) => Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export interface InstallComponentResult {
|
|
11
|
+
name: string;
|
|
12
|
+
installed: string[];
|
|
13
|
+
skipped: string[];
|
|
14
|
+
styleSync?: StyleSyncResult;
|
|
15
|
+
}
|
|
16
|
+
export declare function installComponent(options: InstallComponentOptions): Promise<InstallComponentResult>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.installComponent = installComponent;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const registry_1 = require("./registry");
|
|
10
|
+
const theme_files_1 = require("./theme-files");
|
|
11
|
+
function aliasedTarget(config, file) {
|
|
12
|
+
if (file.placement === 'theme') {
|
|
13
|
+
if (!file.target)
|
|
14
|
+
throw new Error(`Registry file "${file.name}" is missing its theme target.`);
|
|
15
|
+
return file.target;
|
|
16
|
+
}
|
|
17
|
+
let alias = '';
|
|
18
|
+
if (file.type === 'partial')
|
|
19
|
+
alias = config.aliases?.partials || 'partials/components';
|
|
20
|
+
if (file.type === 'style')
|
|
21
|
+
alias = config.aliases?.styles || 'assets/css/components';
|
|
22
|
+
if (file.type === 'js')
|
|
23
|
+
alias = config.aliases?.js || 'assets/js/components';
|
|
24
|
+
if (!alias)
|
|
25
|
+
throw new Error(`Unsupported registry file type "${file.type}".`);
|
|
26
|
+
return path_1.default.join(alias, file.name);
|
|
27
|
+
}
|
|
28
|
+
async function installComponent(options) {
|
|
29
|
+
const name = (0, registry_1.sanitizeComponentName)(options.componentName);
|
|
30
|
+
const manifest = await (0, registry_1.getComponent)(name);
|
|
31
|
+
if (!manifest)
|
|
32
|
+
throw new Error(`Component "${name}" was not found in the registry.`);
|
|
33
|
+
const result = { name, installed: [], skipped: [] };
|
|
34
|
+
for (const file of manifest.files) {
|
|
35
|
+
if (path_1.default.basename(file.name) !== file.name) {
|
|
36
|
+
throw new Error(`Registry returned an unsafe file name for "${name}".`);
|
|
37
|
+
}
|
|
38
|
+
const relativeTarget = aliasedTarget(options.config, file);
|
|
39
|
+
const targetPath = (0, theme_files_1.resolveWithinTheme)(options.themeRoot, relativeTarget);
|
|
40
|
+
if (fs_1.default.existsSync(targetPath) && !options.overwrite) {
|
|
41
|
+
const replace = options.shouldOverwrite ? await options.shouldOverwrite(relativeTarget.replace(/\\/g, '/')) : false;
|
|
42
|
+
if (!replace) {
|
|
43
|
+
result.skipped.push(relativeTarget);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
fs_1.default.mkdirSync(path_1.default.dirname(targetPath), { recursive: true });
|
|
48
|
+
fs_1.default.writeFileSync(targetPath, file.content, 'utf8');
|
|
49
|
+
result.installed.push(relativeTarget);
|
|
50
|
+
}
|
|
51
|
+
if (manifest.files.some(file => file.type === 'style')) {
|
|
52
|
+
result.styleSync = (0, theme_files_1.syncGhostcnStyles)({
|
|
53
|
+
themeRoot: options.themeRoot,
|
|
54
|
+
cssFile: options.config.cssFile || 'assets/css/ghostcn.css',
|
|
55
|
+
stylesDir: options.config.aliases?.styles || 'assets/css/components'
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|