simple-gh-pages-theme 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -35
  3. data/bin/install-theme +58 -0
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76f74777454e6c817541ffd856c597ceb29108fcfc2ca2e1ff8710929e5b12a8
4
- data.tar.gz: f4bef2936b68df0052a2622e161eacfb0ae5e510eb2c37d1054bd9c4d097ec00
3
+ metadata.gz: f5144f620dc2053c7cb8f8edeee17d6c2a5f2d85ac1105802515b6a5c5d8aea5
4
+ data.tar.gz: 83bf55b657497ff342992c50c899deb474163cb748aada682c65b3c5de0af5b6
5
5
  SHA512:
6
- metadata.gz: cf6ba10ddddb570f4422e031bc33b48ce886e053c059d7375042a9c5c97a557ed32b6f81205b57cb015208b309c9ca2d0c7b07873479f357d0ca868bc0a9cc43
7
- data.tar.gz: f3d8f92f9537a48deaff67323120ef1975e07b3c14bba368fd277d9f1142194f1da9767add52ba3ac1d812314818d22aeff59f0b3d3794c3b6fc37d774e398a6
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="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
 
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.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-02 00:00:00.000000000 Z
11
+ date: 2023-04-11 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: