π» 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