runeblog 0.2.38 → 0.2.39
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/empty_view/themes/standard/widgets/pages/local.rb +0 -8
- data/empty_view/themes/standard/widgets/pages/pages.rb +21 -0
- data/empty_view/themes/standard/widgets/pages/pieces/card-head.lt3 +1 -0
- data/empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3 +1 -0
- data/empty_view/themes/standard/widgets/pages/pieces/card.css +1 -0
- data/empty_view/themes/standard/widgets/pages/pieces/main-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3 +2 -0
- data/empty_view/themes/standard/widgets/pages/pieces/main.css +1 -0
- data/lib/liveblog.rb +40 -3
- data/lib/runeblog_version.rb +1 -1
- data/lib/xlate.rb +5 -0
- metadata +8 -2
- data/empty_view/remote/widgets/pages/SUBFILES +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caacbdabded61281f3fd6cab3f627a5b014e896381f2b73e070f0aa64630b4d7
|
4
|
+
data.tar.gz: e1d37b1f874ef57568d710ab90a93977491327b40d140987f9a120ad87fb4642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed10a449202c4ca21d228d11eea08aa6c65693c3dd9e81498a368b0a362f341726a141fc878e31c7cf07573c1858d6aa70cdbb08fcb29043d62cd734153dffe3
|
7
|
+
data.tar.gz: a95f146d7bb55ae8a115f495423c0287453e8cdb0335c3615c5cfae4d77c842cb417bc1f763d972f2b241d6ac7f463e3b823be1789bb5b026f49745680b261d2
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Custom code for 'pages' widget
|
2
|
+
|
3
|
+
# How to update repl code?
|
4
|
+
|
5
|
+
class ::RuneBlog::Widget
|
6
|
+
class Pages
|
7
|
+
def self.build
|
8
|
+
children = Dir["*.lt3"] - ["pages.lt3"]
|
9
|
+
children.each do |child|
|
10
|
+
dest = child.sub(/.lt3$/, ".html")
|
11
|
+
xlate src: child, dst: dest, debug: true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.edit_menu
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.refresh
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
data/lib/liveblog.rb
CHANGED
@@ -319,9 +319,14 @@ def recent_posts # side-effect
|
|
319
319
|
HTML
|
320
320
|
end
|
321
321
|
|
322
|
-
def
|
322
|
+
def _load_local(widget)
|
323
323
|
Dir.chdir("widgets/#{widget}") do
|
324
|
-
|
324
|
+
# STDERR.puts "loadCP1 widget = #{widget.inspect} pwd = #{Dir.pwd}"
|
325
|
+
found = (require("./#{widget}") if File.exist?("#{widget}.rb"))
|
326
|
+
# STDERR.puts "loadCP2 found = #{found}"
|
327
|
+
code = found ? ::RuneBlog::Widget.class_eval(widget.capitalize) : nil
|
328
|
+
# STDERR.puts "loadCP3 code = #{code.inspect}"
|
329
|
+
code
|
325
330
|
end
|
326
331
|
rescue => err
|
327
332
|
STDOUT.puts err
|
@@ -342,7 +347,8 @@ def sidebar
|
|
342
347
|
raise "Can't find #{wtag}" unless Dir.exist?(wtag)
|
343
348
|
tcard = "#{tag}-card.html"
|
344
349
|
|
345
|
-
|
350
|
+
code = _load_local(tag)
|
351
|
+
code && Dir.chdir(wtag) { code.build }
|
346
352
|
|
347
353
|
# if File.exist?(wtag/"SUBFILES")
|
348
354
|
# children = Dir[wtag/"*.lt3"] - [wtag/tag+".lt3"]
|
@@ -623,9 +629,40 @@ def page_type(tag, title)
|
|
623
629
|
end
|
624
630
|
end
|
625
631
|
|
632
|
+
def _write_main_pages(mainfile, pairs, card_title, tag)
|
633
|
+
local = _local_tag?(tag)
|
634
|
+
pieces = @blog.view.dir/"themes/standard/widgets"/tag/:pieces
|
635
|
+
main_head = xlate! cwd: pieces, src: "main-head.lt3"
|
636
|
+
main_tail = xlate! cwd: pieces, src: "main-tail.lt3"
|
637
|
+
# ^ make into methods in pages.rb or whatever?
|
638
|
+
|
639
|
+
File.open("#{mainfile}.html", "w") do |f|
|
640
|
+
f.puts main_head
|
641
|
+
pairs.each do |file, title|
|
642
|
+
type, title = page_type(tag, title)
|
643
|
+
title = title.gsub(/\\/, "") # kludge
|
644
|
+
case type
|
645
|
+
when :local; url_ref = _widget_main(file, tag) # local always frameable
|
646
|
+
when :frame; url_ref = "href = '#{file}'" # local always frameable
|
647
|
+
when :noframe; url_ref = _blank(file) # local always frameable
|
648
|
+
end
|
649
|
+
css = "color: #8888FF; text-decoration: none; font-size: 24px; font-family: verdana"
|
650
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
651
|
+
end
|
652
|
+
f.puts main_tail
|
653
|
+
end
|
654
|
+
end
|
655
|
+
|
626
656
|
def _write_main(mainfile, pairs, card_title, tag)
|
627
657
|
log!(str: "Creating #{mainfile}.html", pwd: true)
|
658
|
+
|
659
|
+
if tag == "pages" # temporary experiment
|
660
|
+
_write_main_pages(mainfile, pairs, card_title, tag)
|
661
|
+
return
|
662
|
+
end
|
663
|
+
|
628
664
|
local = _local_tag?(tag)
|
665
|
+
setvar "card.title", card_title
|
629
666
|
File.open("#{mainfile}.html", "w") do |f|
|
630
667
|
_html_body(f) do
|
631
668
|
f.puts "<h1>#{card_title}</h1>"
|
data/lib/runeblog_version.rb
CHANGED
data/lib/xlate.rb
CHANGED
@@ -35,3 +35,8 @@ LEXT = ".lt3"
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def xlate!(cwd: Dir.pwd, src:, copy: nil, debug: false, force: false)
|
39
|
+
output = "/tmp/xlate-#{File.basename(src).sub(/.lt3$/, "")}"
|
40
|
+
xlate cwd: cwd, src: src, dst: output, debug: debug, force: force
|
41
|
+
File.read(output + ".html") # return all content as string
|
42
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runeblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
@@ -68,7 +68,6 @@ files:
|
|
68
68
|
- empty_view/remote/permalink/GIT_IS_DUMB
|
69
69
|
- empty_view/remote/widgets/links/list.data
|
70
70
|
- empty_view/remote/widgets/news/list.data
|
71
|
-
- empty_view/remote/widgets/pages/SUBFILES
|
72
71
|
- empty_view/remote/widgets/pages/list.data
|
73
72
|
- empty_view/themes/standard/README
|
74
73
|
- empty_view/themes/standard/blog/generate.lt3
|
@@ -102,6 +101,13 @@ files:
|
|
102
101
|
- empty_view/themes/standard/widgets/pages/local.rb
|
103
102
|
- empty_view/themes/standard/widgets/pages/other-stuff.lt3
|
104
103
|
- empty_view/themes/standard/widgets/pages/pages.lt3
|
104
|
+
- empty_view/themes/standard/widgets/pages/pages.rb
|
105
|
+
- empty_view/themes/standard/widgets/pages/pieces/card-head.lt3
|
106
|
+
- empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3
|
107
|
+
- empty_view/themes/standard/widgets/pages/pieces/card.css
|
108
|
+
- empty_view/themes/standard/widgets/pages/pieces/main-head.lt3
|
109
|
+
- empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3
|
110
|
+
- empty_view/themes/standard/widgets/pages/pieces/main.css
|
105
111
|
- empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3
|
106
112
|
- lib/Javascript.stuff
|
107
113
|
- lib/default.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
Causes other *.lt3 files to be generated
|