Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asasmith/backroom-ghost-theme
https://github.com/asasmith/backroom-ghost-theme
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/asasmith/backroom-ghost-theme
- Owner: asasmith
- License: mit
- Created: 2024-05-02T23:47:49.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-20T17:12:27.000Z (18 days ago)
- Last Synced: 2024-12-20T18:24:13.730Z (18 days ago)
- Language: CSS
- Size: 1.84 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: newsletter.hbs
- License: LICENSE
Awesome Lists containing this project
README
# Ghost Starter Theme
A starter framework for Ghost themes! Click **Use this template** to create a copy of this repo for everything you need to get started developing a custom Ghost theme.
## First time using a Ghost theme?
Ghost uses a simple templating language called [Handlebars](http://handlebarsjs.com/) for its themes.
We've documented this starter theme pretty heavily so that it should be possible to work out what's going on just by reading the code and the comments. We also have a robust set of resources to help you build awesome custom themes:
- The official [theme documentation](https://ghost.org/docs/themes) is the complete resource for everything you need to know about Ghost theme development
- [Tutorials](https://ghost.org/tutorials/) offer a step-by-step guide to building the most common features in Ghost themes
- The [Ghost VS Code extension](https://marketplace.visualstudio.com/items?itemName=TryGhost.ghost) speeds up theme development and provides quick access to helpful info
- All of Ghost's official themes are [open source](https://github.com/tryghost) and are a great reference for learning how to create a theme
## Starter theme features
🔁 Livereload by default. See changes instantly in the browser whenever you save a file.
🔎 Optimized for VS Code. Find the files you're looking for more easily.
🗃️ Write modern JavaScript. Use ESM out of the box to write more manageable Javascript.
🗜️ Assets optimized automatically. JavaScript and CSS are minified and transpiled by default.
👟 Fast compile times, powered by [Rollup](https://rollupjs.org).
🦋 Write next-gen CSS for today's browsers with [PostCSS](https://postcss.org/). Add the CSS tools you love via [`rollup.config.js`](rollup.config.js).
🚢 Ghost's [GH Deploy Action](.github/workflows/deploy-theme.yml) included by default. [Learn more how to deploy your theme automatically](https://github.com/TryGhost/action-deploy-theme)
➕ Extensible by design. Rollup's configuration structure makes it easy to add [any number of plugins easily](https://github.com/rollup/plugins).
## Theme structure
The main files are:
- [`default.hbs`](default.hbs) - The main template file
- [`index.hbs`](index.hbs) - Used for the home page
- [`post.hbs`](post.hbs) - Used for individual posts
- [`page.hbs`](page.hbs) - Used for individual pages
- [`tag.hbs`](tag.hbs) - Used for tag archives
- [`author.hbs`](author.hbs) - Used for author archivesOne neat trick is that you can also create custom one-off templates just by adding the slug of a page to a template file. For example:
- `page-about.hbs` - Custom template for the `/about/` page
- `tag-news.hbs` - Custom template for `/tag/news/` archive
- `author-jamie.hbs` - Custom template for `/author/jamie/` archive
## Development guide
The Starter theme provides a first-class development experience out of the box.
### Setup
To see realtime changes during development, symlink the Starter theme folder to the `content/themes` folder in your local Ghost install.
```bash
ln -s /path/to/starter /ghost/content/themes/starter
```Restart Ghost and select the Starter theme from **Settings**.
From the theme's root directory, install the dependencies:
```bash
npm install
```If Node isn't installed, follow the [official Node installation guide](https://nodejs.org/).
### Start development mode
From the Starter theme folder, start development mode:
```bash
npm run dev
```Changes you make to your styles, scripts, and Handlebars files will show up automatically in the browser. CSS and Javascript will be compiled and output to the `built` folder.
Press `ctrl + c` in the terminal to exit development mode.
### Build, zip, and test your theme
Compile your CSS and JavaScript assets for production with the following command:
```bash
npm run build
```Create a zip archive:
```bash
npm run zip
```Use `gscan` to test your theme for compatibility with Ghost:
```bash
npm run test
```
## Copyright & License
Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).