fenton-jekyll-boilerplate 0.0.4 → 0.0.6

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: af30c302bcf50fae1383a74f61613dc3726292676d0cec2fab01e0d70219bd15
4
- data.tar.gz: e112fc85ae75e903f15942681485fca1bb86c9abf39e7c0da76aec06e05ffbdd
3
+ metadata.gz: f0d1a8a76ec9b945ff3ab8e850ea6874390b5abbb02d68d11a750427142810de
4
+ data.tar.gz: a72394148f74d7fa8bf7a4cc751e44978945095982ce351b1f3285bddc96dec2
5
5
  SHA512:
6
- metadata.gz: 8fbf9ad896fdd6cd5040abaaab5f635d9907e7ffec5e03908daae431b2c8f5ca61681930b5a00040158e456eadf1364ea9f3f6bf76e6276c5cf3cf4d3cb95c48
7
- data.tar.gz: 76eb029b5839ffb4c5f334ae32a8b0b0e3e2fc79253595e468eb75fc597825474b2b172a95484b8f55952e943458999ac0ea28fd3e6321ecb0003f7d8d98c3ad
6
+ metadata.gz: f6b74abfacb10010e0445fbe914d29e8757de93b42c746df7f9e34bf4e77a5f9bbf78215cf8b7aad5b2be336fa365a3d47fc2772afa2adb55e5efc0bdf9aaf72
7
+ data.tar.gz: 528baee39ddef889baf502beeef69fd884b4df3a1bd8d12c0088ca75b35712c8de1429bbe9318a351272582dfa6c3f39a19c5c612f540de3d9fdf41e517c23c3
data/_data/language.yaml CHANGED
@@ -3,6 +3,9 @@
3
3
  # template:
4
4
  # term:
5
5
  # en: Translation
6
+ #
7
+ # If you are running Jekyll v4.3.0 or higher, you don't need this file in your site
8
+ # as it will be read from the theme's _data folder
6
9
 
7
10
  skiplinks:
8
11
  skip_to_navigation:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fenton-jekyll-boilerplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Fenton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-13 00:00:00.000000000 Z
11
+ date: 2022-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -47,7 +47,6 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - LICENSE
49
49
  - README.md
50
- - _authors/steve-fenton.md
51
50
  - _data/language.yaml
52
51
  - _includes/analytics.html
53
52
  - _includes/breadcrumbs.html
@@ -62,11 +61,6 @@ files:
62
61
  - _layouts/page.html
63
62
  - _layouts/post.html
64
63
  - _layouts/search.html
65
- - _plugins/article_paging.rb
66
- - _plugins/breadcrumbs.rb
67
- - _plugins/liquid_language.rb
68
- - _plugins/liquid_regex.rb
69
- - _plugins/markdown.rb
70
64
  - assets/css/code.css
71
65
  - assets/css/main.css
72
66
  - assets/css/vars.css
@@ -76,11 +70,6 @@ files:
76
70
  - assets/icons/favicon-16x16.png
77
71
  - assets/icons/favicon-32x32.png
78
72
  - assets/icons/favicon.ico
79
- - assets/img/2022/09/surface-accessories-700.webp
80
- - assets/img/2022/09/surface-accessories.webp
81
- - assets/img/authors/steve-fenton.webp
82
- - assets/img/jekyll-and-hyde.webp
83
- - assets/img/lighthouse-scores.webp
84
73
  - assets/js/main.js
85
74
  - assets/js/modules/animation.js
86
75
  - assets/js/modules/click-blocks.js
@@ -93,10 +82,6 @@ files:
93
82
  - assets/js/modules/resizing.js
94
83
  - assets/js/modules/string.js
95
84
  - assets/js/search.js
96
- - assets/svg/down.svg
97
- - favicon.ico
98
- - robots.txt
99
- - sitemap.xml
100
85
  homepage: https://jekyll.stevefenton.co.uk/
101
86
  licenses:
102
87
  - Apache-2.0
