Skip to content

Commit

Permalink
turn it into gem (#30)
Browse files Browse the repository at this point in the history
* try moving things into assets

* try pre-config variables

* try make it a gem theme

* gemspec

* moving theme pages into assets

* hotfox: site.docs is empty

* deal with pagination

* make manual install

* move example image out

* manual install with config files

* hotfix theme not when installing at target

* make homepage

* install github action

* make mathjax configurable outside of theme

* forget to bump version

* typos

* deal with gitignore

* make gem
  • Loading branch information
neizod authored Jan 20, 2022
1 parent e771c89 commit 5fc7969
Show file tree
Hide file tree
Showing 34 changed files with 345 additions and 41 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# ruby gem
*.gem
Gemfile.lock

# jekyll
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# bundler
.bundle/
vendor/
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'jekyll'

group :jekyll_plugins do
gem 'jekyll-sitemap'
gem 'jekyll-paginate-v2'
end
23 changes: 23 additions & 0 deletions MANUAL_INSTALL/.github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy Jekyll Site with GitHub Action

on:
push:
branches: [ main ]

jobs:
jekyll:
runs-on: ubuntu-latest
steps:
- name: GitHub Checkout
uses: actions/checkout@v2
- name: GitHub Cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Standard Jekyll
uses: helaili/jekyll-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions MANUAL_INSTALL/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ruby gem
*.gem
Gemfile.lock

# jekyll
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# bundler
.bundle/
vendor/
File renamed without changes.
9 changes: 9 additions & 0 deletions MANUAL_INSTALL/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

gem 'jekyll-theme-polar', '~> 1.0.0'

group :required_by_theme do
gem 'jekyll', '~> 4.2'
gem 'jekyll-sitemap'
gem 'jekyll-paginate-v2'
end
105 changes: 105 additions & 0 deletions MANUAL_INSTALL/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# User Config
# ===========
# fill/change these fields to match your own.

# Identity
# --------

title: #TODO the title of the blog
description: #TODO short tagline (should not longer than 10 words)

logo: "/assets/img/north-pole.png" #TODO 256x256
cover: "/assets/img/tired-bear.png" #TODO 1200x630

baseurl: #TODO leave blank if it is the top path, else use /path/to/sub/dir
url: #TODO the url without path, don't forget https://

owner: polarbear #TODO name of the owner of this blog
rights: All Right Reserved


# Social & Sharing
# ----------------

google:
analytics:
verification:

facebook:
username:
app_id:

twitter:
username:
large_img: sometimes

disqus:
username:


# Content Format
# --------------

timezone: Asia/Bangkok
mathjax: true



# ----------------------------------------------------------------------------

# Engine Config
# =============
# you shouldn't change this unless you really know what you're doing.

theme: jekyll-theme-polar

permalink: date

collections:
projects:
output: true
docs:
output: true

defaults:
- scope:
path: ""
type: pages
values:
layout: page
- scope:
path: ""
type: posts
values:
layout: post
- scope:
path: ""
type: projects
values:
layout: project
- scope:
path: ""
type: docs
values:
layout: doc

pagination:
enabled: true
per_page: 10
sort_reverse: true
permalink: /page:num.html

sass:
sass_dir: "_sass/"
style: compressed

exclude:
- README.md
- LICENSE.md
- CONTRIBUTING.md

plugins:
- jekyll-sitemap
- jekyll-paginate-v2

empty_array: []
7 changes: 7 additions & 0 deletions MANUAL_INSTALL/_data/homepage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
posts:
latest: 3
list:

projects:
latest: 0
list:
14 changes: 14 additions & 0 deletions MANUAL_INSTALL/_data/mathjax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
loader:
load:
- '[tex]/physics'

tex:
packages:
'[+]':
- 'physics'
inlineMath:
- ['$', '$']
- ['\\(', '\\)']
macros:
'ord': '\\operatorname{ord}'
'sgn': '\\operatorname{sgn}'
4 changes: 4 additions & 0 deletions MANUAL_INSTALL/_data/people.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
polarbear:
handle: A Cool Bear 🕶️
picture: "/assets/img/polar-bear.png"
url: /about
78 changes: 78 additions & 0 deletions MANUAL_INSTALL/_data/theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#TODO set each item to null then define your css color in _sass/ dir.
# preset: palette = { north-pole, aurora }, highlight = { github, monokai }
color:
palette: north-pole
highlight: github


#TODO set short, long to null then define your display in _include/date/ dir.
# set allow_long to false if you don't want to show time.
date:
short: "%B %e, %Y"
long: "%A, %B %e, %Y, %I:%M %p"
allow_long: sometimes


#TODO you may change navigation behavior here.
navigation:
menu:
- name: Posts
path: "/posts"
- name: Projects
path: "/projects"
- name: About
path: "/about"
paginate:
older: right


#TODO you may customize padding text here.
text:
meta:
title_sep: "|"
menu:
item_sep: ""
unconfig:
title: untitled
description: unconfigured theme
empty:
announcement: Announcement
excerpt:
read_more: Read More
item_sep: "/"
paginate:
left_symbol: «
right_symbol: »
at_page: "Page: "
of_page: " of "
prev_page: Prev
next_page: Next
post:
origin: "Originally published on: "
revise: "Revision notes:"
archive: Archive
tags: Tags
project:
demo: Live Demo!
source: Source Code


#TODO you may change/add more font here.
font:
head:
families:
- name: Raleway
weight: 300
default: sans-serif
body:
families:
- name: Lora
default: serif
mono:
families:
- name: Ubuntu Mono
default: monospace
size: 1.0em
line-height: 1.2
languages:
- latin-ext
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ White, clean, no JavaScript Jekyll Theme.

* 👉 Live preview at https://neizod.dev/polar/
* 👉 Screenshot:
<img src="/assets/img/readme_preview.png" width="500" alt="Screenshot">
<img src="/example/homepage.png" width="500" alt="Screenshot">
23 changes: 14 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# Identity
# --------

title:
description:
title: A New Jekyll Site
description: Powered by Polar Theme

logo: "/assets/img/logo.png"
cover: "/assets/img/cover.png"
logo: "/assets/img/north-pole.png"
cover: "/assets/img/tired-bear.png"

baseurl:
url:

owner:
owner: polarbear
rights: All Right Reserved


Expand All @@ -41,14 +41,16 @@ disqus:
# --------------

timezone: Asia/Bangkok
paginate: 10
mathjax: true



# Engine Config
# =============
# you shouldn't change this unless you really know what you're doing.

permalink: date

collections:
projects:
output: true
Expand Down Expand Up @@ -77,8 +79,11 @@ defaults:
values:
layout: doc

permalink: date
paginate_path: "/posts/page:num"
pagination:
enabled: true
per_page: 10
sort_reverse: true
permalink: /page:num.html

sass:
sass_dir: "_sass/"
Expand All @@ -91,6 +96,6 @@ exclude:

plugins:
- jekyll-sitemap
- jekyll-paginate
- jekyll-paginate-v2

empty_array: []
7 changes: 7 additions & 0 deletions _data/homepage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
posts:
latest: 3
list:

projects:
latest: 0
list:
14 changes: 14 additions & 0 deletions _data/mathjax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
loader:
load:
- '[tex]/physics'

tex:
packages:
'[+]':
- 'physics'
inlineMath:
- ['$', '$']
- ['\\(', '\\)']
macros:
'ord': '\\operatorname{ord}'
'sgn': '\\operatorname{sgn}'
Empty file added _data/people.yml
Empty file.
6 changes: 5 additions & 1 deletion _includes/listing/docs.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{% capture NOOUT %}
{% assign sorted_docs = site.docs | sort: 'order' %}
{% if site.docs %}
{% assign sorted_docs = site.docs | sort: 'order' %}
{% else %}
{% assign sorted_docs = site.empty_array %}
{% endif %}
{% endcapture %}
<h2>Documents</h2>
<ol>
Expand Down
Loading

0 comments on commit 5fc7969

Please sign in to comment.