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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f50082e3a10f4085a8bec12f5dbc5386af2fa209239abffc1a01c051e6ed3ea4
4
- data.tar.gz: eb27a5b3de3f325b9c998174c7e2be1a37ebe953c3595431833619d2ff261fdb
3
+ metadata.gz: e8f4de79ae989bb91629afddccfe914b06ac2a734bf1e3be4394e3be6377025d
4
+ data.tar.gz: 22e88907930952d291a3a79868fb8927ce9592a8b30304ee2136d2fe347bda0d
5
5
  SHA512:
6
- metadata.gz: 1e0a5e77617c32868ca965f36e903ee208442de230d620499802d2dbad9c2c110341feb32077b5cc7a41fee69f4a81a95f307bff405b9098c13c28b45fa96dd8
7
- data.tar.gz: 8d41968f7a7ff34622c489fad7731e7dcf8a8573aea3871bf869538eb086503c7116102c87291a395123e23a6658affa4939f497a8b214846b56a8084dc97a20
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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Blog
3
3
  layout: blog-archive
4
- permalink: "/blog/"
4
+ permalink: "/blog/index.html"
5
5
  hidden: true
6
6
  ---
@@ -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
@@ -2,6 +2,7 @@ def setup_collection site, label, permalink, **kwargs
2
2
  site.config['collections'][label.to_s] = {
3
3
  'output' => true,
4
4
  'permalink' => permalink,
5
+ 'sort_by' => 'date',
5
6
  }
6
7
 
7
8
  site.config['defaults'].prepend({
@@ -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"] == '/overview/index.html' }
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
@@ -6,7 +6,6 @@ module RageRender
6
6
  'subtract' => 'minus',
7
7
  'multiply' => 'times',
8
8
  'divide' => 'divided_by',
9
- 'js' => 'escape', # TODO: check these do the same thing!
10
9
  }
11
10
 
12
11
  def self.render_value value
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.2
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-06-09 00:00:00.000000000 Z
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