ghostcn 1.6.0 → 1.7.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/registry/components/account-card.json +57 -0
- package/dist/registry/components/author-card.json +1 -1
- package/dist/registry/components/author-stack.json +63 -0
- package/dist/registry/components/back-to-top.json +72 -0
- package/dist/registry/components/callout.json +56 -0
- package/dist/registry/components/checkbox.json +82 -0
- package/dist/registry/components/code-copy.json +52 -0
- package/dist/registry/components/comments-section.json +56 -0
- package/dist/registry/components/dialog.json +83 -0
- package/dist/registry/components/dropdown.json +85 -0
- package/dist/registry/components/empty-state.json +65 -0
- package/dist/registry/components/error-card.json +74 -0
- package/dist/registry/components/faq-section.json +83 -0
- package/dist/registry/components/hero.json +89 -0
- package/dist/registry/components/image-lightbox.json +44 -0
- package/dist/registry/components/magazine-grid.json +62 -0
- package/dist/registry/components/mobile-dock.json +69 -0
- package/dist/registry/components/newsletter-form.json +1 -1
- package/dist/registry/components/pagination.json +1 -1
- package/dist/registry/components/post-card.json +1 -1
- package/dist/registry/components/post-grid.json +1 -1
- package/dist/registry/components/post-header.json +1 -1
- package/dist/registry/components/post-list.json +62 -0
- package/dist/registry/components/pull-quote.json +70 -0
- package/dist/registry/components/radio-group.json +94 -0
- package/dist/registry/components/reader-controls.json +60 -0
- package/dist/registry/components/reading-meta.json +49 -0
- package/dist/registry/components/related-posts.json +1 -1
- package/dist/registry/components/search-trigger.json +68 -0
- package/dist/registry/components/select.json +94 -0
- package/dist/registry/components/separator.json +46 -0
- package/dist/registry/components/series-nav.json +62 -0
- package/dist/registry/components/skeleton.json +48 -0
- package/dist/registry/components/skip-link.json +53 -0
- package/dist/registry/components/social-links.json +74 -0
- package/dist/registry/components/stat-strip.json +85 -0
- package/dist/registry/components/sticky-subscribe.json +82 -0
- package/dist/registry/components/subscribe-bar.json +61 -0
- package/dist/registry/components/switch.json +76 -0
- package/dist/registry/components/tabs.json +81 -0
- package/dist/registry/components/tag-bar.json +63 -0
- package/dist/registry/components/textarea.json +95 -0
- package/dist/registry/components/tier-comparison.json +55 -0
- package/dist/registry/components/timeline.json +85 -0
- package/dist/registry/components/tooltip.json +65 -0
- package/dist/registry/index.json +389 -0
- package/dist/templates/playground/playground.js +1 -1
- package/dist/utils/playground-server.js +8 -2
- package/dist/utils/preview-renderer.d.ts +72 -0
- package/dist/utils/preview-renderer.js +51 -5
- package/package.json +1 -1
|
@@ -24,20 +24,38 @@ export declare const demoPost: {
|
|
|
24
24
|
posts: number;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
+
authors: {
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
bio: string;
|
|
31
|
+
location: string;
|
|
32
|
+
count: {
|
|
33
|
+
posts: number;
|
|
34
|
+
};
|
|
35
|
+
}[];
|
|
27
36
|
primary_tag: {
|
|
28
37
|
name: string;
|
|
38
|
+
slug: string;
|
|
29
39
|
description: string;
|
|
30
40
|
url: string;
|
|
31
41
|
visibility: string;
|
|
42
|
+
count: {
|
|
43
|
+
posts: number;
|
|
44
|
+
};
|
|
32
45
|
};
|
|
33
46
|
tags: {
|
|
34
47
|
name: string;
|
|
48
|
+
slug: string;
|
|
35
49
|
description: string;
|
|
36
50
|
url: string;
|
|
37
51
|
visibility: string;
|
|
52
|
+
count: {
|
|
53
|
+
posts: number;
|
|
54
|
+
};
|
|
38
55
|
}[];
|
|
39
56
|
access: boolean;
|
|
40
57
|
visibility: string;
|
|
58
|
+
comments: boolean;
|
|
41
59
|
};
|
|
42
60
|
export declare const demoPosts: {
|
|
43
61
|
title: string;
|
|
@@ -55,20 +73,38 @@ export declare const demoPosts: {
|
|
|
55
73
|
posts: number;
|
|
56
74
|
};
|
|
57
75
|
};
|
|
76
|
+
authors: {
|
|
77
|
+
name: string;
|
|
78
|
+
url: string;
|
|
79
|
+
bio: string;
|
|
80
|
+
location: string;
|
|
81
|
+
count: {
|
|
82
|
+
posts: number;
|
|
83
|
+
};
|
|
84
|
+
}[];
|
|
58
85
|
primary_tag: {
|
|
59
86
|
name: string;
|
|
87
|
+
slug: string;
|
|
60
88
|
description: string;
|
|
61
89
|
url: string;
|
|
62
90
|
visibility: string;
|
|
91
|
+
count: {
|
|
92
|
+
posts: number;
|
|
93
|
+
};
|
|
63
94
|
};
|
|
64
95
|
tags: {
|
|
65
96
|
name: string;
|
|
97
|
+
slug: string;
|
|
66
98
|
description: string;
|
|
67
99
|
url: string;
|
|
68
100
|
visibility: string;
|
|
101
|
+
count: {
|
|
102
|
+
posts: number;
|
|
103
|
+
};
|
|
69
104
|
}[];
|
|
70
105
|
access: boolean;
|
|
71
106
|
visibility: string;
|
|
107
|
+
comments: boolean;
|
|
72
108
|
}[];
|
|
73
109
|
export declare const previewStates: string[];
|
|
74
110
|
export declare const previewDemoContext: {
|
|
@@ -88,20 +124,38 @@ export declare const previewDemoContext: {
|
|
|
88
124
|
posts: number;
|
|
89
125
|
};
|
|
90
126
|
};
|
|
127
|
+
authors: {
|
|
128
|
+
name: string;
|
|
129
|
+
url: string;
|
|
130
|
+
bio: string;
|
|
131
|
+
location: string;
|
|
132
|
+
count: {
|
|
133
|
+
posts: number;
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
91
136
|
primary_tag: {
|
|
92
137
|
name: string;
|
|
138
|
+
slug: string;
|
|
93
139
|
description: string;
|
|
94
140
|
url: string;
|
|
95
141
|
visibility: string;
|
|
142
|
+
count: {
|
|
143
|
+
posts: number;
|
|
144
|
+
};
|
|
96
145
|
};
|
|
97
146
|
tags: {
|
|
98
147
|
name: string;
|
|
148
|
+
slug: string;
|
|
99
149
|
description: string;
|
|
100
150
|
url: string;
|
|
101
151
|
visibility: string;
|
|
152
|
+
count: {
|
|
153
|
+
posts: number;
|
|
154
|
+
};
|
|
102
155
|
}[];
|
|
103
156
|
access: boolean;
|
|
104
157
|
visibility: string;
|
|
158
|
+
comments: boolean;
|
|
105
159
|
}[];
|
|
106
160
|
pagination: {
|
|
107
161
|
page: number;
|
|
@@ -124,20 +178,38 @@ export declare const previewDemoContext: {
|
|
|
124
178
|
posts: number;
|
|
125
179
|
};
|
|
126
180
|
};
|
|
181
|
+
authors: {
|
|
182
|
+
name: string;
|
|
183
|
+
url: string;
|
|
184
|
+
bio: string;
|
|
185
|
+
location: string;
|
|
186
|
+
count: {
|
|
187
|
+
posts: number;
|
|
188
|
+
};
|
|
189
|
+
}[];
|
|
127
190
|
primary_tag: {
|
|
128
191
|
name: string;
|
|
192
|
+
slug: string;
|
|
129
193
|
description: string;
|
|
130
194
|
url: string;
|
|
131
195
|
visibility: string;
|
|
196
|
+
count: {
|
|
197
|
+
posts: number;
|
|
198
|
+
};
|
|
132
199
|
};
|
|
133
200
|
tags: {
|
|
134
201
|
name: string;
|
|
202
|
+
slug: string;
|
|
135
203
|
description: string;
|
|
136
204
|
url: string;
|
|
137
205
|
visibility: string;
|
|
206
|
+
count: {
|
|
207
|
+
posts: number;
|
|
208
|
+
};
|
|
138
209
|
}[];
|
|
139
210
|
access: boolean;
|
|
140
211
|
visibility: string;
|
|
212
|
+
comments: boolean;
|
|
141
213
|
};
|
|
142
214
|
export declare const demoParameters: Record<string, Record<string, string>>;
|
|
143
215
|
export declare function renderPreviewTemplate(partials: Record<string, string>, template: string, options?: {
|
|
@@ -15,8 +15,14 @@ exports.demoImage = editorialImage('#ded4c3', '#38362f', '<path d="M315 475V220L
|
|
|
15
15
|
const secondImage = editorialImage('#cbd1c5', '#374738', '<circle cx="600" cy="337" r="210"/><path d="M380 336h440v35H380z" fill="#f0ede1"/><circle cx="600" cy="337" r="116" fill="#aab4a1"/><path d="M573 121h54v431h-54z" fill="#677c65" opacity=".8"/>');
|
|
16
16
|
const thirdImage = editorialImage('#dbc7bb', '#6a483e', '<path d="M334 454l140-235 127 208 126-208 140 235z"/><path d="M312 485h576v40H312z" fill="#9c6956"/><circle cx="603" cy="166" r="44" fill="#f5e4cd"/>');
|
|
17
17
|
exports.demoAuthor = { name: 'Alex Reader', url: '/author/alex/', bio: 'Writing about independent publishing, thoughtful design, and building a home for your readers.', location: 'Everywhere', count: { posts: 12 } };
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const coAuthor = { name: 'Jordan Lee', url: '/author/jordan/', bio: 'Editorial design and typography for independent publications.', location: 'Remote', count: { posts: 7 } };
|
|
19
|
+
const tags = [
|
|
20
|
+
{ name: 'Publishing', slug: 'publishing', description: 'Stories about independent publishing.', url: '/tag/publishing/', visibility: 'public', count: { posts: 14 } },
|
|
21
|
+
{ name: 'Design', slug: 'design', description: 'The details that make it yours.', url: '/tag/design/', visibility: 'public', count: { posts: 9 } },
|
|
22
|
+
{ name: 'Membership', slug: 'membership', description: 'Building sustainable reader communities.', url: '/tag/membership/', visibility: 'public', count: { posts: 6 } },
|
|
23
|
+
{ name: 'Engineering', slug: 'engineering', description: 'Theme craft, CSS tokens, and performance.', url: '/tag/engineering/', visibility: 'public', count: { posts: 11 } }
|
|
24
|
+
];
|
|
25
|
+
exports.demoPost = { title: 'A home for independent ideas', url: '/a-home-for-independent-ideas/', excerpt: 'Good stories deserve a place of their own. Build a publication around your ideas, your community, and your voice.', custom_excerpt: 'Good stories deserve a place of their own.', feature_image: exports.demoImage, feature_image_alt: 'An abstract illustration of folded paper', primary_author: exports.demoAuthor, authors: [exports.demoAuthor, coAuthor], primary_tag: tags[0], tags, access: true, visibility: 'members', comments: true };
|
|
20
26
|
exports.demoPosts = [
|
|
21
27
|
exports.demoPost,
|
|
22
28
|
{ ...exports.demoPost, title: 'Make room for your readers', url: '/make-room-for-your-readers/', feature_image: secondImage, feature_image_alt: 'An abstract illustration of intersecting circles', excerpt: 'A thoughtful reading experience starts with space for the story and a clear path to what comes next.' },
|
|
@@ -40,7 +46,45 @@ exports.demoParameters = {
|
|
|
40
46
|
'reading-progress': { initialValue: '42' },
|
|
41
47
|
'share-buttons': { heading: 'Share' },
|
|
42
48
|
breadcrumbs: { homeLabel: 'Home' },
|
|
43
|
-
'visibility-badge': { membersLabel: 'Members only' }
|
|
49
|
+
'visibility-badge': { membersLabel: 'Members only' },
|
|
50
|
+
callout: { heading: 'Editorial note', body: 'Ghost partials inherit your active accent color, border radius, and color scheme automatically.' },
|
|
51
|
+
tabs: { tab1Label: 'Overview', tab1Body: 'Add Ghost-native Handlebars partials straight to your theme with zero runtime lock-in.', tab2Label: 'Styling', tab2Body: 'Override tokens in ghostcn.css or pass call-site classes via class and slot parameters.', tab3Label: 'Members', tab3Body: 'Native Portal links and data-members-form states work out of the box.' },
|
|
52
|
+
dialog: { triggerText: 'Open dialog', heading: 'Stay in the loop', description: 'Get weekly essays and theme updates.', body: 'Press Escape or click outside to close. Powered by the native HTML <dialog> element.', actionText: 'Subscribe', dataPortal: 'signup' },
|
|
53
|
+
dropdown: { label: 'More actions', item1Label: 'Latest issues', item1Href: '/archive/', item2Label: 'About the journal', item2Href: '/about/', item3Label: 'Manage membership', item3Href: '#/portal/account' },
|
|
54
|
+
separator: { label: 'Continue reading' },
|
|
55
|
+
'empty-state': { heading: 'No stories here yet', description: 'New essays will appear here as soon as they are published.', actionText: 'Browse all stories', actionHref: '/archive/' },
|
|
56
|
+
textarea: { label: 'Your message', name: 'message', placeholder: 'Share feedback or pitch a story...', hint: 'We read every note from subscribers.', hintId: 'demo-message-hint' },
|
|
57
|
+
select: { label: 'Topic', name: 'topic', placeholder: 'Choose a topic', option1: 'Editorial & essays', option2: 'Design systems', option3: 'Membership strategy', hint: 'Filter stories by section.', hintId: 'demo-topic-hint' },
|
|
58
|
+
checkbox: { label: 'Send weekly editorial digest', description: 'One curated summary every Sunday morning. Unsubscribe anytime.', name: 'digest' },
|
|
59
|
+
hero: { eyebrow: 'Independent Publishing', heading: 'Stories worth reading slowly', description: 'Essays on design, craft, and building a lasting publication around your readers.', primaryText: 'Subscribe free', primaryPortal: 'signup', secondaryText: 'Browse archive', secondaryHref: '/archive/', coverImage: exports.demoImage, imageAlt: 'Featured publication illustration' },
|
|
60
|
+
'post-list': { heading: 'Recent dispatches' },
|
|
61
|
+
'author-stack': {},
|
|
62
|
+
'code-copy': {},
|
|
63
|
+
'image-lightbox': {},
|
|
64
|
+
'back-to-top': { label: 'Back to top', alwaysVisible: 'true' },
|
|
65
|
+
'reading-meta': {},
|
|
66
|
+
'subscribe-bar': { placeholder: 'you@example.com', buttonText: 'Subscribe' },
|
|
67
|
+
'search-trigger': { label: 'Search posts...', shortcut: '⌘K' },
|
|
68
|
+
'tier-comparison': { heading: 'Compare membership plans', description: 'Choose the level of access that fits how you read.' },
|
|
69
|
+
'social-links': { github: 'https://github.com/ghostcn', bluesky: 'https://bsky.app/profile/ghostcn.dev', email: 'hello@example.com' },
|
|
70
|
+
'tag-bar': { allLabel: 'All stories', showCounts: 'true' },
|
|
71
|
+
'series-nav': { eyebrow: 'Series', heading: 'Building an Independent Publication' },
|
|
72
|
+
'magazine-grid': { heading: 'Top stories', actionText: 'View archive', actionHref: '/archive/' },
|
|
73
|
+
'comments-section': { heading: 'Discussion', description: 'Share your perspective with fellow subscribers.' },
|
|
74
|
+
'reader-controls': { ariaLabel: 'Reading display preferences' },
|
|
75
|
+
'pull-quote': { quote: 'Independent publishing works best when the design gets out of the way and lets ideas breathe.', attribution: 'Alex Reader', role: 'Editor, Ghostcn Journal' },
|
|
76
|
+
'account-card': { heading: 'Sign in to your account', description: 'Manage your newsletter preferences, billing plan, and member-only access.' },
|
|
77
|
+
'sticky-subscribe': { heading: 'Enjoying this story?', description: 'Get new essays delivered straight to your inbox.', alwaysVisible: 'true' },
|
|
78
|
+
'faq-section': { eyebrow: 'Membership FAQ', heading: 'Frequently asked questions', description: 'Everything you need to know about free and paid subscriptions.' },
|
|
79
|
+
'stat-strip': { stat1Value: '14,200+', stat1Label: 'Active readers', stat2Value: '180+', stat2Label: 'Published issues', stat3Value: '54%', stat3Label: 'Average open rate' },
|
|
80
|
+
switch: { label: 'Weekly editorial digest', description: 'Receive one curated roundup every Sunday morning.', checked: 'true' },
|
|
81
|
+
'radio-group': { legend: 'Email cadence', option1: 'Every new post', option1Desc: 'Delivered immediately when published.', option2: 'Weekly Sunday digest', option2Desc: 'A calm single summary once a week.', option3: 'Monthly highlights', option3Desc: 'Only our flagship long-form essays.' },
|
|
82
|
+
tooltip: { label: 'Hover or focus me', content: 'Pure CSS tooltip with keyboard focus and hover support.' },
|
|
83
|
+
timeline: {},
|
|
84
|
+
skeleton: { variant: 'card' },
|
|
85
|
+
'error-card': { statusCode: '404', heading: 'Page not found', description: 'The page you are looking for may have been moved, renamed, or unpublished.' },
|
|
86
|
+
'skip-link': { label: 'Skip to main content', alwaysVisible: 'true' },
|
|
87
|
+
'mobile-dock': { alwaysVisible: 'true' }
|
|
44
88
|
};
|
|
45
89
|
function renderPreviewTemplate(partials, template, options = {}) {
|
|
46
90
|
const state = options.state || 'visitor';
|
|
@@ -69,6 +113,8 @@ function renderPreviewTemplate(partials, template, options = {}) {
|
|
|
69
113
|
hbs.registerHelper('excerpt', function () { return this.excerpt; });
|
|
70
114
|
hbs.registerHelper('asset', value => `/theme-assets/${value}`);
|
|
71
115
|
hbs.registerHelper('reading_time', () => '4 min read');
|
|
116
|
+
hbs.registerHelper('comment_count', () => '4 comments');
|
|
117
|
+
hbs.registerHelper('comments', () => new hbs.SafeString('<div class="ghcn-comments-preview" role="note">Ghost native comments render here on your live publication.</div>'));
|
|
72
118
|
hbs.registerHelper('date', opts => opts.hash.format === 'YYYY' ? '2026' : opts.hash.format === 'YYYY-MM-DD' ? '2026-10-01' : '1 Oct 2026');
|
|
73
119
|
hbs.registerHelper('plural', (count, opts) => String(count === 0 ? opts.hash.empty : count === 1 ? opts.hash.singular : opts.hash.plural).replace('%', String(count)));
|
|
74
120
|
hbs.registerHelper('social_url', () => 'https://example.com');
|
|
@@ -76,8 +122,8 @@ function renderPreviewTemplate(partials, template, options = {}) {
|
|
|
76
122
|
hbs.registerHelper('navigation', () => new hbs.SafeString('<ul class="nav"><li class="nav-current"><a href="/">Home</a></li><li><a href="/about/">About</a></li><li><a href="/archive/">Archive</a></li></ul>'));
|
|
77
123
|
hbs.registerHelper('search', () => new hbs.SafeString('<button type="button" class="ghcn-icon-button ghcn-button--ghost" aria-label="Search"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-width="2"/><path d="m15 15 6 6" stroke="currentColor" stroke-width="2"/></svg></button>'));
|
|
78
124
|
hbs.registerHelper('price', (amount, opts) => new Intl.NumberFormat('en', { style: 'currency', currency: opts.hash.currency }).format(amount / 100));
|
|
79
|
-
const site = { title: 'Ghostcn Journal', url: '/', description: 'Independent ideas, shared with your readers.', locale: 'en', members_enabled: state !== 'disabled', paid_members_enabled: state !== 'disabled' && state !== 'free-only', members_invite_only: state === 'invite', allow_self_signup: !['disabled', 'invite', 'restricted'].includes(state) };
|
|
80
|
-
const data = { site, member: ['free', 'paid'].includes(state) ? { paid: state === 'paid' } : undefined };
|
|
125
|
+
const site = { title: 'Ghostcn Journal', url: '/', description: 'Independent ideas, shared with your readers.', locale: 'en', twitter: '@ghostcn', facebook: 'ghostcn', comments_enabled: true, members_enabled: state !== 'disabled', paid_members_enabled: state !== 'disabled' && state !== 'free-only', members_invite_only: state === 'invite', allow_self_signup: !['disabled', 'invite', 'restricted'].includes(state) };
|
|
126
|
+
const data = { site, member: ['free', 'paid'].includes(state) ? { name: 'Alex Reader', email: 'alex@example.com', paid: state === 'paid' } : undefined };
|
|
81
127
|
const context = options.context || (options.access === undefined ? exports.previewDemoContext : { ...exports.previewDemoContext, access: options.access });
|
|
82
128
|
return hbs.compile(template)(context, { data });
|
|
83
129
|
}
|