ragerender 0.1.2 → 0.1.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 +4 -4
- data/README.rdoc +14 -0
- data/assets/blog.html +1 -1
- data/lib/ragerender/functions.rb +15 -0
- data/lib/ragerender/jekyll/setup_collection.rb +1 -0
- data/lib/ragerender/jekyll.rb +5 -3
- data/lib/ragerender/to_liquid.rb +0 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8f4de79ae989bb91629afddccfe914b06ac2a734bf1e3be4394e3be6377025d
|
4
|
+
data.tar.gz: 22e88907930952d291a3a79868fb8927ce9592a8b30304ee2136d2fe347bda0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bde6a8ebb2c8495ddc554d053088e0ae163250cd5ee24775e13d8322656c7c9578098852fcdf5527880edf41eaa5b6493fbe523321944850084a54c6df35bd2
|
7
|
+
data.tar.gz: 55a5fed8c1912be039122714f98afe2c50c019ecc2687592ccf502ac98cb2b6931910f86e3c52c7384537e77bd7142b6865e487659a8ab328b026748d1864f93
|
data/README.rdoc
CHANGED
@@ -183,6 +183,20 @@ that and more with optional Front Matter:
|
|
183
183
|
---
|
184
184
|
<h1>yo check out my bonus content!</h1>
|
185
185
|
|
186
|
+
=== Controlling the front page
|
187
|
+
|
188
|
+
As on ComicFury you have a few options for setting the front page of you site.
|
189
|
+
You control this by setting a <tt>frontpage</tt> key in your site config.
|
190
|
+
|
191
|
+
- <tt>latest</tt> will display the latest comic (also the default)
|
192
|
+
- <tt>first</tt> will display the first comic
|
193
|
+
- <tt>chapter</tt> will display the first comic in the latest chapter
|
194
|
+
- <tt>blog</tt> will display the list of blog posts
|
195
|
+
- <tt>archive</tt> will display the comic archive
|
196
|
+
- <tt>overview</tt> will display the comic overview (blogs and latest page)
|
197
|
+
- anything else will display the extra page that has the matching
|
198
|
+
<tt>slug</tt> in its Front Matter
|
199
|
+
|
186
200
|
=== Stuff that doesn't work
|
187
201
|
|
188
202
|
Here is a probably incomplete list of things you can expect to be different
|
data/assets/blog.html
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
|
3
|
+
# Include this module to get ComicFury intrinsic functions available in
|
4
|
+
# templates.
|
5
|
+
module RageRender
|
6
|
+
module TemplateFunctions
|
7
|
+
def js str
|
8
|
+
'"' + CGI.escape_html(str) + '"'
|
9
|
+
end
|
10
|
+
|
11
|
+
def randomnumber a, b
|
12
|
+
rand a..b
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/ragerender/jekyll.rb
CHANGED
@@ -3,6 +3,7 @@ require 'stringio'
|
|
3
3
|
require 'jekyll'
|
4
4
|
require 'dimensions'
|
5
5
|
require_relative 'language'
|
6
|
+
require_relative 'functions'
|
6
7
|
require_relative 'to_liquid'
|
7
8
|
require_relative 'date_formats'
|
8
9
|
require_relative 'jekyll/archive'
|
@@ -39,6 +40,7 @@ Jekyll::Hooks.register :site, :after_init do |site|
|
|
39
40
|
end
|
40
41
|
|
41
42
|
Jekyll::Hooks.register :site, :post_read do |site|
|
43
|
+
Liquid::Template.register_filter(RageRender::TemplateFunctions)
|
42
44
|
site.layouts.each do |(name, layout)|
|
43
45
|
layout.data['layout'] = 'overall' unless name == 'overall'
|
44
46
|
layout.content = RageRender.to_liquid(RageRender::Language.parse(StringIO.new(layout.content))).join
|
@@ -63,15 +65,15 @@ class RageRender::FrontpageGenerator < Jekyll::Generator
|
|
63
65
|
collection = site.collections['comics'].docs
|
64
66
|
chapter = comics.docs.last.data['chapter']
|
65
67
|
comics.docs.detect {|c| c.data['chapter'] == chapter }
|
66
|
-
when 'overview'
|
68
|
+
when 'blog', 'archive', 'overview'
|
67
69
|
collection = site.pages
|
68
|
-
site.pages.detect {|p| p.data["permalink"] ==
|
70
|
+
site.pages.detect {|p| p.data["permalink"] == "/#{frontpage}/index.html" }
|
69
71
|
else
|
70
72
|
collection = site.pages
|
71
73
|
site.pages.detect {|p| p.data["slug"] == frontpage }
|
72
74
|
end.dup
|
73
|
-
index.instance_variable_set(:"@destination", {site.dest => File.join(site.dest, 'index.html')})
|
74
75
|
index.instance_variable_set(:"@data", index.data.dup)
|
76
|
+
index.data['permalink'] = '/index.html'
|
75
77
|
index.data['slug'] = 'frontpage'
|
76
78
|
collection << index
|
77
79
|
end
|
data/lib/ragerender/to_liquid.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ragerender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Worthington
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rsec
|
@@ -253,6 +253,20 @@ description: |-
|
|
253
253
|
---
|
254
254
|
<h1>yo check out my bonus content!</h1>
|
255
255
|
|
256
|
+
=== Controlling the front page
|
257
|
+
|
258
|
+
As on ComicFury you have a few options for setting the front page of you site.
|
259
|
+
You control this by setting a <tt>frontpage</tt> key in your site config.
|
260
|
+
|
261
|
+
- <tt>latest</tt> will display the latest comic (also the default)
|
262
|
+
- <tt>first</tt> will display the first comic
|
263
|
+
- <tt>chapter</tt> will display the first comic in the latest chapter
|
264
|
+
- <tt>blog</tt> will display the list of blog posts
|
265
|
+
- <tt>archive</tt> will display the comic archive
|
266
|
+
- <tt>overview</tt> will display the comic overview (blogs and latest page)
|
267
|
+
- anything else will display the extra page that has the matching
|
268
|
+
<tt>slug</tt> in its Front Matter
|
269
|
+
|
256
270
|
=== Stuff that doesn't work
|
257
271
|
|
258
272
|
Here is a probably incomplete list of things you can expect to be different
|
@@ -305,6 +319,7 @@ files:
|
|
305
319
|
- assets/search.html
|
306
320
|
- lib/ragerender.rb
|
307
321
|
- lib/ragerender/date_formats.rb
|
322
|
+
- lib/ragerender/functions.rb
|
308
323
|
- lib/ragerender/jekyll.rb
|
309
324
|
- lib/ragerender/jekyll/archive.rb
|
310
325
|
- lib/ragerender/jekyll/blog.rb
|