IMPORTANT: Since I'm no longer using Ghost as a frontend this repository is unmaintained.
A Ghost theme. Demo!
See Customization to enable/disable optional features.
<ghost directory>/content/themes/haven
<ghost directory>/content/themes/haven
npm i
to install dependenciesnpm run build
Important: Every change within the the
assets
directory requires you to rebuild the theme.
Keep in mind that customization is only available if you do have access to the source files, meaning that you need to clone the repository instead of just downloading the released theme.
Sadly Ghost doesn't support custom theme options; but it's still easy to en- or
disable features shipped with this theme. Open the assets/js/index.js
file and
see the initialization of the Theme
class and change to your needs:
(new Theme()).init({
logoSwitcher: true,
navbarBgAlpha: true,
affixSidebar: true,
featherlight: true
});
logoSwitcher
: swaps your publication logo to the navbar as soon as you've scrolled past it.navbarBgAlpha
: changes the alpha of the navbar background according to your scroll position. Alpha is set to 1
as
soon as you're at the end of the header.affixSidebar
: sticks your sidebar to the viewport when scrolling past it.featherlight
: turns images within your posts to responsive image lightboxes.Styling-related things are implemented via SASS which makes it easy to change colors or other styles without having to write additional code.
Open assets/sass/_base.scss
and change everything to your needs.
There are two different post styles available for post previews; a compact one and a more feature image centric one.
Compact | Non compact |
---|---|
To switch between these layouts set the $compact-preview-layout
variable to true/false
in assets/_base.scss
.
Syntax highlighting is powered by Prism. By default it uses the Okaidia theme and supports the following languages: Javascript, CSS, Markup, C-like, Typescript, PHP, SASS/SCSS, Twig, YAML and Bash.
Extending the supported languages or changing the theme can easily be done by modifying the prismjs
in
the .babelrc
file.
In case you don't need the Syntax highlighting at all simply remove these lines from assets/js/index.js
:
import Prism from 'prismjs';
Prism.highlightAll();
<ghost directory>/content/themes/haven
npm i
npm run dev
to start webpack with the --watch
flagThe theme is tested against
npm run gscan
)npm run sass-lint
)npm run eslint
)Alternatively you can run npm test
to test all of the above.
To build the theme simply run npm run build
. This will run webpack
in production, which will
automatically take care of asset optimization (aka minification and uglification).
It's a client-side custom implementation based on lunr.js (see here).
Use the GitHub issue tracker.
Sure. Just make sure tests are succeeding.
The post.hbs
template provides a comment placeholder section
which is commented out
by default (section id is comments
). Use this placeholder
and paste your comment code there.
Created by nehalist.io - Released under the MIT license.