jekyll-recker 1.2.2 → 1.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7c17927e227e392e2bf48faf7e623e463ab8ef3647f83ddbca8217980bbb511
4
- data.tar.gz: e59bab85cee9f9c5e5d2aedbf4a3978df4f68bc0b06657a31e5e45b7f37f0ac4
3
+ metadata.gz: fd8510af30e4a225fa87cd6d3ba197cd38517634947897ca60ccfccc80055dbd
4
+ data.tar.gz: 94e7fee9f82e53e73658cadee253f7dcb592404c81cf785dd74b86772dbd9052
5
5
  SHA512:
6
- metadata.gz: bf113a841c5986758ab082aadcdd094d5db6ffbdfe8d53e877b3a37093f3a457cb2b44431b8d0b5b41dde677d0912f1d0e72422e90831089485058f3f96acbd7
7
- data.tar.gz: 17758558184be22b37e0fae164c77226e8d5cee64d4884367ddbbc1566348cf7f1a56634a68ec09a37d5d464398e052364cc0ad5b36ffba1b63a66f7fcc41099
6
+ metadata.gz: 892465a9e44dd0317193f1f927fab37e50e88648c7360eadd314bc8eb36ace26449ed0c18c7b5e88e2c1f17c2f12daf3d06e770877db231c6d2d8719a25bee89
7
+ data.tar.gz: 3a742c9c17d0079d309f40da244b7db9c7df5b49c7ee76598e4b84364abdfd13ea08605f05213562a2306b0f6982722a49c831f43ba4df55cc221535951857c2
data/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # jekyll-recker
2
+
3
+ This is the jekyll plugin I use for [my personal website]. The source
4
+ code is available on [github].
5
+
6
+ ## Installation
7
+
8
+ Add `jekyll-recker` to the `jekyll_plugins` group in your `Gemfile`.
9
+
10
+ group :jekyll_plugins do
11
+ gem 'jekyll-recker'
12
+ end
13
+
14
+ Then add the plugin to jekyll site's `config.yml` file.
15
+
16
+ pugins:
17
+ - jekyll-recker
18
+
19
+ If you'd like to make your site look like mine too, set the theme in
20
+ `config.yml` too.
21
+
22
+ theme: jekyll-recker
23
+
24
+ ## Usage
25
+
26
+ ### Share
27
+
28
+ Use the `share` jekyll command to post a link to your latest published
29
+ blog post to any or all of the configured Shares.
30
+
31
+ # TODO: example of `be jekyll share`
32
+
33
+ Perform a test run with the `--dry` flag.
34
+
35
+ # TODO: example of `be jekyll share --dry`
36
+
37
+ Send to all configured shares, or just pick one of them.
38
+
39
+ $ jekyll share slack
40
+ $ jekyll share twitter
41
+
42
+ #### Slack
43
+
44
+ Send the latest published post to a slack channel.
45
+
46
+ ![example slack]
47
+
48
+ Configure the slack share in `_config.yml`.
49
+
50
+ recker:
51
+ slack:
52
+ myteam:
53
+ channel: '#blogs'
54
+ username: 'blogbot'
55
+ emoji: ':robot:'
56
+ webhook_cmd: cat ~/.secrets/slack-webhook.txt
57
+
58
+ Use the `webhook_cmd` option to shell out to `gpg` or another CLI
59
+ password manager. Alternatively, you can supply the private incoming
60
+ webhook using an environment variable.
61
+
62
+ export SLACK_MYTEAM_WEBHOOK="https://.../" # SLACK_ + MyTeam.upcase + _WEBHOOK
63
+
64
+ Multiple teams are supported as well.
65
+
66
+ recker:
67
+ slack:
68
+ MyTeamA:
69
+ channel: '#blogs'
70
+ username: 'blogbot'
71
+ emoji: ':robot:'
72
+ MyTeamB:
73
+ channel: '#blogs'
74
+ username: 'blogbot'
75
+ emoji: ':robot:'
76
+ MyTeamC:
77
+ channel: '#blogs'
78
+ username: 'blogbot'
79
+ emoji: ':robot:'
80
+
81
+ #### Twitter
82
+
83
+ Send a tweet with a link to the latest published post.
84
+
85
+ ![example tweet]
86
+
87
+ Configure the tweet share in `_config.yml`.
88
+
89
+ recker:
90
+ twitter:
91
+ access_token_secret_cmd: pass twitter/reckerbot/access-token-secret
92
+ access_token_cmd: pass twitter/reckerbot/access-token
93
+ consumer_api_key_cmd: pass twitter/reckerbot/consumer-api-key
94
+ consumer_api_secret_cmd: pass twitter/reckerbot/consumer-api-secret-key
95
+
96
+ Alternatively, ensure these environment variables are set.
97
+
98
+ export ACCESS_TOKEN_SECRET="..."
99
+ export ACCESS_TOKEN="..."
100
+ export CONSUMER_API_KEY="..."
101
+ export CONSUMER_API_SECRET="..."
102
+
103
+ [example slack]: screenshots/example-slack.png
104
+ [example tweet]: screenshots/example-tweet.png
105
+ [github]: https://www.github.com/arecker/blog
106
+ [my personal website]: https://www.alexrecker.com
@@ -1,5 +1,5 @@
1
1
  <footer>
