simple-gh-pages-theme 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -65
- data/_config.yml +57 -0
- data/_data/navigation.yml +2 -2
- data/_includes/highlights.html +4 -3
- data/_includes/sidebar-categories.html +4 -2
- data/_layouts/category-posts.html +6 -5
- data/_layouts/home.html +4 -0
- data/_layouts/index.html +1 -2
- data/_layouts/page.html +12 -0
- data/_layouts/posts.html +4 -3
- data/bin/install-theme +66 -0
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5144f620dc2053c7cb8f8edeee17d6c2a5f2d85ac1105802515b6a5c5d8aea5
|
4
|
+
data.tar.gz: 83bf55b657497ff342992c50c899deb474163cb748aada682c65b3c5de0af5b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6c392ca3aa4cc855bd4c3e21b39b3ea1977492d54618c94e08b51055527941398721b6723d52c1ab16e17d31c4610dd0cc4626b554c0a31bb3900a21c1b1f59
|
7
|
+
data.tar.gz: 5820facac70b0de40e32b5b4e9498ccf0fdb096e728813fc02e55f157695feec3ac8e52776409773707a3e3dcaecac9befc552d57573170942a469a900c3f462
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<table>
|
4
4
|
<tr><td>
|
5
|
-
<img width="500" alt="
|
5
|
+
<img width="500" alt="after installing the theme" src="https://user-images.githubusercontent.com/5443727/229901057-23be4caa-0c70-46c1-aa83-d60cbb1220ba.png">
|
6
6
|
</td><td>
|
7
7
|
<img width="500" alt="jordiwippert.nl" src="https://user-images.githubusercontent.com/5443727/229302812-d481eb40-b0ca-49cd-95d5-c7fef5228b7a.png">
|
8
8
|
</td>
|
@@ -11,97 +11,68 @@
|
|
11
11
|
simple-gh-pages-theme, after install and first post setup
|
12
12
|
</td>
|
13
13
|
<td>
|
14
|
-
in-use
|
14
|
+
in-use: https://jordiwippert.nl
|
15
15
|
</td>
|
16
16
|
</tr>
|
17
17
|
</table>
|
18
18
|
|
19
|
-
##
|
20
|
-
|
21
|
-
|
19
|
+
## Quick installation
|
20
|
+
```shell
|
21
|
+
# 0. To create a new Jekyll site:
|
22
|
+
jekyll new <SITENAME>
|
23
|
+
cd <SITENAME>
|
24
|
+
```
|
22
25
|
```ruby
|
26
|
+
# 1. Add this line to your Jekyll site's `Gemfile`:
|
23
27
|
gem "simple-gh-pages-theme"
|
24
28
|
```
|
25
|
-
|
26
|
-
And add this line to your Jekyll site's `_config.yml`. Remove/disable possibly already enabled themes:
|
27
29
|
```yaml
|
30
|
+
# 2. Add this line to your Jekyll site's `_config.yml`. Remove/disable possibly already enabled themes:
|
28
31
|
theme: simple-gh-pages-theme
|
29
32
|
```
|
30
|
-
|
31
|
-
And then execute:
|
32
33
|
```shell
|
34
|
+
# 3. Execute on your command line:
|
33
35
|
bundle
|
34
|
-
OR
|
35
|
-
gem install simple-gh-pages-theme
|
36
|
-
```
|
37
|
-
### !!! Important. To make the layouts work properly.
|
38
36
|
|
39
|
-
|
37
|
+
# 4. Run install script to create 'posts.md'
|
38
|
+
bundle exec install-theme
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
---
|
44
|
-
layout: index
|
45
|
-
---
|
46
|
-
```
|
47
|
-
- **about.markdown**:
|
48
|
-
```
|
49
|
-
---
|
50
|
-
layout: post
|
51
|
-
permalink: /about.html
|
52
|
-
---
|
53
|
-
```
|
54
|
-
- **posts.markdown**: (file might not exist yet)
|
55
|
-
```
|
56
|
-
---
|
57
|
-
layout: posts
|
58
|
-
---
|
59
|
-
```
|
60
|
-
- **404.markdown**: (file might not exist yet)
|
61
|
-
```
|
62
|
-
---
|
63
|
-
layout: 404
|
64
|
-
---
|
40
|
+
# 5. When you now run your website locally on `http://localhost:4000`, it should show the theme:
|
41
|
+
bundle exec jekyll serve
|
65
42
|
```
|
66
43
|
|
67
44
|
## Configuration:
|
68
45
|
|
69
|
-
|
46
|
+
All configuration options that can be overwritten can be found [here](https://github.com/LiveNL/simple-gh-pages-theme/blob/main/_config.yml).
|
70
47
|
|
71
|
-
##
|
72
|
-
### Posts
|
48
|
+
## Github Pages setup
|
73
49
|
|
74
|
-
|
50
|
+
Go to `settings` > `page` in your github-pages-repository.
|
51
|
+
1. Select source: `Deploy from a branch`
|
52
|
+
2. Select branch: `gh-pages` (create if non-existent)
|
53
|
+
3. Select `/docs` as folder
|
54
|
+
4. You can now run `script/deploy`
|
75
55
|
|
56
|
+
## Posts
|
57
|
+
Create your posts (files) like:
|
76
58
|
```
|
77
|
-
docs/_posts/
|
59
|
+
docs/_posts/yyyy-mm-dd-postname.md
|
78
60
|
```
|
79
61
|
|
80
|
-
Each post can have the following options (with
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
short: false (if true: it shown in 'short' list on home page)
|
90
|
-
list_post: false (if true: it shown in list on home/posts page)
|
62
|
+
Each post can have the following (metadata) options (with example values):
|
63
|
+
```yaml
|
64
|
+
layout: post # OR page
|
65
|
+
title: "Title here" # Used for post-titles
|
66
|
+
image: assets/images/image.png # OR images on urls like: https://example.com/image.png
|
67
|
+
categories: [category] # 'category' can be anything
|
68
|
+
tags: [tag] # 'tag' can be everything
|
69
|
+
highlight: false # if true: it will listed in highlights, which can be shown with: `{% include highlights.html %}`
|
70
|
+
short: false # if true: it shown in 'short' list on home page
|
91
71
|
```
|
92
72
|
|
93
|
-
## Development
|
94
|
-
|
95
|
-
To set up your environment to develop this theme, run `bundle install`.
|
96
|
-
|
97
|
-
To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`.
|
98
|
-
|
99
|
-
This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
100
|
-
|
101
|
-
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
|
102
|
-
|
103
73
|
## Contributing
|
104
|
-
|
74
|
+
|
75
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/LiveNL/simple-gh-pages-theme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct.
|
105
76
|
|
106
77
|
## License
|
107
78
|
|
data/_config.yml
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
theme: simple-gh-pages-theme
|
2
|
+
title: "My website"
|
3
|
+
description: "The website description"
|
4
|
+
domain: "username.github.io"
|
5
|
+
baseurl: ""
|
6
|
+
url: ""
|
7
|
+
gtag: "G-XXXXXXXXX" # (your google tag)
|
8
|
+
|
9
|
+
about:
|
10
|
+
name: Firstname Lastname
|
11
|
+
site: "https://example.com"
|
12
|
+
avatar: assets/images/image.png
|
13
|
+
email: example@example.com
|
14
|
+
socials:
|
15
|
+
twitter: https://twitter.com/example
|
16
|
+
linkedin: https://www.linkedin.com/in/example/
|
17
|
+
github: https://github.com/example
|
18
|
+
keybase: https://keybase.io/example
|
19
|
+
medium: https://medium.com/@example
|
20
|
+
stack-overflow: https://stackoverflow.com/users/xxxxxx/example
|
21
|
+
|
22
|
+
plugins:
|
23
|
+
- jekyll-archives
|
24
|
+
- jekyll-redirect-from
|
25
|
+
- jekyll-sitemap
|
26
|
+
|
27
|
+
jekyll-archives:
|
28
|
+
enabled:
|
29
|
+
- tags
|
30
|
+
- categories
|
31
|
+
layout: category-posts
|
32
|
+
permalinks:
|
33
|
+
year: "/:year/"
|
34
|
+
month: "/:year/:month/"
|
35
|
+
day: "/:year/:month/:day/"
|
36
|
+
tag: "/tag/:name/"
|
37
|
+
category: "/category/:name/"
|
38
|
+
|
39
|
+
defaults:
|
40
|
+
- scope:
|
41
|
+
path: "assets/**"
|
42
|
+
values:
|
43
|
+
sitemap: false
|
44
|
+
|
45
|
+
# Excluded items can be processed by explicitly listing the directories or
|
46
|
+
# their entries' file path in the `include:` list.
|
47
|
+
exclude:
|
48
|
+
- .sass-cache/
|
49
|
+
- .jekyll-cache/
|
50
|
+
- gemfiles/
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- node_modules/
|
54
|
+
- vendor/bundle/
|
55
|
+
- vendor/cache/
|
56
|
+
- vendor/gems/
|
57
|
+
- vendor/ruby/
|
data/_data/navigation.yml
CHANGED
data/_includes/highlights.html
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
<table>
|
2
|
-
|
3
|
-
|
2
|
+
<!-- prettier-ignore -->
|
3
|
+
{% assign selection = site.posts | where_exp:"post", "post.highlight == true" %}
|
4
|
+
{% for post in selection %}
|
4
5
|
<tr>
|
5
6
|
<td>
|
6
7
|
<h4><span class="date">{{ post.date | date: "%b '%y"}}</span></h4>
|
7
8
|
</td>
|
8
9
|
<td>
|
9
|
-
{% if post.
|
10
|
+
{% if post.layout == 'post' and post.content.size > 1 %}
|
10
11
|
<a href="{{ post.url }}" style="text-decoration: none !important">
|
11
12
|
<h4> {{ post.title }}</h4>
|
12
13
|
</a>
|
@@ -6,7 +6,8 @@
|
|
6
6
|
{% assign nr_of_posts = 0 %}
|
7
7
|
{% assign cat = category | first %}
|
8
8
|
{% assign posts = site.categories[cat] %}
|
9
|
-
{% assign selection = posts | where_exp:"post", "post.
|
9
|
+
{% assign selection = posts | where_exp:"post", "post.layout == 'post'" %}
|
10
|
+
{% assign selection = selection | where_exp:"post", "post.content.size > 1" %}
|
10
11
|
{% for post in selection %}
|
11
12
|
{% assign nr_of_posts = nr_of_posts | plus:1 %}
|
12
13
|
{% endfor %}
|
@@ -30,7 +31,8 @@
|
|
30
31
|
{% assign nr_of_posts = 0 %}
|
31
32
|
{% assign tag = tag_post | first %}
|
32
33
|
{% assign tag_posts = site.tags[tag] %}
|
33
|
-
{% assign tag_posts_selection = tag_posts | where_exp:"post", "post.
|
34
|
+
{% assign tag_posts_selection = tag_posts | where_exp:"post", "post.layout == 'post'" %}
|
35
|
+
{% assign tag_posts_selection = tag_posts_selection | where_exp:"post", "post.content.size > 1" %}
|
34
36
|
{% for post in tag_posts_selection %}
|
35
37
|
{% assign nr_of_posts = nr_of_posts | plus:1 %}
|
36
38
|
{% endfor %}
|
@@ -6,11 +6,12 @@ title: categories
|
|
6
6
|
<div class="content">
|
7
7
|
<div class="posts-all">
|
8
8
|
<!-- prettier-ignore -->
|
9
|
-
{% assign selection = page.posts | where_exp:"post", "post.
|
10
|
-
|
11
|
-
{%
|
12
|
-
|
13
|
-
|
9
|
+
{% assign selection = page.posts | where_exp:"post", "post.layout == 'post'" %}
|
10
|
+
{% assign selection = selection | where_exp:"post", "post.content.size > 1" %}
|
11
|
+
{% for post in selection %}
|
12
|
+
{% include post-list-item.html %}
|
13
|
+
{% assign nr_of_posts = nr_of_posts | plus:1 %}
|
14
|
+
{% endfor %}
|
14
15
|
</div>
|
15
16
|
|
16
17
|
<div class="sidebar-short">
|
data/_layouts/home.html
ADDED
data/_layouts/index.html
CHANGED
@@ -6,13 +6,12 @@ title: home
|
|
6
6
|
<div class="content">
|
7
7
|
<div class="posts-top">
|
8
8
|
<!-- prettier-ignore -->
|
9
|
-
{% assign selection = site.posts | where_exp:"post", "post.list_post == true" %}
|
10
9
|
{% assign selection = site.posts | where_exp:"post", "post.short != true" %}
|
11
10
|
{% for post in selection limit: 5 %}
|
12
11
|
{% include post-list-item.html %}
|
13
12
|
{% endfor %}
|
14
13
|
<h2 style="font-family: 'Arvo'">
|
15
|
-
<a href="{{site.baseurl}}/posts
|
14
|
+
<a href="{{site.baseurl}}/posts/">❯ All posts </a>
|
16
15
|
</h2>
|
17
16
|
</div>
|
18
17
|
|
data/_layouts/page.html
ADDED
data/_layouts/posts.html
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
---
|
2
|
-
permalink: /posts.html
|
3
2
|
layout: default
|
3
|
+
permalink: /posts/
|
4
4
|
---
|
5
5
|
|
6
6
|
<div class="content">
|
7
7
|
<div class="posts-all">
|
8
8
|
<!-- prettier-ignore -->
|
9
|
-
{% assign selection = site.posts | where_exp:"post", "post.
|
10
|
-
{%
|
9
|
+
{% assign selection = site.posts | where_exp:"post", "post.layout == 'post'" %}
|
10
|
+
{% assign selection = selection | where_exp:"post", "post.content.size > 1" %}
|
11
|
+
{% for post in selection %}
|
11
12
|
{% include post-list-item.html %}
|
12
13
|
{% assign nr_of_posts = nr_of_posts | plus:1 %}
|
13
14
|
{% endfor %}
|
data/bin/install-theme
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
# Create 'posts.md'
|
4
|
+
File.write('posts.md', <<~HEREDOC
|
5
|
+
---
|
6
|
+
layout: posts
|
7
|
+
permalink: posts
|
8
|
+
---
|
9
|
+
HEREDOC
|
10
|
+
)
|
11
|
+
|
12
|
+
if !Dir.exist?("docs")
|
13
|
+
Dir.mkdir("docs")
|
14
|
+
end
|
15
|
+
|
16
|
+
Dir.glob("*").each do |file|
|
17
|
+
next if file == ".gitignore" || file == "docs"
|
18
|
+
if File.directory?(file)
|
19
|
+
FileUtils.mkdir_p("docs/#{file}")
|
20
|
+
FileUtils.cp_r("#{file}/.", "docs/#{file}/")
|
21
|
+
FileUtils.rm_rf(file)
|
22
|
+
else
|
23
|
+
FileUtils.mv(file, "docs/#{file}")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Create 'script/deploy'
|
28
|
+
if !Dir.exist?("script")
|
29
|
+
Dir.mkdir("script")
|
30
|
+
end
|
31
|
+
|
32
|
+
File.write('script/deploy', <<~HEREDOC
|
33
|
+
#!/bin/bash
|
34
|
+
|
35
|
+
MAIN_BRANCH="main"
|
36
|
+
DEPLOY_BRANCH="gh-pages"
|
37
|
+
|
38
|
+
# Clear files in deploy_branch
|
39
|
+
git checkout $DEPLOY_BRANCH
|
40
|
+
rm -r docs
|
41
|
+
|
42
|
+
# Get docs-files/folders from main_branch
|
43
|
+
git checkout $MAIN_BRANCH -- docs
|
44
|
+
cd docs || exit
|
45
|
+
|
46
|
+
# Build _site contents
|
47
|
+
bundle exec jekyll build
|
48
|
+
cd .. || exit
|
49
|
+
|
50
|
+
# Delete everything except for the docs/_site folder
|
51
|
+
find docs -mindepth 1 -maxdepth 1 ! -name '_site' -exec rm -r {} +
|
52
|
+
|
53
|
+
# Move all files in docs/_site to the docs folder
|
54
|
+
mv docs/_site/* docs
|
55
|
+
|
56
|
+
# Create commit with last message from main_branch and commit to deploy_branch
|
57
|
+
git add .
|
58
|
+
COMMIT_MESSAGE=$(git log $DEPLOY_BRANCH -1 --pretty="%h %s")
|
59
|
+
git commit -m "$COMMIT_MESSAGE"
|
60
|
+
git push origin $DEPLOY_BRANCH
|
61
|
+
git checkout $MAIN_BRANCH
|
62
|
+
HEREDOC
|
63
|
+
)
|
64
|
+
|
65
|
+
|
66
|
+
File.chmod(0777, "script/deploy")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-gh-pages-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LiveNL
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll-archives
|
@@ -55,12 +55,14 @@ dependencies:
|
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- simple-gh-pages-theme@jordiwippert.nl
|
58
|
-
executables:
|
58
|
+
executables:
|
59
|
+
- install-theme
|
59
60
|
extensions: []
|
60
61
|
extra_rdoc_files: []
|
61
62
|
files:
|
62
63
|
- LICENSE.txt
|
63
64
|
- README.md
|
65
|
+
- _config.yml
|
64
66
|
- _data/navigation.yml
|
65
67
|
- _includes/highlights.html
|
66
68
|
- _includes/intro.html
|
@@ -72,15 +74,19 @@ files:
|
|
72
74
|
- _layouts/404.html
|
73
75
|
- _layouts/category-posts.html
|
74
76
|
- _layouts/default.html
|
77
|
+
- _layouts/home.html
|
75
78
|
- _layouts/index.html
|
79
|
+
- _layouts/page.html
|
76
80
|
- _layouts/post.html
|
77
81
|
- _layouts/posts.html
|
78
82
|
- _sass/main.scss
|
79
83
|
- assets/css/main.scss
|
84
|
+
- bin/install-theme
|
80
85
|
homepage: https://github.com/LiveNL/simple-gh-pages-theme
|
81
86
|
licenses:
|
82
87
|
- MIT
|
83
|
-
metadata:
|
88
|
+
metadata:
|
89
|
+
github_repo: https://github.com/LiveNL/simple-gh-pages-theme
|
84
90
|
post_install_message:
|
85
91
|
rdoc_options: []
|
86
92
|
require_paths:
|