Updated for Ghost 5
[ghost-theme-lbbg.git] / README.md
1 # Casper
2
3 The default theme for [Ghost](http://github.com/tryghost/ghost/). This is the latest development version of Casper! If you're just looking to download the latest release, head over to the [releases](https://github.com/TryGhost/Casper/releases) page.
4
5  
6
7 ![screenshot-desktop](https://user-images.githubusercontent.com/353959/66987533-40eae100-f0c1-11e9-822e-cbaf38fb8e3f.png)
8
9  
10
11 # First time using a Ghost theme?
12
13 Ghost uses a simple templating language called [Handlebars](http://handlebarsjs.com/) for its themes.
14
15 This theme has lots of code comments to help explain what's going on just by reading the code. Once you feel comfortable with how everything works, we also have full [theme API documentation](https://ghost.org/docs/themes/) which explains every possible Handlebars helper and template.
16
17 **The main files are:**
18
19 - `default.hbs` - The parent template file, which includes your global header/footer
20 - `index.hbs` - The main template to generate a list of posts, usually the home page
21 - `post.hbs` - The template used to render individual posts
22 - `page.hbs` - Used for individual pages
23 - `tag.hbs` - Used for tag archives, eg. "all posts tagged with `news`"
24 - `author.hbs` - Used for author archives, eg. "all posts written by Jamie"
25
26 One neat trick is that you can also create custom one-off templates by adding the slug of a page to a template file. For example:
27
28 - `page-about.hbs` - Custom template for an `/about/` page
29 - `tag-news.hbs` - Custom template for `/tag/news/` archive
30 - `author-ali.hbs` - Custom template for `/author/ali/` archive
31
32
33 # Development
34
35 Casper styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need [Node](https://nodejs.org/), [Yarn](https://yarnpkg.com/) and [Gulp](https://gulpjs.com) installed globally. After that, from the theme's root directory:
36
37 ```bash
38 # install dependencies
39 yarn install
40
41 # run development server
42 yarn dev
43 ```
44
45 Now you can edit `/assets/css/` files, which will be compiled to `/assets/built/` automatically.
46
47 The `zip` Gulp task packages the theme files into `dist/<theme-name>.zip`, which you can then upload to your site.
48
49 ```bash
50 # create .zip file
51 yarn zip
52 ```
53
54 # PostCSS Features Used
55
56 - Autoprefixer - Don't worry about writing browser prefixes of any kind, it's all done automatically with support for the latest 2 major versions of every browser.
57 - [Color Mod](https://github.com/jonathantneal/postcss-color-mod-function)
58
59
60 # SVG Icons
61
62 Casper uses inline SVG icons, included via Handlebars partials. You can find all icons inside `/partials/icons`. To use an icon just include the name of the relevant file, eg. To include the SVG icon in `/partials/icons/rss.hbs` - use `{{> "icons/rss"}}`.
63
64 You can add your own SVG icons in the same manner.
65
66
67 # Copyright & License
68
69 Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE).