Morph¶ ↑
Morph is a simple Jekyll theme for writers.
Installation¶ ↑
Install with github page:
GitHub Pages¶ ↑
-
Add these 2 lines in to your
Gemfile
:
gem "jekyll-remote-theme" gem "jekyll-paginate"
-
Install the newly added gems:
$ bundle
-
In
_config.yml
add these lines:
remote_theme: alex-1900/jekyll-theme-morph permalink: /:year/:month/:day/:title.markdown paginate: 5 plugins: - jekyll-paginate - jekyll-remote-theme
Remove any other theme:
or remote_theme:
lines.
-
Rename
index.md
toindex.html
. Without this, thejekyll-paginate
gem will not work.
Layouts¶ ↑
Pinned articles¶ ↑
Add the sticky
and sticky_subtitle
(optional) field to post file, and you can find the article at pinned area.
--- sticky: true sticky_subtitle: some words ---
Add tags and categories page¶ ↑
-
create new pages
tags.html
andcategories.html
and add these lines to heads:--- layout: classify source: tags ---
--- layout: classify source: categories ---
-
add these lines to your
_config.yml
:morph: pages: - name: tags path: /tags - name: categories path: /categories
and can see the tags
and categories
buttons now.
Enable tags and categories sidebar¶ ↑
add these lines to your _config.yml
in morph
field:
morph: include: home_categories_bar: title: Top Categories path: /categories home_tags_bar: title: Top Tags path: /tags
certainly, you can change the titles
and paths
Add searching page¶ ↑
-
create
search.json
at project root, and add these lines:--- layout: none permalink: /search.json --- [ {% for post in site.posts %} { "title" : {{ post.title | escape | jsonify }}, "category" : {{ post.category | jsonify }}, "tags" : "{{ post.tags | join: ', ' }}", "url" : "{{ site.baseurl }}{{ post.url }}", "date" : "{{ post.date }}", "content" : {{ post.content | strip_html | strip_newlines | remove_chars | jsonify }} } {% unless forloop.last %},{% endunless %} {% endfor %} ]
-
create a new file
search.html
, and add these lines to head:--- layout: search ---
-
add change your
_config.yml
add a new page tomorph.pages
:morph: pages: - name: tags path: /tags - name: categories path: /categories - name: search path: /search
Change the skin¶ ↑
There are two skins: silver
(default) and obsidian
, you can switching between multiple skins by _config.yml
:
morph: skin: obsidian
and rebuild or restart the dev server
Multiple language¶ ↑
-
Create directory and file
__data/language/[lang].yml
(the[lang]
is abbreviation of your language) -
replace contents with another language, the following are the default values.
t: posts: posts tags_low: tags tags_up: Tags categories_low: categories categories_up: Categories about_low: about about_up: About search_low: search search_up: Search catalogue: Catalogue home: Home page: Page post_up: Post search_placeholder: input key words here... update_time: Update time pinned_articles: Pinned Articles top_tags: Top Tags top_categories: Top Categories show_more: show more catalogue_empty: Catalogue is empty
3 add your the lang
item to your page files
--- lang: [lang] ---
(the [lang]
is abbreviation of your language)
-
for posts page, you can change the defaults scope:
“`yml defaults:
-
scope: type: “posts” values: lang: [lang] # the
[lang]
is abbreviation of your language“`
and rebuild or restart the dev server