classic-jekyll-theme 2.2.0 → 2.3.0

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
  SHA1:
3
- metadata.gz: 2e130386a4b59daeb06fdff06e7d34b5b46c3b59
4
- data.tar.gz: f041a4ec4dc3322e8ff66e957ffbdd1be9a82c05
3
+ metadata.gz: 563de332f91ec382d8a30e4d65166f0d0105616a
4
+ data.tar.gz: eb4872f6c0c0daf0406b8c7aa721e126e85adf61
5
5
  SHA512:
6
- metadata.gz: b7208c2eb8e0c7e1e23cbbb017a4cd1fa23009757ff909a2edcd33fe6f99ef54cea54640c9d3c411fe5cd2b7f18b246b256eb63b254730db5d6e5dc282b12e42
7
- data.tar.gz: a6c28389ba17eac261c3323c318701fe03378e021b36e9ef406e4d49ad2b9ec8770c5e27e1255d9441df3c5d220560cae08f48d2ded6b3fbc36d6a90318cfa07
6
+ metadata.gz: 0f741d01eb3e392c28e8527ca4997ecc6cf3056696aee44cba608ff4bb5e2e76247867e416b9cae2d3f74f6b1d93f2479c3768dea1d688357f5fcbd5ca590558
7
+ data.tar.gz: 145245cdf593762e921f4e4c30a2a041ccbba354fd130dc0dcc2b27f0a09b0f8b431c22b558c0d25ae8bd37602eb7f52be998602dcdd81d0a107beaff9efd98b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Classic-Jekyll-Theme v2.2.0
1
+ # Classic-Jekyll-Theme v2.3.0
2
2
 
3
3
  Welcome to Classic-Jekyll-Theme. This theme centers around one of the most used website structures on the web. A banner, navigation menu (dropdown), (up to) three columns and a footer. The design is fully responsive for three different screen widths: widest, medium and narrow. It is probably best shown in an example:
4
4
 