2
- built with <a href="https://jekyllrb.com/">jekyll</a> using <a href="{% link README.org %}">jekyll-recker</a> v{% recker_version %}
2
+ built with <a href="https://jekyllrb.com/">jekyll</a> using <a href="{% link doc/index.html %}">jekyll-recker</a> v{% recker_version %}
3
3
  <br/>
4
4
  <small>&copy; copyright {{ 'now' | date: '%Y' }}, {{ site.author }}</small>
5
5
  </footer>
data/_includes/nav.html CHANGED
@@ -1,8 +1,8 @@
1
1
  <nav>
2
2
  <a href="{{ site.baseurl }}/" class="{% if page.active == 'index' %}active{% endif %}">index</a>
3
3
  <a href="{% link archive.html %}" class="{% if page.active == 'archive' %}active{% endif %}">archive</a>
4
- <a href="{% link stats.org %}" class="{% if page.active == 'stats' %}active{% endif %}">stats</a>
5
- <a href="{% link projects.html %}" class="{% if page.active == 'projects' %}active{% endif %}">projects</a>
6
- <a href="{% link contact.html %}" class="{% if page.active == 'contact' %}active{% endif %}">contact</a>
4
+ <a href="{% link stats.md %}" class="{% if page.active == 'stats' %}active{% endif %}">stats</a>
5
+ <a href="{% link projects.md %}" class="{% if page.active == 'projects' %}active{% endif %}">projects</a>
6
+ <a href="{% link contact.md %}" class="{% if page.active == 'contact' %}active{% endif %}">contact</a>
7
7
  <span class="float-right hide-on-mobile">{{ page.slug }}</span>
8
8
  </nav>
@@ -3,7 +3,9 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <title>{{ site.title }} | {{ page.title | default: site.description }}</title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <link href="{{ site.baseurl }}/assets/open-sans.css" rel="stylesheet"/>
8
+ <link href="{{ site.baseurl }}/assets/inconsolata.css" rel="stylesheet"/>
7
9
  <link href="{{ site.baseurl }}/assets/jekyll-recker.css" rel="stylesheet"/>
8
10
  </head>
9
11
  <body>
@@ -0,0 +1,27 @@
1
+ /* vietnamese */
2
+ @font-face {
3
+ font-family: 'Inconsolata';
4
+ font-style: normal;
5
+ font-weight: 400;
6
+ font-display: swap;
7
+ src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v18/QldKNThLqRwH-OJ1UHjlKGlW5qhExfHwNJU.woff2) format('woff2');
8
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
9
+ }
10
+ /* latin-ext */
11
+ @font-face {
12
+ font-family: 'Inconsolata';
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ font-display: swap;
16
+ src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v18/QldKNThLqRwH-OJ1UHjlKGlX5qhExfHwNJU.woff2) format('woff2');
17
+ unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
18
+ }
19
+ /* latin */
20
+ @font-face {
21
+ font-family: 'Inconsolata';
22
+ font-style: normal;
23
+ font-weight: 400;
24
+ font-display: swap;
25
+ src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v18/QldKNThLqRwH-OJ1UHjlKGlZ5qhExfHw.woff2) format('woff2');
26
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
27
+ }
@@ -1,7 +1,5 @@
1
1
  ---
