👻 This is my personal Ghost theme used on wustep.me.
- ✔️ Home page
- ✔️ Content card from page with URL
home
- ✔️ Add 2 most recent Articles, Projects, and Notes
- ✔️ "Read More" buttons linking to pages
- ✔️ Content card from page with URL
- ✔️ Articles
- ✔️ These should be posts tagged
Articles
first - ✔️ Articles will be loaded by creation date desc
- ✔️ Articles are routed to
/articles/{slug}
- ✔️ These should be posts tagged
- ✔️ Projects
- ✔️ These should be posts tagged
Projects
first - ✔️ Set
/projects
to route to/tags/projects
- ✔️ Projects will be loaded by creation date desc
- ✔️ Projects are routed to
/projects/{slug}
- ✔️ Hide day for datetime published
- ✔️ These should be posts tagged
- ✔️ Notes
- ✔️ These should be posts tagged
Notes
first - ✔️ Set
/notes
to route to/tags/notes
- ✔️ Notes will be loaded by creation date desc
- ✔️ Notes are routed to
/notes/{slug}
- ✔️ Hide day for datetime published
- ✔️ These should be posts tagged
- ✔️ Posts that are not primarily tagged
Articles
orProjects
orNotes
will be routed to/
- ✔️ Dynamic navigation bar
- ✔️ Based on the items in Settings > Navigation:
- ✔️ "Home", "Projects", "Articles", and "Notes" will be on the left side
- ✔️ Any other link will be on the right side
- ✔️ Mobile-friendly dropdown
- ✔️ Facebook, Twitter, GitHub, and LinkedIn will add icons
- ✔️ Tags category pages:
/tag/[tag]
and author page:/author/[author]
- ✔️ Dedicated post webpages
- ✔️ Proper formatting--match editor styles
- ✔️ Headings, links, paragraphs, bold, italics, blockquotes, bullets, code blocks, images, galleries
- Videos / embeds
- ✔️ Author byline with icon, name, and bio
- ✔️ Links to author's website
- ✔️ Proper formatting--match editor styles
- ✔️ Post Cards (loop)
- ✔️ with title, excerpt, tags
- ✔️ (These will not have feature images)
- Loads
featured
first - Use package.json property
posts-per-page
with pagination
- ✔️ Custom 404 page with 404-porcupine
- ✔️ Commenting with Commento
- ✔️ Disable on any post by setting
window.disableCommento
totrue
in Code Injection - Restyle to be more Bulma-like
- Add syntax highlighting?
- ✔️ Disable on any post by setting
- ✔️ Claps with Applause
- Disable on any page by setting
window.disableApplause
totrue
- Disable on any page by setting
- ✔️ Additional scripts:
- ✔️ Add jQuery v3.4 via CDN
- ✔️ Syntax highlighting for programming code blocks with Highlight.js
- ✔️ Convert external links to open in new tab
- ✔️ Tagify [#Tags] and [!Buttons] with Bulma tags and buttons
- ✔️
[##TagName]
will be turned into dark tags of #TagName with.is-primary-label
- ✔️
[##!TagName]
will get the same treatment but with anchor link - ✔️
[#TagName]
will be turned into grey tags of #TagName with.is-secondary-label
- ✔️ Lines that start and end in
[#Tags]
will be given.label-collection
- ✔️
[!<a href...>Button Text</a>]
will be givena.button.is-primary
- ✔️
[!(classes)<a href...>Button Text</a>]
will be givena.button
with space-separatedclasses
- ✔️
- ✔️ Build tools:
- ✔️
gulp
for development andgulp deploy
for deployment - ✔️ Compile SCSS to CSS
- ✔️ JSHint (error-checking) and Sass-lint (style-checking)
- ✔️ Minify CSS and JavaScript with source maps
- ✔️
De-prioritized:
- Subscribe modal
- ✔️ Set up modal and form
- Set up form action and errors
- Multi-author byline support
- Proper RSS feeds
- Fork into generic Bulma + Ghost theme
-
With npm installed, install
gulp
globally withnpm install -g gulp
. -
gulp
: compiles with Sass, Autoprefixer, Sass-lint, JSHint, Minify, watching for changes.- Ghost reloads
.hbs
changes by default, but new partials will require aghost restart
.
- Ghost reloads
-
gulp deploy
: recompile everything, create.zip
for production and usesgscan
to validate. -
To run Ghost:
ghost start
,ghost restart
, orghost run [session-name] --development
for logs
-
Install Ghost and complete modifications noted below.
-
Clone this repo to
/content/themes
, then (npm install
) and (usegulp
) or (gulp deploy
and upload zip file to Settings -> Design). -
Under Settings -> Navigation: add:
Home -> /
Articles -> /articles/
Projects -> /projects/
Notes -> /notes/
(optional)
LinkedIn, Twitter, GitHub, Facebook
-
Create a page with URL
/home
. This will be shown on the home page. -
Write posts that are tagged
Projects
,Articles
, orNotes
! -
Set up Commento account for comments.
Some minor mods were made to the Ghost code, particularly:
This is used for the navigation bar, to have Home
, Projects
, and Articles
be on the left-aligned and any other link to be right-aligned.
- In ghost folder:
core/server/helpers/has.js
, addlabel
tovalidAttrs
and add tochecks
object (line 140ish):
label: function() {
return (
(attrs.label && evaluateTagList(attrs.label, [self.label], true)) ||
false
);
},
Routes were modified to change tag/projects
-> projects
, tag/articles
-> articles
, and tag/notes
-> notes
and have the user-created page /home
-> /
.
- Replace your
content/settings/routes.yaml
with theroutes.yaml
in this repository, modifying as desired.
We added two config properties to let users enable or disable commento / applause. Edit package.json
if you want these enabled or disabled.
- In ghost folder:
core/server/services/themes/config/index.js
.
Add use-commento
and use-applause
to allowedKeys
.
- In ghost folder:
core/server/services/themes/middleware.js
Add use-commento
and use-applause
to updateGlobalTemplateOptions
in same format:
const themeData = {
posts_per_page: activeTheme.get().config("posts_per_page"),
image_sizes: activeTheme.get().config("image_sizes"),
use_commento: activeTheme.get().config("use_commento"),
use_applause: activeTheme.get().config("use_applause")
};
At the moment, RSS feeds are not populated properly. By default, Ghost adds a feed to the <head>
tag.
To remove it, go to core/server/helpers/ghost_head.js
and comment out the lines:
head.push(
'<link rel="alternate" type="application/rss+xml" title="' +
escapeExpression(metaData.blog.title) +
'" href="' +
escapeExpression(metaData.rssUrl) +
'" />'
);
TODO: Automatic excerpts, by default, tend to be a poor result and concatenate multiple lines together without proper spacing. Optionally, revise the excerpt
code to catch only the first <p>
block instead of carrying on.
By default, only "Home", "Projects", "Articles", and "Ideas" are in the left side of the nav. To add more internal pages to the nav bar, edit partials/navigation.hbs
and make sure the new label is listed in the #has
and ^has
statements.
Use a service like Typeform to add a "Contact" button to the home
page.
Edit the button to use Bulma, with class button
and is-success
(or another color)!
Example:
<a class="typeform-share button is-success" ...>Contact Me</a>
(This isn't completed yet! In the meantime, you can use Typeform forms.)
Add a subscribe button somewhere with classes subscribe-button button is-primary
:
<a
class="button subscribe-button is-primary"
data-target="subscribe-modal"
href="#subscribe"
>
Subscribe
</a>
I added syntax highlighting through highlight.js
for a limited number of languages that I felt I might use (including [JavaScript, Python, Java, SQL, JSON, Markdown, HTTP, CSS, SCSS, ...]
).
I excluded many common ones, like [C#, C++, Ruby, Makefiles, Apache]
, and there's tons more that can be added.
If you'd like to replace this library, build your own package at highlightjs.org and replace assets/lib/highlight.pack.js
.
To change the theme, follow the instructions in assets/css/highlight.scss
.
You can choose to host your own server of Applause and Commento.
To hide comments on any post, use window.disableCommento
via Code Injection to {{ghost_foot}}
in the Ghost panel:
<script>
window.disableCommento = true;
</script>
- Ghost-Theme-Template: Starting templates
- Gulma: Ghost + Bulma theme
- Casper: Default Ghost theme
- Blog: Official Ghost blog theme