@@ -1,21 +0,0 @@
1
- ---
2
- username: steve-fenton
3
- name: Steve Fenton
4
- location: UK
5
- url_full: https://www.stevefenton.co.uk/
6
- url_short: stevefenton.co.uk
7
- bio: Steve is the creator of Jekyll Boilerplate
8
- picture: assets/img/authors/steve-fenton.webp
9
- twitter: _stevefenton
10
- date: 2022-09-12
11
- nav-sitemap: true
12
- nav-search: true
13
- ---
14
-
15
- This is some information about Steve Fenton.
16
-
17
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sit amet elit sodales, egestas odio eu, interdum nunc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elit odio, dapibus nec finibus sit amet, aliquam a tortor.
18
-
19
- Sed ultricies sollicitudin ipsum at bibendum. Nulla euismod erat arcu, vel convallis risus sagittis non. Fusce scelerisque arcu nec blandit dictum. In vel ultricies nisi. Vivamus pharetra, nibh sit amet semper tristique, leo sapien scelerisque risus, a pharetra tortor lectus at nisl.
20
-
21
- Vestibulum dui mauris, mattis mattis hendrerit non, aliquam non sem. Nullam orci arcu, viverra vel quam sed, dapibus porta dui. Etiam venenatis ipsum eget mi sodales lobortis. Donec varius non metus eget congue. Suspendisse quis mauris vitae lectus porttitor placerat at quis sapien.
@@ -1,223 +0,0 @@
1
- module Paginate
2
- class Pagination < Jekyll::Generator
3
- # This generator is safe from arbitrary code execution.
4
- safe true
5
-
6
- # This generator should be passive with regard to its execution
7
- priority :lowest
8
-
9
- # Generate paginated pages if necessary.
10
- #
11
- # site - The Site.
12
- #
13
- # Returns nothing.
14
- def generate(site)
15
- if Pager.pagination_enabled?(site)
16
- if template = self.class.template_page(site)
17
- paginate(site, template)
18
- else
19
- Jekyll.logger.warn "Pagination:", "Pagination is enabled, but I couldn't find " +
20
- "an index.html page to use as the pagination template. Skipping pagination."
21
- end
22
- end
23
- end
24
-
25
- # Paginates the blog's posts. Renders the index.html file into paginated
26
- # directories, e.g.: page2/index.html, page3/index.html, etc and adds more
27
- # site-wide data.
28
- #
29
- # site - The Site.
30
- # page - The index.html Page that requires pagination.
31
- #
32
- # {"paginator" => { "page" => <Number>,
33
- # "per_page" => <Number>,
34
- # "posts" => [<Post>],
35
- # "total_posts" => <Number>,
36
- # "total_pages" => <Number>,
37
- # "previous_page" => <Number>,
38
- # "next_page" => <Number> }}
39
- def paginate(site, page)
40
- all_posts = site.site_payload['site']['posts'].reject { |post| post['hidden'] }
41
- pages = Pager.calculate_pages(all_posts, site.config['page_size'].to_i)
42
- (1..pages).each do |num_page|
43
- pager = Pager.new(site, num_page, all_posts, pages)
44
- if num_page > 1
45
- newpage = Jekyll::Page.new(site, site.source, page.dir, page.name)
46
- newpage.pager = pager
47
- newpage.dir = Pager.paginate_path(site, num_page)
48
- site.pages << newpage
49
- else
50
- page.pager = pager
51
- end
52
- end
53
- end
54
-
55
- # Static: Fetch the URL of the template page. Used to determine the
56
- # path to the first pager in the series.
57
- #
58
- # site - the Jekyll::Site object
59
- #
60
- # Returns the url of the template page
61
- def self.first_page_url(site)
62
- if page = Pagination.template_page(site)
63
- page.url
64
- else
65
- nil
66
- end
67
- end
68
-
69
- # Public: Find the Jekyll::Page which will act as the pager template
70
- #
71
- # site - the Jekyll::Site object
72
- #
73
- # Returns the Jekyll::Page which will act as the pager template
74
- def self.template_page(site)
75
- site.pages.select do |page|
76
- Pager.pagination_candidate?(site.config, page)
77
- end.sort do |one, two|
78
- two.path.size <=> one.path.size
79
- end.first
80
- end
81
-
82
- end
83
- end
84
-
85
- module Paginate
86
- class Pager
87
- attr_reader :page, :per_page, :posts, :total_posts, :total_pages,
88
- :previous_page, :previous_page_path, :next_page, :next_page_path
89
-
90
- # Calculate the number of pages.
91
- #
92
- # all_posts - The Array of all Posts.
93
- # per_page - The Integer of entries per page.
94
- #
95
- # Returns the Integer number of pages.
96
- def self.calculate_pages(all_posts, per_page)
97
- (all_posts.size.to_f / per_page.to_i).ceil
98
- end
99
-
100
- # Determine if pagination is enabled the site.
101
- #
102
- # site - the Jekyll::Site object
103
- #
104
- # Returns true if pagination is enabled, false otherwise.
105
- def self.pagination_enabled?(site)
106
- !site.config['page_size'].nil? &&
107
- site.pages.size > 0
108
- end
109
-
110
- # Static: Determine if a page is a possible candidate to be a template page.
111
- # Page's name must be `index.html` and exist in any of the directories
112
- # between the site source and `paginate_path`.
113
- #
114
- # config - the site configuration hash
115
- # page - the Jekyll::Page about which we're inquiring
116
- #
117
- # Returns true if the
118
- def self.pagination_candidate?(config, page)
119
- page_dir = File.dirname(File.expand_path(remove_leading_slash(page.path), config['source']))
120
- paginate_path = remove_leading_slash(config['paginate_path'])
121
- paginate_path = File.expand_path(paginate_path, config['source'])
122
- page.name == 'index.html' &&
123
- in_hierarchy(config['source'], page_dir, File.dirname(paginate_path))
124
- end
125
-
126
- # Determine if the subdirectories of the two paths are the same relative to source
127
- #
128
- # source - the site source
129
- # page_dir - the directory of the Jekyll::Page
130
- # paginate_path - the absolute paginate path (from root of FS)
131
- #
132
- # Returns whether the subdirectories are the same relative to source
133
- def self.in_hierarchy(source, page_dir, paginate_path)
134
- return false if paginate_path == File.dirname(paginate_path)
135
- return false if paginate_path == Pathname.new(source).parent
136
- page_dir == paginate_path ||
137
- in_hierarchy(source, page_dir, File.dirname(paginate_path))
138
- end
139
-
140
- # Static: Return the pagination path of the page
141
- #
142
- # site - the Jekyll::Site object
143
- # num_page - the pagination page number
144
- #
145
- # Returns the pagination path as a string
146
- def self.paginate_path(site, num_page)
147
- return nil if num_page.nil?
148
- return Pagination.first_page_url(site) if num_page <= 1
149
- format = site.config['paginate_path']
150
- if format.include?(":num")
151
- format = format.sub(':num', num_page.to_s)
152
- else
153
- raise ArgumentError.new("Invalid pagination path: '#{format}'. It must include ':num'.")
154
- end
155
- ensure_leading_slash(format)
156
- end
157
-
158
- # Static: Return a String version of the input which has a leading slash.
159
- # If the input already has a forward slash in position zero, it will be
160
- # returned unchanged.
161
- #
162
- # path - a String path
163
- #
164
- # Returns the path with a leading slash
165
- def self.ensure_leading_slash(path)
166
- path[0..0] == "/" ? path : "/#{path}"
167
- end
168
-
169
- # Static: Return a String version of the input without a leading slash.
170
- #
171
- # path - a String path
172
- #
173
- # Returns the input without the leading slash
174
- def self.remove_leading_slash(path)
175
- ensure_leading_slash(path)[1..-1]
176
- end
177
-
178
- # Initialize a new Pager.
179
- #
180
- # site - the Jekyll::Site object
181
- # page - The Integer page number.
182
- # all_posts - The Array of all the site's Posts.
183
- # num_pages - The Integer number of pages or nil if you'd like the number
184
- # of pages calculated.
185
- def initialize(site, page, all_posts, num_pages = nil)
186
- @page = page
187
- @per_page = site.config['page_size'].to_i
188
- @total_pages = num_pages || Pager.calculate_pages(all_posts, @per_page)
189
-
190
- if @page > @total_pages
191
- raise RuntimeError, "page number can't be greater than total pages: #{@page} > #{@total_pages}"
192
- end
193
-
194
- init = (@page - 1) * @per_page
195
- offset = (init + @per_page - 1) >= all_posts.size ? all_posts.size : (init + @per_page - 1)
196
-
197
- @total_posts = all_posts.size
198
- @posts = all_posts[init..offset]
199
- @previous_page = @page != 1 ? @page - 1 : nil
200
- @previous_page_path = Pager.paginate_path(site, @previous_page)
201
- @next_page = @page != @total_pages ? @page + 1 : nil
202
- @next_page_path = Pager.paginate_path(site, @next_page)
203
- end
204
-
205
- # Convert this Pager's data to a Hash suitable for use by Liquid.
206
- #
207
- # Returns the Hash representation of this Pager.
208
- def to_liquid
209
- {
210
- 'page' => page,
211
- 'per_page' => per_page,
212
- 'posts' => posts,
213
- 'total_posts' => total_posts,
214
- 'total_pages' => total_pages,
215
- 'previous_page' => previous_page,
216
- 'previous_page_path' => previous_page_path,
217
- 'next_page' => next_page,
218
- 'next_page_path' => next_page_path
219
- }
220
- end
221
-
222
- end
223
- end
@@ -1,109 +0,0 @@
1
- module Jekyll
2
- module Breadcrumbs
3
- class BreadcrumbItem < Liquid::Drop
4
- extend Forwardable
5
-
6
- def initialize(side)
7
- @side = side
8
- end
9
-
10
- def position
11
- @side[:position]
12
- end
13
-
14
- def title
15
- @side[:title]
16
- end
17
-
18
- def url
19
- @side[:url]
20
- end
21
-
22
- def rootimage
23
- @side[:root_image]
24
- end
25
-
26
- end
27
- end
28
- end
29
-
30
- module Jekyll
31
- module Breadcrumbs
32
- @@config = {}
33
- @@siteAddress = ""
34
- @@sideAddresses = {}
35
-
36
- def self.clearAddressCache
37
- @@sideAddresses = {}
38
- end
39
-
40
- def self.loadAddressCache(site)
41
- clearAddressCache
42
- site.documents.each { |page| addAddressItem(page.url, page['nav-title'] || page['title'] || '') } # collection files including posts
43
- site.pages.each { |page| addAddressItem(page.url, page['nav-title'] || page['title'] || '') } # pages
44
- site.posts.docs.each { |page| addAddressItem(page.url, page['nav-title'] || page['title'] || '') } # posts
45
- end
46
-
47
- def self.addAddressItem(url, title)
48
- key = createAddressCacheKey(url)
49
- @@sideAddresses[key] = {:url => url, :title => title}
50
- end
51
-
52
- def self.findAddressItem(path)
53
- key = createAddressCacheKey(path)
54
- @@sideAddresses[key] if key
55
- end
56
-
57
- def self.createAddressCacheKey(path)
58
- path.chomp("/").empty? ? "/" : path.chomp("/")
59
- end
60
-
61
- def self.buildSideBreadcrumbs(side, payload)
62
- payload["breadcrumbs"] = []
63
- return if side.url == @@siteAddress && root_hide === true
64
-
65
- drop = Jekyll::Breadcrumbs::BreadcrumbItem
66
- position = 0
67
-
68
- path = side.url.chomp("/").split(/(?=\/)/)
69
- -1.upto(path.size - 1) do |int|
70
- joined_path = int == -1 ? "" : path[0..int].join
71
- item = findAddressItem(joined_path)
72
- if item
73
- position += 1
74
- item[:position] = position
75
- item[:root_image] = root_image
76
- payload["breadcrumbs"] << drop.new(item)
77
- end
78
- end
79
- end
80
-
81
- # Config
82
- def self.loadConfig(site)
83
- config = site.config["breadcrumbs"] || {"root" => {"hide" => false, "image" => false}}
84
- root = config["root"]
85
- @@config[:root_hide] = root["hide"] || false
86
- @@config[:root_image] = root["image"] || false
87
-
88
- @@siteAddress = site.config["baseurl"] || "/"
89
- @@siteAddress = "/" if @@siteAddress.empty?
90
- end
91
-
92
- def self.root_hide
93
- @@config[:root_hide]
94
- end
95
-
96
- def self.root_image
97
- @@config[:root_image]
98
- end
99
- end
100
- end
101
-
102
- Jekyll::Hooks.register :site, :pre_render do |site, payload|
103
- Jekyll::Breadcrumbs::loadConfig(site)
104
- Jekyll::Breadcrumbs::loadAddressCache(site)
105
- end
106
-
107
- Jekyll::Hooks.register [:pages, :documents], :pre_render do |side, payload|
108
- Jekyll::Breadcrumbs::buildSideBreadcrumbs(side, payload)
109
- end
@@ -1,38 +0,0 @@
1
- require 'liquid'
2
-
3
- module Jekyll
4
- module Language
5
-
6
- @@lang = nil
7
-
8
- # Supplies translated text
9
- #
10
- # Usage: {{ 'author' | t: 'recent_articles' }}
11
- def t(section, item)
12
- site = @context.registers[:site]
13
-
14
- if @@lang == nil
15
- # Access this fewer times by keeping it as a module variable
16
- @@lang = Jekyll.configuration({})['language']
17
- end
18
-
19
- # Find text in the site language (for example 'fr-be')
20
- text = site.data['language'][section][item][@@lang]
21
-
22
- # Fall back to a more general version of the language (for example 'fr')
23
- if text == nil and @@lang.include? '-'
24
- fallback_lang = @@lang.split('-')[0];
25
- text = site.data['language'][section][item][fallback_lang]
26
- end
27
-
28
- if text == nil
29
- # Fallback to English text
30
- text = site.data['language'][section][item]['en']
31
- end
32
-
33
- return text
34
- end
35
- end
36
- end
37
-
38
- Liquid::Template.register_filter(Jekyll::Language)
@@ -1,17 +0,0 @@
1
- require 'liquid'
2
-
3
- module Jekyll
4
- module RegexReplace
5
- def regex_replace(str, regex_search, value_replace)
6
- regex = /#{regex_search}/
7
- return str.gsub(regex, value_replace)
8
- end
9
-
10
- def regex_replace_once(str, regex_search, value_replace)
11
- regex = /#{regex_search}/
12
- return str.sub(regex, value_replace)
13
- end
14
- end
15
- end
16
-
17
- Liquid::Template.register_filter(Jekyll::RegexReplace)
data/_plugins/markdown.rb DELETED
@@ -1,17 +0,0 @@
1
- Jekyll::Hooks.register :posts, :post_init do |item|
2
- item.content = item.content
3
- &.gsub(/^:::([a-z \-_]+)/, '<div class="\1" markdown="1">')
4
- &.gsub(/^:::/, '</div>')
5
- end
6
-
7
- Jekyll::Hooks.register :pages, :post_init do |item|
8
- item.content = item.content
9
- &.gsub(/^:::([a-z \-_]+)/, '<div class="\1" markdown="1">')
10
- &.gsub(/^:::/, '</div>')
11
- end
12
-
13
- Jekyll::Hooks.register :documents, :post_init do |item|
14
- item.content = item.content
15
- &.gsub(/^:::([a-z \-_]+)/, '<div class="\1" markdown="1">')
16
- &.gsub(/^:::/, '</div>')
17
- end
Binary file
Binary file
Binary file
data/assets/svg/down.svg DELETED
@@ -1,38 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 330 330" style="enable-background:new 0 0 330 330;" xml:space="preserve">
5
- <path id="XMLID_225_" d="M325.607,79.393c-5.857-5.857-15.355-5.858-21.213,0.001l-139.39,139.393L25.607,79.393
6
- c-5.857-5.857-15.355-5.858-21.213,0.001c-5.858,5.858-5.858,15.355,0,21.213l150.004,150c2.813,2.813,6.628,4.393,10.606,4.393
7
- s7.794-1.581,10.606-4.394l149.996-150C331.465,94.749,331.465,85.251,325.607,79.393z"/>
8
- <g>
9
- </g>
10
- <g>
11
- </g>
12
- <g>
13
- </g>
14
- <g>
15
- </g>
16
- <g>
17
- </g>
18
- <g>
19
- </g>
20
- <g>
21
- </g>
22
- <g>
23
- </g>
24
- <g>
25
- </g>
26
- <g>
27
- </g>
28
- <g>
29
- </g>
30
- <g>
31
- </g>
32
- <g>
33
- </g>
34
- <g>
35
- </g>
36
- <g>
37
- </g>
38
- </svg>
data/favicon.ico DELETED
Binary file
data/robots.txt DELETED
@@ -1,5 +0,0 @@
1
- ---
2
- layout: null
3
- ---
4
- Sitemap: {{ site.url }}{{ '/sitemap.xml' | prepend: site.baseurl }}
5
- User-agent: *
data/sitemap.xml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- layout: null
3
- ---
4
- <?xml version="1.0" encoding="UTF-8"?>
5
- <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
6
- <sitemap>
7
- <loc>{{ site.url }}{{ '/sitemap/pages.xml' | prepend: site.baseurl }}</loc>
8
- </sitemap>
9
- <sitemap>
10
- <loc>{{ site.url }}{{ '/sitemap/posts.xml' | prepend: site.baseurl }}</loc>
11
- </sitemap>
12
- <sitemap>
13
- <loc>{{ site.url }}{{ '/sitemap/authors.xml' | prepend: site.baseurl }}</loc>
14
- </sitemap>
15
- </sitemapindex>