2
2
  ---
3
- @import 'https://fonts.googleapis.com/css?family=Open+Sans&display=swap';
4
- @import 'https://fonts.googleapis.com/css?family=Inconsolata&display=swap';
5
3
 
6
4
  .float-right {
7
5
  float: right;
@@ -43,8 +41,6 @@ h1, h2, h3 {
43
41
  }
44
42
 
45
43
  header {
46
- text-transform: lowercase;
47
-
48
44
  h1 {
49
45
  margin-bottom: 9px;
50
46
  }
@@ -0,0 +1,63 @@
1
+ /* cyrillic-ext */
2
+ @font-face {
3
+ font-family: 'Open Sans';
4
+ font-style: normal;
5
+ font-weight: 400;
6
+ font-display: swap;
7
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2) format('woff2');
8
+ unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
9
+ }
10
+ /* cyrillic */
11
+ @font-face {
12
+ font-family: 'Open Sans';
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ font-display: swap;
16
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2) format('woff2');
17
+ unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
18
+ }
19
+ /* greek-ext */
20
+ @font-face {
21
+ font-family: 'Open Sans';
22
+ font-style: normal;
23
+ font-weight: 400;
24
+ font-display: swap;
25
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2) format('woff2');
26
+ unicode-range: U+1F00-1FFF;
27
+ }
28
+ /* greek */
29
+ @font-face {
30
+ font-family: 'Open Sans';
31
+ font-style: normal;
32
+ font-weight: 400;
33
+ font-display: swap;
34
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2) format('woff2');
35
+ unicode-range: U+0370-03FF;
36
+ }
37
+ /* vietnamese */
38
+ @font-face {
39
+ font-family: 'Open Sans';
40
+ font-style: normal;
41
+ font-weight: 400;
42
+ font-display: swap;
43
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2) format('woff2');
44
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
45
+ }
46
+ /* latin-ext */
47
+ @font-face {
48
+ font-family: 'Open Sans';
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ font-display: swap;
52
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2) format('woff2');
53
+ unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
54
+ }
55
+ /* latin */
56
+ @font-face {
57
+ font-family: 'Open Sans';
58
+ font-style: normal;
59
+ font-weight: 400;
60
+ font-display: swap;
61
+ src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v17/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2');
62
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
63
+ }
@@ -5,6 +5,7 @@ module Jekyll
5
5
  module Commands
6
6
  # Slack
7
7
  class Slack < Jekyll::Command
8
+ include LoggingMixin
8
9
  class << self
9
10
  def init_with_program(prog)
10
11
  prog.command(:slack) do |c|
@@ -13,13 +14,13 @@ module Jekyll
13
14
  c.option 'dry', '-d', '--dry', 'print message instead of posting'
14
15
  c.action do |_args, options|
15
16
  Recker::Slack.each_in_config(dry: options['dry']) do |client|
16
- Recker.info "#{client.key}: discovering webhook"
17
+ logger.info "#{client.key}: discovering webhook"
17
18
  client.discover_webhook!
18
- Recker.info "#{client.key}: posting #{client.latest.data['title']}"
19
+ logger.info "#{client.key}: posting #{client.latest.data['title']}"
19
20
  client.post_latest!
20
21
  end
21
22
  rescue ReckerError => e
22
- Recker.abort_with e.message
23
+ logger.abort_with e.message
23
24
  end
24
25
  end
25
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Recker
3
5
  # Configuration
@@ -94,7 +94,7 @@ module Jekyll
94
94
  entry_dates.slice_when do |prev, curr|
95
95
  curr != prev - 1
96
96
  end.each do |dates|
97
- first, last = dates.min, dates.max
97
+ first, last = dates.minmax
98
98
  _streaks << [(last - first).to_i, [first, last]]
99
99
  end
100
100
  _streaks
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Recker
5
- VERSION = '1.2.2'
5
+ VERSION = '1.2.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-recker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Recker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-04 00:00:00.000000000 Z
11
+ date: 2020-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
55
  description:
84
56
  email:
85
57
  - alex@reckerfamily.com
