Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A combination of the highly functional Ghost [Dawn](https://github.com/tryghost/

![Chapter theme demonstration](assets/images/demo.png)

**Demo**: <https://ghost-chapter.neveroff.dev/>
**Demo**: <https://ghost-chapter.neveroff.dev/> — demo-only header/footer snippets (disabled buy CTA, GitHub links) live in [`docs/demo-site/`](docs/demo-site/), not in the theme zip.

**Requires Ghost 6.0 or later**.

Expand Down Expand Up @@ -38,9 +38,12 @@ Chapter 1.6.0 requires Ghost 6. Upgrade your instance before uploading this them

## Development

Styles are compiled using Gulp/PostCSS. You need **Node.js 22+** and [pnpm](https://pnpm.io/installation).
Styles are compiled using Gulp/PostCSS. Ghost 6 requires **Node.js 22** (not 24). This repo includes an `.nvmrc`; use [nvm](https://github.com/nvm-sh/nvm) so your shell matches before working on the theme or running Ghost locally.

```bash
# Use the Node version Ghost expects (run in this directory)
nvm use

# Install dependencies
pnpm install

Expand All @@ -51,10 +54,14 @@ pnpm dev
For live preview against a local Ghost install, run these in separate terminals:

```bash
# Terminal 1 — theme assets (this directory)
nvm use
pnpm dev

# From your Ghost install directory
ghost run -D
# Terminal 2 — Ghost (your install directory, e.g. ../.. from here)
nvm use 22
ghost doctor # optional sanity check
ghost start # or: ghost run -D for theme development
```

Edit files under `assets/css/`; compiled output goes to `assets/built/`.
Expand Down
20 changes: 20 additions & 0 deletions docs/demo-site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Demo site code injection

Snippets for [ghost-chapter.neveroff.dev](https://ghost-chapter.neveroff.dev/). These are **not** part of the theme — paste them into Ghost Admin on the demo instance only.

**Settings → Code injection**

| Field | File |
|-------|------|
| Site Header | [`code-injection-header.html`](code-injection-header.html) |
| Site Footer | [`code-injection-footer.html`](code-injection-footer.html) |

Append any site-specific header tags (e.g. analytics) before the header snippet. The footer script replaces the old Stripe buy-button injection.

What it does:

- Shows a crossed-out “Buy Chapter for $39” label (no longer sold)
- Adds a GitHub download link beside the header CTA
- Adds a GitHub icon to the footer “Chapter” attribution link

If the header GitHub icon is hard to see on a light header, change `.ch-demo-github-download { color: #fff; }` to `color: currentColor;` in the header snippet.
32 changes: 32 additions & 0 deletions docs/demo-site/code-injection-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
var repoUrl = 'https://github.com/mneveroff/ghost-chapter';
var githubIcon = '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M512 0C229.12 0 0 229.12 0 512c0 226.56 146.56 417.92 350.08 485.76 25.6 4.48 35.2-10.88 35.2-24.32 0-12.16-.64-52.48-.64-95.36-128.64 23.68-161.92-31.36-172.16-60.16-5.76-14.72-30.72-60.16-52.48-72.32-17.92-9.6-43.52-33.28-.64-33.92 40.32-.64 69.12 37.12 78.72 52.48 46.08 77.44 119.68 55.68 149.12 42.24 4.48-33.28 17.92-55.68 32.64-68.48-113.92-12.8-232.96-56.96-232.96-252.8 0-55.68 19.84-101.76 52.48-137.6-5.12-12.8-23.04-65.28 5.12-135.68 0 0 42.88-13.44 140.8 52.48 40.96-11.52 84.48-17.28 128-17.28s87.04 5.76 128 17.28c97.92-66.56 140.8-52.48 140.8-52.48 28.16 70.4 10.24 122.88 5.12 135.68 32.64 35.84 52.48 81.28 52.48 137.6 0 196.48-119.68 240-233.6 252.8 18.56 16 34.56 46.72 34.56 94.72 0 68.48-.64 123.52-.64 140.8 0 13.44 9.6 29.44 35.2 24.32C877.44 929.92 1024 737.92 1024 512 1024 229.12 794.88 0 512 0"/></svg>';

var ctaHtml = [
'<div class="ch-demo-cta">',
'<span class="gh-btn ch-demo-buy-disabled" aria-disabled="true">Buy Chapter for $39</span>',
'<a class="ch-demo-github-download" href="' + repoUrl + '" target="_blank" rel="noopener" aria-label="Download Chapter on GitHub">',
githubIcon,
'</a>',
'</div>'
].join('');

['.gh-signup', '.gh-head-members'].forEach(function (selector) {
var element = document.querySelector(selector);
if (element) {
element.innerHTML = ctaHtml;
}
});

var chapterLink = document.querySelector('.gh-powered-by a[href*="github.com/mneveroff/ghost-chapter"]');
if (chapterLink && !chapterLink.querySelector('.ch-demo-github-icon')) {
chapterLink.classList.add('ch-demo-powered-by-link');
var icon = document.createElement('span');
icon.className = 'ch-demo-github-icon';
icon.setAttribute('aria-hidden', 'true');
icon.innerHTML = githubIcon;
chapterLink.insertBefore(icon, chapterLink.firstChild);
}
});
</script>
64 changes: 64 additions & 0 deletions docs/demo-site/code-injection-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<style>
.gh-powered-by .ch-demo-powered-by-link {
display: inline-flex;
align-items: center;
gap: 0.35em;
}

.ch-demo-github-icon svg {
width: 1.1em;
height: 1.1em;
fill: currentColor;
vertical-align: -0.15em;
}

.ch-demo-cta {
display: flex;
align-items: center;
gap: 0.8rem;
}

.gh-signup .ch-demo-cta {
width: 100%;
max-width: 440px;
}

.gh-signup .ch-demo-buy-disabled {
flex: 1 1 auto;
min-width: 0;
}

.gh-btn.ch-demo-buy-disabled {
display: inline-flex;
align-items: center;
justify-content: center;
height: 40px;
padding: 0 1.6rem;
pointer-events: none;
cursor: not-allowed;
opacity: 0.55;
text-decoration: line-through;
white-space: nowrap;
}

.ch-demo-github-download {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 40px;
height: 40px;
color: #fff;
text-decoration: none;
}

.ch-demo-github-download:hover {
opacity: 0.85;
}

.ch-demo-github-download svg {
width: 40px;
height: 40px;
fill: currentColor;
}
</style>
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function js(done) {

const zipSrcGlobs = [
'**',
'!docs', '!docs/**',
'!node_modules', '!node_modules/**',
'!dist', '!dist/**',
'!yarn-error.log',
Expand Down
Loading