simple-gh-pages-theme 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76f74777454e6c817541ffd856c597ceb29108fcfc2ca2e1ff8710929e5b12a8
4
- data.tar.gz: f4bef2936b68df0052a2622e161eacfb0ae5e510eb2c37d1054bd9c4d097ec00
3
+ metadata.gz: b44373a992017401fc4506c609fee23b0231a9de89aff5aed5d222d5e7fc0cba
4
+ data.tar.gz: 68ef089d1446713675933bc68e9ab52ca0604f442d9daba5c885f3960b79d5bd
5
5
  SHA512:
6
- metadata.gz: cf6ba10ddddb570f4422e031bc33b48ce886e053c059d7375042a9c5c97a557ed32b6f81205b57cb015208b309c9ca2d0c7b07873479f357d0ca868bc0a9cc43
7
- data.tar.gz: f3d8f92f9537a48deaff67323120ef1975e07b3c14bba368fd277d9f1142194f1da9767add52ba3ac1d812314818d22aeff59f0b3d3794c3b6fc37d774e398a6
6
+ metadata.gz: da5b2fa9992495f1fef392f35b6b5f1e600367b0c10f9c942b1228d13f33f0deb49009a9fb952d1154c27640192f1e473d4bceeb653c33a116ea1e19840fb8f7
7
+ data.tar.gz: 4013a523a0b55cfbd3307844abd4806eba63fef17927903494fee981c478a9363658f4e3c7bd840b0ec203b14766eaf056294f217dd5b1cc562fd6f6177f2560
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <table>
4
4
  <tr><td>
5
- <img width="500" alt="empty default" src="https://user-images.githubusercontent.com/5443727/229302809-750132e5-d461-4ec8-a38a-ccdc62b3b72e.png">
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>
@@ -17,66 +17,62 @@ in-use: https://jordiwippert.nl
17
17
  </table>
18
18
 
19
19
  ## Quick installation
20
-
21
- 1. Add this line to your Jekyll site's `Gemfile`:
22
-
20
+ ```shell
21
+ # 0. To create a new Jekyll site:
22
+ jekyll new <SITENAME>
23
+ cd <SITENAME>
24
+ ```
23
25
  ```ruby
26
+ # 1. Add this line to your Jekyll site's `Gemfile`:
24
27
  gem "simple-gh-pages-theme"
25
28
  ```
26
-
27
- 2. Add this line to your Jekyll site's `_config.yml`. Remove/disable possibly already enabled themes:
28
-
29
29
  ```yaml
30
+ # 2. Add this line to your Jekyll site's `_config.yml`. Remove/disable possibly already enabled themes:
30
31
  theme: simple-gh-pages-theme
31
32
  ```
32
-
33
- 3. And then execute:
34
-
35
33
  ```shell
34
+ # 3. Execute on your command line:
36
35
  bundle
37
- ```
38
36
 
39
- 4. Run install script to create 'posts.md'
40
-
41
- ```shell
37
+ # 4. Run install script to create 'posts.md'
42
38
  bundle exec install-theme
43
- ```
44
39
 
45
- 5. When you now run your website locally on `http://localhost:4000`, it should show the theme:
46
-
47
- ```shell
40
+ # 5. When you now run your website locally on `http://localhost:4000`, it should show the theme:
48
41
  bundle exec jekyll serve
49
42
  ```
50
43
 
51
44
  ## Configuration:
52
45
 
53
- See/use example config [here](https://github.com/LiveNL/simple-gh-pages-theme/blob/main/example-config.yml). Copy to `_config.yml`
46
+ All configuration options that can be overwritten can be found [here](https://github.com/LiveNL/simple-gh-pages-theme/blob/main/_config.yml).
54
47
 
55
- ## Usage
48
+ ## Github Pages setup
56
49
 
57
- ### Posts
58
-
59
- Create your posts like:
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`
60
55
 
56
+ ## Posts
57
+ Create your posts (files) like:
61
58
  ```
62
- docs/_posts/published/yyyy-mm-dd-postname.md
59
+ docs/_posts/yyyy-mm-dd-postname.md
63
60
  ```
64
61
 
65
- Each post can have the following options (with defaults):
66
-
67
- ```
68
- layout: post
69
- title: "Title here"
70
- image: assets/images/image.png OR https://example.com/image.png
71
- categories: [category]
72
- tags: [tag]
73
- highlight: false (if true: it will be used on about page, more here)
74
- short: false (if true: it shown in 'short' list on home 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
75
71
  ```
76
72
 
77
73
  ## Contributing
78
74
 
79
- Bug reports and pull requests are welcome on GitHub at https://github.com/lvenl/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.
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.
80
76
 
81
77
  ## License
82
78
 
@@ -7,12 +7,12 @@
7
7
  {% endfor %}
8
8
  <div class="social">
9
9
  {% assign socials = site.about.socials %}
10
- {% for items in socials %}
11
- {% for item in items %}
12
- <a target="_blank" href="{{items[item]}}">
13
- <i class="fa-brands fa-{{item}} text-muted" aria-hidden="true"></i>
14
- </a>
15
- {% endfor %}
10
+ {% for social in socials %}
11
+ {% assign social_type = social[0] %}
12
+ {% assign social_url = social[1] %}
13
+ <a target="_blank" href="{{social_url}}">
14
+ <i class="fa-brands fa-{{social_type}} text-muted" aria-hidden="true"></i>
15
+ </a>
16
16
  {% endfor %}
17
17
  <a href="mailto: {{site.about.email}}">
18
18
  <i class="fa fa-envelope text-muted" aria-hidden="true"></i>
data/bin/install-theme CHANGED
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  # Create 'posts.md'
2
4
  File.write('posts.md', <<~HEREDOC
3
5
  ---
@@ -6,3 +8,59 @@ File.write('posts.md', <<~HEREDOC
6
8
  ---
7
9
  HEREDOC
8
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.3
4
+ version: 0.1.5
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-02 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll-archives
@@ -85,7 +85,8 @@ files:
85
85
  homepage: https://github.com/LiveNL/simple-gh-pages-theme
86
86
  licenses:
87
87
  - MIT
88
- metadata: {}
88
+ metadata:
89
+ github_repo: https://github.com/LiveNL/simple-gh-pages-theme
89
90
  post_install_message:
90
91
  rdoc_options: []
91
92
  require_paths:
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
104
  requirements: []
104
- rubygems_version: 3.4.10
105
+ rubygems_version: 3.4.12
105
106
  signing_key:
106
107
  specification_version: 4
107
108
  summary: This gem provides a simple GitHub pages theme