@@ -88,7 +60,7 @@ extensions: []
88
60
  extra_rdoc_files: []
89
61
  files:
90
62
  - LICENSE
91
- - README.org
63
+ - README.md
92
64
  - _includes/footer.html
93
65
  - _includes/header.html
94
66
  - _includes/nav.html
@@ -96,7 +68,9 @@ files:
96
68
  - _layouts/home.html
97
69
  - _layouts/page.html
98
70
  - _layouts/post.html
71
+ - assets/inconsolata.css
99
72
  - assets/jekyll-recker.scss
73
+ - assets/open-sans.css
100
74
  - lib/jekyll-recker.rb
101
75
  - lib/jekyll-recker/commands.rb
102
76
  - lib/jekyll-recker/commands/share.rb
data/README.org DELETED
@@ -1,205 +0,0 @@
1
- #+TITLE: jekyll-recker
2
- #+SLUG: jekyll-recker.html
3
- #+PERMALINK: jekyll-recker.html
4
- #+STARTUP: showall
5
- #+DESCRIPTION: my website's custom jekyll plugin
6
-
7
- This is the jekyll plugin for my personal website. Source code
8
- available on [[https://github.com/arecker/blog][github]].
9
-
10
- ** Installation
11
-
12
- Add =jekyll-recker= to the =jekyll_plugins= group of your =Gemfile=.
13
-
14
- #+BEGIN_SRC ruby
15
- group :jekyll_plugins do
16
- gem 'jekyll-recker'
17
- end
18
- #+END_SRC
19
-
20
- Add =jekyll-recker= to the list of plugins in jekyll's =_config.yml=.
21
-
22
- #+BEGIN_SRC yaml
23
- # _config.yaml
24
- plugins:
25
- - jekyll-recker
26
- #+END_SRC
27
-
28
- Set the theme.
29
-
30
- #+BEGIN_SRC yaml
31
- theme: jekyll-recker
32
- #+END_SRC
33
-
34
- Install and enjoy.
35
-
36
- #+BEGIN_SRC sh
37
- bundle install
38
- bundle exec jekyll serve
39
- #+END_SRC
40
-
41
- ** Usage
42
-
43
- *** Commands
44
-
45
- **** =slack=
46
-
47
- The =slack= command posts a slack message advertising the latest
48
- published jekyll blog post using a private incoming webhook.
49
-
50
- Configure _config.yml
51
-
52
- #+BEGIN_SRC yaml
53
- # _config.yml
54
- recker:
55
- slack:
56
- MyTeam:
57
- channel: '#blogs' # required!
58
- username: 'blogbot' # required!
59
- emoji: ':robot:' # required!
60
- #+END_SRC
61
-
62
- Multiple teams are supported too!
63
-
64
- #+BEGIN_SRC yaml
65
- # _config.yml
66
- recker:
67
- slack:
68
- MyTeamA:
69
- channel: '#blogs' # required!
70
- username: 'blogbot' # required!
71
- emoji: ':robot:' # required!
72
- MyTeamB:
73
- channel: '#blogs' # required!
74
- username: 'blogbot' # required!
75
- emoji: ':robot:' # required!
76
- MyTeamC:
77
- channel: '#blogs' # required!
78
- username: 'blogbot' # required!
79
- emoji: ':robot:' # required!
80
- #+END_SRC
81
-
82
-
83
- Supply the private webhook through an environment variable.
84
-
85
- #+BEGIN_SRC sh
86
- export SLACK_MYTEAM_WEBHOOK="https://..." # SLACK_ + <MyTeam.upcase> + _WEBHOOK
87
- #+END_SRC
88
-
89
- Alternatively, add the command with which to retrieve the webhook in
90
- _config.yml
91
-
92
- #+BEGIN_SRC yaml
93
- # _config.yml
94
- recker:
95
- slack:
96
- MyTeam:
97
- webhook_cmd: cat secrets/my-teams-secret-webhook.txt
98
- #+END_SRC
99
-
100
- Run =bundle exec jekyll slack= to let it rip!
101
-
102
- [[assets/images/example-slack.png]]
103
-
104
- Using the =--dry= flag, you can preview the message post without
105
- actually posting anything.
106
-
107
- #+BEGIN_EXAMPLE
108
- arecker@25732-arecker:~/src/blog$ be jekyll slack --dry
109
- Configuration file: /Users/arecker/src/blog/_config.yml
110
- jekyll-recker: reckerfamily: discovering webhook
111
- Configuration file: /Users/arecker/src/blog/_config.yml
112
- jekyll-recker: reckerfamily: posting drag racing, windshield wipers, and alex's painting tips
113
- jekyll-recker: postign in dry mode, printing message
114
- jekyll-recker: BEGIN MESSAGE
115
- Sunday, March 15 2020
116
- drag racing, windshield wipers, and alex's painting tips
117
- https://www.alexrecker.com/2020-03-15.html
118
- END MESSAGE
119
- #+END_EXAMPLE
120
-
121
- **** =tweet=
122
-
123
- The =tweet= command tweets a link to the latest published jekyll blog
124
- post.
125
-
126
- Ensure the following environment variables are set,.
127
-
128
- #+BEGIN_SRC sh
129
- export ACCESS_TOKEN_SECRET="..."
130
- export ACCESS_TOKEN="..."
131
- export CONSUMER_API_KEY="..."
132
- export CONSUMER_API_SECRET="..."
133
- #+END_SRC
134
-
135
- Alternatively, configure which commands to run to fetch the secrets.
136
-
137
- #+BEGIN_SRC yaml
138
- # _config.yml
139
- recker:
140
- twitter:
141
- access_token_secret_cmd: cat secrets/access-token-secret
142
- access_token_cmd: cat secrets/access-token
143
- consumer_api_key_cmd: cat secrets/consumer-api-key
144
- consumer_api_secret_cmd: cat secrets/consumer-api-secret-key
145
- #+END_SRC
146
-
147
- Run =bundle exec jekyll tweet= to let it rip!
148
-
149
- [[assets/images/example-tweet.png]]
150
-
151
- Using the =--dry= flag, you can test your configuration without
152
- actually tweeting anything.
153
-
154
- #+BEGIN_EXAMPLE
155
- arecker@25732-arecker:~/src/blog$ be jekyll tweet --dry
156
- jekyll-recker: discovering credentials
157
- Configuration file: /Users/arecker/src/blog/_config.yml
158
- Configuration file: /Users/arecker/src/blog/_config.yml
159
- jekyll-recker: tweeting drag racing, windshield wipers, and alex's painting tips
160
- jekyll-recker: tweeting in dry mode, printing message
161
- jekyll-recker: BEGIN TWEET
162
- Sunday, March 15 2020
163
- drag racing, windshield wipers, and alex's painting tips
164
- https://www.alexrecker.com/2020-03-15.html
165
- END TWEET
166
- #+END_EXAMPLE
167
-
168
- *** Generators
169
-
170
- **** =stats=
171
-
172
- On build time, =jekyll-recker= calculates and stores the following
173
- stats in the =site.data.stats= object
174
-
175
- | Field Name | Field Description |
176
- |-----------------+------------------------------------------------------|
177
- | =posts= | The total number of published posts. |
178
- | =words.total= | The total number of words from all published post. |
179
- | =words.average= | The average number of words for each published post. |
180
- | =days.days= | Current streak of daily, consecutive posts. |
181
- | =days.start= | First day of current streak. |
182
- | =days.end= | Last day of current streak. |
183
-
184
- Use these variables to render your own page of neat writing statistics!
185
-
186
- #+BEGIN_SRC html
187
- <table>
188
- <tr>
189
- <th>Total Posts</th>
190
- <th>Total Words</th>
191
- <th>Average Words per Post</th>
192
- <th>Current Streak</th>
193
- <th>First day of current streak</th>
194
- <th>Last day of current streak</th>
195
- </tr>
196
- <tr>
197
- <td>{{ site.data.stats.posts }}</td>
198
- <td>{{ site.data.stats.words.total }}</td>
199
- <td>{{ site.data.stats.words.average }}</td>
200
- <td>{{ site.data.stats.days.days }}</td>
201
- <td>{{ site.data.stats.days.start }}</td>
202
- <td>{{ site.data.stats.days.end }}</td>
203
- </tr>
204
- </table>
205
- #+END_SRC