@@ -80,9 +80,10 @@ Please see [http://balancingrock.github.io/classic-jekyll-theme](http://balancin
80
80
 
81
81
  ## History
82
82
 
83
- Release 2.0.0 (2017-12-19)
84
- [Release 2.1.1 (2018-01-22)](http://balancingrock.github.io/classic-jekyll-theme/classic/2017/12/22/bugfix-2-1.html)
85
- [Release 2.2.0 (2018-02-02)](http://balancingrock.github.io/classic-jekyll-theme/classic/2017/12/22/release-2-2-0.html)
83
+ - Release 2.0.0 (2017-12-19)
84
+ - [Release 2.1.1 (2018-01-22)](http://balancingrock.github.io/classic-jekyll-theme/classic/2017/12/22/bugfix-2-1.html)
85
+ - [Release 2.2.0 (2018-02-02)](http://balancingrock.github.io/classic-jekyll-theme/classic/2018/02/02/release-2-2-0.html)
86
+ - [Release 2.3.0 (2018-02-05)](http://balancingrock.github.io/classic-jekyll-theme/classic/2018/02/05/release-2-3-0.html)
86
87
 
87
88
  ## Suport & Feedback
88
89
 
data/_data/text-for.yml CHANGED
@@ -47,4 +47,7 @@ tOlderPosts: Older Posts
47
47
 
48
48
  # Month names for Older Posts widget output
49
49
  # Note: Must start with 'None' because of index starting at 0
50
- tMonths: [None, January, February, March, April, May, June, July, August, September, October, November, December]
50
+ tMonths: [None, January, February, March, April, May, June, July, August, September, October, November, December]
51
+
52
+ # Text to be displayed for articles that will be published in the future.
53
+ tFutureRelease: This article is scheduled for release in the near future.
@@ -8,9 +8,19 @@
8
8
 
9
9
  {%- comment -%}<!-- Create a list of top menu item titles -->{%- endcomment -%}
10
10
 
11
+ {%- assign buildTimeInSecondsSinceEpoch = site.time | date: "%s" | plus: 0 -%}
12
+
13
+ {%- assign pagesForPublishing = "" | split: "" -%}
14
+ {%- for ape in site.pages -%}
15
+ {%- assign pageInSecondsSindsEpoch = ape.date | date:"%s" | plus: 0 -%}
16
+ {%- if pageInSecondsSindsEpoch < buildTimeInSecondsSinceEpoch -%}
17
+ {%- assign pagesForPublishing = pagesForPublishing | push: ape -%}
18
+ {%- endif -%}
19
+ {%- endfor -%}
20
+
11
21
  {%- assign topTitles = "" | split: "" -%}
12
- {%- assign sortedPages = site.pages | where:'menuInclude', true | where_exp:'item', 'item.menuTopTitle != nil' | sort: 'menuTopIndex', 'last' -%}
13
- {%- for ape in sortedPages -%}{%- assign topTitles = topTitles | push: ape.menuTopTitle -%}{%- endfor -%}
22
+ {%- assign sortedPages = pagesForPublishing | where:'menuInclude', true | where_exp:'item', 'item.menuTopTitle != nil' | sort: 'menuTopIndex', 'last' -%}
23
+ {%- for ape in sortedPages -%}{%- assign topTitles = topTitles | push: ape.menuTopTitle -%}{%- endfor -%}
14
24
  {%- assign topTitles = topTitles | uniq -%}
15
25
 
16
26
  {%- comment -%}<!-- Home page -->{%- endcomment -%}
@@ -384,7 +394,7 @@
384
394
 
385
395
  {%- if jekyll.environment != 'production' and site.data.setup.fast-content-build -%}{%- else -%}
386
396
  {%- if site.data.setup.generate-categories-menu -%}
387
- {%- assign cats = site.pages | where:'layout', 'category-page' | sort:'title' -%}
397
+ {%- assign cats = pagesForPublishing | where:'layout', 'category-page' | sort:'title' -%}
388
398
  {%- if cats.size > 0 -%}
389
399
  {%- assign categories = 'Categories' -%}
390
400
  {%- if site.data.text-for.tCategories -%}{%- assign categories = site.data.text-for.tCategories -%}{%- endif %}
@@ -18,7 +18,17 @@
18
18
 
19
19
  {%- comment -%}<!-- Find all pages that belong to the menuTopTitle of this page -->{%- endcomment -%}
20
20
 
21
- {%- assign topTitlePages = site.pages | where:'menuInclude', true | where:'menuTopTitle', topTitle -%}
21
+ {%- assign buildTimeInSecondsSinceEpoch = site.time | date: "%s" | plus: 0 -%}
22
+
23
+ {%- assign pagesForPublishing = "" | split: "" -%}
24
+ {%- for ape in site.pages -%}
25
+ {%- assign pageInSecondsSindsEpoch = ape.date | date:"%s" | plus: 0 -%}
26
+ {%- if pageInSecondsSindsEpoch < buildTimeInSecondsSinceEpoch -%}
27
+ {%- assign pagesForPublishing = pagesForPublishing | push: ape -%}
28
+ {%- endif -%}
29
+ {%- endfor -%}
30
+
31
+ {%- assign topTitlePages = pagesForPublishing | where:'menuInclude', true | where:'menuTopTitle', topTitle -%}
22
32
 
23
33
  {%- comment -%}<!-- note: these html comment tags are for editor coloring support
24
34
 
@@ -1,12 +1,23 @@
1
1
 
2
2
  <!-- include categories.html -->
3
3
  {%- if jekyll.environment != 'production' and site.data.setup.fast-content-build -%}{%- else %}
4
+
5
+ {%- assign buildTimeInSecondsSinceEpoch = site.time | date: "%s" | plus: 0 -%}
6
+
7
+ {%- assign pagesForPublishing = "" | split: "" -%}
8
+ {%- for ape in site.pages -%}
9
+ {%- assign pageInSecondsSindsEpoch = ape.date | date:"%s" | plus: 0 -%}
10
+ {%- if pageInSecondsSindsEpoch < buildTimeInSecondsSinceEpoch -%}
11
+ {%- assign pagesForPublishing = pagesForPublishing | push: ape -%}
12
+ {%- endif -%}
13
+ {%- endfor -%}
14
+
4
15
  <div class="categories">
5
16
  {%- assign categories = 'Categories' -%}
6
17
  {%- if site.data.text-for.tCategories -%}{%- assign categories = site.data.text-for.tCategories -%}{%- endif %}
7
18
  <input type="checkbox" id={{ "category-checkbox" | append: include.label-modifier }}>
8
19
  <label for={{ "category-checkbox" | append: include.label-modifier }}><h1>{{ categories }}</h1></label>
9
- {%- assign cats = site.pages | where:'layout', 'category-page' | sort:'title' -%}
20
+ {%- assign cats = pagesForPublishing | where:'layout', 'category-page' | sort:'title' -%}
10
21
  {%- if cats.size > 0 -%}
11
22
  {%- for cat in cats %}
12
23
  <div class="text"><a href="{{ cat.url | relative_url }}"><p>{{ cat.title | capitalize }}</p></a></div>
data/_layouts/page.html CHANGED
@@ -7,10 +7,21 @@ layout: default
7
7
  <p class="page-meta">{%- if page.date -%}<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%F" }}</time>{%- endif -%}{%- if page.author -%} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{%- endif -%}</p>
8
8
  </header>
9
9
  <div class="page-content" itemprop="articleBody">
10
-
10
+
11
+ {%- assign buildTimeInSecondsSinceEpoch = site.time | date: "%s" | plus: 0 -%}
12
+ {%- assign pageInSecondsSindsEpoch = page.date | date:"%s" | plus: 0 -%}
13
+
14
+ {%- if pageInSecondsSindsEpoch < buildTimeInSecondsSinceEpoch %}
11
15
  <!-- Page content -->
12
16
  {{ content }}
13
17
  <!-- End of page content -->
18
+ {% else -%}
19
+ {%- assign future-release = 'This article is scheduled for release in the near future.' -%}
20
+ {%- if site.data.text-for.tFutureRelease -%}
21
+ {%- assign future-release = site.data.text-for.tFutureRelease -%}
22
+ {%- endif -%}
23
+ <p>{{ future-release }}</p>
24
+ {% endif -%}
14
25
 
15
26
  </div>
16
27
  {%- if site.disqus.shortname -%}
@@ -21,10 +21,10 @@ The main features of this theme are as follows:
21
21
  - Page by page override of layout and secondary/tertiary column content
22
22
  - Extensive configuration of visible elements (font, color, background, padding, size etc)
23
23
  - Banner & menubar may be fixed to the top of the browser window
24
+ - Release date for pages
24
25
  - Includes several widgets:
25
26
  - Recent posts
26
27
  - Older posts
27
- - Youtube viewer
28
28
  - Categories
29
29
  - Includes cookies warning (can be disabled)
30
30
  - Includes disqus & google analytics
@@ -18,4 +18,8 @@ Additional YAML front matter:
18
18
  - __tertiary-column__: This is an override setting of the general parameter in `site.data.setup.tertiary-column`. Set to either _none_ or _present_ to affect placing of the tertiary column for this page/post only.
19
19
  - __secondary-column-content__: By default the content for the secondary column is taken from _\_includes/secondary-column.html_. Assigning it a different file here will override this default for this page/post only. However if the vertical menu is used (i.e. `site.data.setup.drop-down-menu` is set to _no_), it will remain visible at the top of the content of the secondary column.
20
20
  - __tertiary-column-content__: By default the content for the tertiary column is taken from _\_includes/tertiary-column.html_. Assigning it a different file here will override this default for this page/post only.
21
- - __banner-position__: The position of the banner area. Use _top_ to place the banner across all three columns, _main_ to place the banner only above the primary column and _top-fixed_ to have the banner pinned at the top of the browser window. This setting is fro this page only.
21
+ - __banner-position__: The position of the banner area. Use _top_ to place the banner across all three columns, _main_ to place the banner only above the primary column and _top-fixed_ to have the banner pinned at the top of the browser window. This setting is fro this page only.
22
+
23
+ ## For Pages
24
+
25
+ - __date__: When present, the page will only be included in the website if this date is earlier than the build time.
@@ -0,0 +1,171 @@
1
+ ---
2
+ layout: page
3
+ title: "Cron jobs: create websites periodically"
4
+ date: 2018-02-05
5
+ menuInclude: yes
6
+ menuTopTitle: Jekyll
7
+ menuSubs:
8
+ - title: Ruby environment
9
+ index: 3
10
+ tertiary-column: none
11
+ excerpt: How to set up the daily creation of a website with jekyll and git...
12
+ ---
13
+ When maintaining a website it is common to want to add posts and pages on a regular basis to stimulate regular visits of users. A static website generator makes this harder, but with a little extra effort it is possible to show a new post or page on predefined dates. (Note that the classic-jekyll-theme is needed to have this feature apply to pages as well as posts. Standard Jekyll wil only do dated posts releases)
14
+
15
+ This is the workflow this example aims for:
16
+
17
+ - Create a page or post on a local machine.
18
+ - Verify that the layout of the site (on the local machine) is as desired.
19
+ - Check in the changes on the local machine into the local git repository.
20
+ - Push the local git to the git-server.
21
+
22
+ And have the website on the next day reflect the changes that were made. If changes were made for a future release date, they should only appear on and after the date for which they were written.
23
+
24
+ ## Before we start
25
+
26
+ The method described here only works if we have control of the server.
27
+
28
+ It does not work for github hosted sites, though it should be possible to achieve the same result with Github if the cron job does not kick-off the jekyll-build process, but a git-push of an automatically generated file (to github).
29
+
30
+ The example is given for macOS, but should be easy to replicate for other platforms.
31
+
32
+ ## The setup
33
+
34
+ The setup is simple: the machine that hosts the website has Jekyll and git-server installed on it. It can be the same machine that is used to create the content, but that is not necessary. One of the side benefits of this approach is that it is easy to update the website from anywhere in the world. Keep in mind though that it is important to use the same version of Jekyll and the ruby environment on all machines.
35
+
36
+ What we will do:
37
+
38
+ 1. Create a git-server repository on the server that contains the (file for the) website.
39
+ 1. Create a git working repository on the server that is used to generate the actual website.
40
+ 1. Create a job on the server that checks out the website from the git-server repository into the working repository, compiles the website with Jekyll and then copies the content of `_site` to the website directory used by the server.
41
+
42
+ And that is all there is to it. Once this is done, we can update the website from any place that has `push` rights to the git-server repository.
43
+
44
+ To be clear, there are three website directories involved:
45
+
46
+ 1. The server website directory. This is the directory that the webserver uses to serve the incoming HTTP requests.
47
+ 1. The git-server website, this is a directory that contains all the files to build the website. It is identical in structure to the directory that is created by `jekyll new`.
48
+ 1. And lastly a working directory (with git repository) that is used to create the files to be copied to the server website directory. This directory will be synchronised with the git-server directory when the website files are build.
49
+
50
+ ## The steps
51
+
52
+ ### Create git-server repository
53
+
54
+ I use macOS Xcode-Server to create a git-server repository.
55
+
56
+ Start 'Server' and select 'Xcode', then choose the 'Repositories' tab and create the repository.
57
+
58
+ If you don't have macOS-Server and Xcode-Server installed, please google "git server macOS" for hints about how to setup a git server on the mac.
59
+
60
+ For this example I will assume a site called 'mysite' and that the git-server repository has the same name.
61
+
62
+ ### Create a directory to use as a working directory for the cron script
63
+
64
+ Any location will work, this example uses: `/Users/rien/Documents/Websites/mysite`. Of course your user name and site name will be different.
65
+
66
+ Goto the `/Websites` directory and create the git repository that will be used by the script.
67
+
68
+ ~~~~~
69
+ git clone <<path-to-repo>>
70
+ ~~~~~
71
+
72
+ The <<path-to-repo>> should be the path to the git-server repository and end in 'mysite' or 'mysite.git'
73
+
74
+ This command also creates the directory `/mysite`
75
+
76
+ ### Create the update script
77
+
78
+ This script is located at the user level (in this case: `Users/rien`) and lets call it `mysite-daily-update.script`.
79
+
80
+ ~~~~~
81
+ #! /bin/bash
82
+ echo "$(date) start"
83
+ cd /Users/rien/Documents/Websites/mysite
84
+ echo "git pull"
85
+ git pull origin
86
+ echo "bundle exec jekyll build"
87
+ rm Gemfile.lock
88
+ JEKYLL_ENV=production /Users/rien/.rbenv/shims/bundle exec jekyll build
89
+ echo "sync site"
90
+ rsync -av _site/ /Library/Server/Web/Data/Sites/mysite
91
+ echo "$(date) ready"
92
+ ~~~~~
93
+
94
+ What happens:
95
+
96
+ - The bash shell is used
97
+ - The start time is logged to a console
98
+ - The working directory is changed to the directory where the cloned repository is
99
+ - The working repository is updated from the main site repository
100
+ - The Gemfile.lock is removed (I believe this is not really necessary, a leftover from experimenting)
101
+ - Jekyll compiles the site (the full path to `bundle` must be specified because the regular login profile is not executed in a cron job)
102
+ - The site is copied to the directory where the server expects it.
103
+ - The end time is logged to a console
104
+
105
+ The path in the `rsync` command must of course be the path to the directory where the website is hosted.
106
+
107
+ Note that when the website is being used the users may experience an inconsistent website for a very short time. For the type of updates that are targeted with this approach (page & post updates) this should not pose a problem. But when a website is completely redesigned it may be unacceptable. In that case a proper shutdown of the server is necessary before the rsync command is issued and a restart of the server afterwards.
108
+
109
+ Important: Make the script executable!
110
+
111
+ chmod +x mysite-daily-update.script`
112
+
113
+ ### Create the cron job specification
114
+
115
+ In the directory `~/Library/LaunchAgents` create a file with the name `com.mysite.plist`. Of course a different reverse-url notation will be needed for a different site.
116
+
117
+ This file should contain the following:
118
+
119
+ ~~~~~
120
+ <?xml version="1.0" encoding="UTF-8"?>
121
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
122
+ <plist version="1.0">
123
+ <dict>
124
+ <key>Label</key>
125
+ <string>com.mysite.daily-update</string>
126
+ <key>StandardOutPath</key>
127
+ <string>/Users/rien/mysite-daily-update.log</string>
128
+ <key>StandardErrorPath</key>
129
+ <string>/Users/rien/mysite-daily-update.error.log</string>
130
+ <key>Program</key>
131
+ <string>/Users/rien/mysite-daily-update.script</string>
132
+ <key>StartCalendarInterval</key>
133
+ <dict>
134
+ <key>Hour</key>
135
+ <integer>00</integer>
136
+ <key>Minute</key>
137
+ <integer>01</integer>
138
+ </dict>
139
+ </dict>
140
+ </plist>
141
+ ~~~~~
142
+
143
+ One thing to notice is that this specification also tells the OS to create an error and a log file. These files are written to the users root directory and can be examined for error messages.
144
+
145
+ The `Hour` and `Minute` keys and their values specify the time when the script should be executed. Take note of this because when you are in the habit of switching off the server at certain times, this may result in missing the site-generation for that day.
146
+
147
+ Btw, a good resource for the capabilities and configuration of the launchd can be found at: [http://www.launchd.info](http://www.launchd.info).
148
+
149
+ ### Load the cron job (manually)
150
+
151
+ The job will be loaded automatically at startup. But right now you will need to load the job by hand:
152
+
153
+ ~~~~~
154
+ launchctl load ~/Library/LaunchAgents/com.mysite.plist
155
+ ~~~~~
156
+
157
+ Most likely you will also want to test the script, that can be done with:
158
+
159
+ ~~~~~
160
+ launchctl start com.mysite.daily-update
161
+ ~~~~~
162
+
163
+ The first couple of times, make sure to check for an error log in the `StandardErrorPath`. (Which in this example is the user home directory)
164
+
165
+ For completion, there are also the `unload` and `stop` options for `launchctl`. Only when the plist file is changed does one need to unload it.
166
+
167
+ ## In closing
168
+
169
+ With the above information it should be possible to set up a daily re-generation of the site, and to automatically upload it to the appropriate server directory.
170
+
171
+ If a dedicated server is used and the git-server directory is accessable from outside, this is also a very convenient method to create pages and posts from outside your local domain. I.e. when travelling. It is even possible to use this to contribute to the site by multiple authors.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classic-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -202,6 +202,7 @@ files:
202
202
  - pages/jekyll/01-jekyll.md
203
203
  - pages/jekyll/02-speed.md
204
204
  - pages/jekyll/03-ruby.md
205
+ - pages/jekyll/04-cron-job.md
205
206
  - pages/layouts/banner-main.md
206
207
  - pages/layouts/blocks.md
207
208
  - pages/layouts/landing-page.md