homura-runtime 0.2.18 → 0.2.19

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: 1bd6f3a366405aeb0ba2673c4827c7d34d8bef757d9194c64e71ca881bfe821f
4
- data.tar.gz: 1ccc18ce83b42969bac914ecda37c21cdbfe79fd86971a1de1df1b25c3014302
3
+ metadata.gz: 94e4ec7af2878bc59ebedd0ebe8841d5852b4fb35d736d713a62ce1ef1bb1cfb
4
+ data.tar.gz: 6f21d253588daa097a1541ddd017b58a28b10c38ccc703f2a3ee9e6c650f490f
5
5
  SHA512:
6
- metadata.gz: 777ce1497af06f6a5168bef5e195576fcdbd216a7da25b5d0eda657fea4757f074fb48f873f28eb3f6c5854c5ce98bf1f01dfa870b31a067eab93ef7dd8b9dce
7
- data.tar.gz: 6a9e88cbfea6b27e46dc35c1bdb24bc02cdba8899839066d9d547057e18d9d67a319fdabed88a4ad36f852af49fd97bf41ef3aad964b720333bdd29c5c1438f6
6
+ metadata.gz: dd0b2cb20babf2fe3cb57167dfdc509fef69ccd5d141cf44c0a370b9e8aca29425267433eb4fdf002b0e081583c8028deb1799d4e8c53e808a2b175f2a611c7e
7
+ data.tar.gz: d794586f918cef8b0cabebec3923525078c69a9b68e75e0da96096ffa8afdc02aceb6cd277b07f8b15c0396a3f6f6b6ecf77e2c0c9308cd27624acce320b45ad
data/exe/compile-erb CHANGED
@@ -415,6 +415,16 @@ def emit_sinatra_patch(io, namespace)
415
415
  end
416
416
  end
417
417
 
418
+ # A template is "layout-like" if its name is `:layout` or starts
419
+ # with `layout_` (e.g. `:layout_docs`). The auto-layout pass in
420
+ # `erb` skips wrapping such templates in `:layout` so that
421
+ # rendering `:layout_docs` doesn't end up nested inside `:layout`,
422
+ # which would otherwise produce a duplicate header / nav.
423
+ def __homura_layout_template?(template)
424
+ name = template.to_sym
425
+ name == :layout || name.to_s.start_with?('layout_')
426
+ end
427
+
418
428
  # homura patch: dispatch to precompiled templates when we
419
429
  # have one. Unknown symbols raise a clear message instead of
420
430
  # wandering into upstream Tilt, which would blow up on
@@ -432,7 +442,7 @@ def emit_sinatra_patch(io, namespace)
432
442
 
433
443
  layout = options[:layout]
434
444
  layout = false if layout.nil? && options.include?(:layout)
435
- if layout.nil? && template.to_sym != :layout && ::#{namespace}.registered?(:layout)
445
+ if layout.nil? && !__homura_layout_template?(template) && ::#{namespace}.registered?(:layout)
436
446
  layout = :layout
437
447
  end
438
448
  if layout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudflareWorkers
4
- VERSION = '0.2.18'
4
+ VERSION = '0.2.19'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma