runeblog 0.2.53 → 0.2.54
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view/themes/standard/blog/index.lt3 +2 -1
- data/empty_view/themes/standard/navbar/navbar.lt3 +1 -2
- data/empty_view/themes/standard/widgets/links/links.rb +41 -4
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +80 -0
- data/lib/helpers-repl.rb +1 -0
- data/lib/liveblog.rb +61 -58
- data/lib/repl.rb +5 -9
- data/lib/runeblog.rb +3 -11
- data/lib/runeblog_version.rb +1 -1
- data/lib/xlate.rb +6 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fe89e19a4aca1e7fe6d3ae97f9df2099a2b5fa71f859cf857cc7804eaf50ff2
|
4
|
+
data.tar.gz: 7a1df9174ea7d4c66c7cab14bdef90f0bcfa25ac942a8cabb7e55626a802cc90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab9912b9aa341458f348265ec533221945d928f4a4dc1528812e56c44eaaefc2387d82010613461b85476c81daca15bd2e12c95f650d2c140f95b8f563cc94fc
|
7
|
+
data.tar.gz: 40b9030124447ef0c6a3799bd046590d199b57130ffc8006f648685c8d90d2f986335fec2b81b44f9cb5e4bce760ad50579a8873cbea3d7d80ef6aa88c0e55d3
|
@@ -12,22 +12,59 @@ class ::RuneBlog::Widget
|
|
12
12
|
|
13
13
|
def build
|
14
14
|
input = "list.data"
|
15
|
-
lines = File.readlines(input)
|
16
|
-
|
15
|
+
@lines = File.readlines(input)
|
16
|
+
write_main
|
17
|
+
write_card
|
18
|
+
end
|
19
|
+
|
20
|
+
def write_main
|
21
|
+
@data = @lines.map! {|x| x.chomp.split(/, */, 3) }
|
17
22
|
css = "* { font-family: verdana }"
|
18
23
|
card_title = "External Links" # FIXME
|
19
24
|
File.open("#{Type}-main.html", "w") do |f|
|
20
25
|
_html_body(f, css) do
|
21
26
|
f.puts "<h1>#{card_title}</h1><br><hr>"
|
22
27
|
url_ref = nil
|
23
|
-
data.each do |url, frameable, title|
|
28
|
+
@data.each do |url, frameable, title|
|
24
29
|
url_ref = (frameable == "yes") ? "href = '#{url}'" : _blank(url)
|
25
30
|
css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
|
26
31
|
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
27
32
|
end
|
28
33
|
end
|
29
34
|
end
|
30
|
-
|
35
|
+
end
|
36
|
+
|
37
|
+
def write_card
|
38
|
+
tag = "links"
|
39
|
+
url = :widgets/tag/tag+"-main.html"
|
40
|
+
card_title = "External links" # FIXME
|
41
|
+
cardfile = "#@self-card"
|
42
|
+
File.open("#{cardfile}.html", "w") do |f|
|
43
|
+
f.puts <<-EOS
|
44
|
+
<div class="card mb-3">
|
45
|
+
<div class="card-body">
|
46
|
+
<h5 class="card-title">
|
47
|
+
<button type="button" class="btn btn-primary" data-toggle="collapse" data-target="##{tag}">+</button>
|
48
|
+
<a href="javascript: void(0)"
|
49
|
+
onclick="javascript:open_main('#{url}')"
|
50
|
+
style="text-decoration: none; color: black"> #{card_title}</a>
|
51
|
+
</h5>
|
52
|
+
<div class="collapse" id="#{tag}">
|
53
|
+
EOS
|
54
|
+
@data.each do |url2, frameable, title|
|
55
|
+
main_ref = %[href="javascript: void(0)" onclick="javascript:open_main('#{url2}')"]
|
56
|
+
tab_ref = %[href="#{url2}"]
|
57
|
+
url_ref = (frameable == "yes") ? main_ref : tab_ref
|
58
|
+
anchor = %[<a #{url_ref}>#{title}</a>]
|
59
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
60
|
+
f.puts wrapper
|
61
|
+
end
|
62
|
+
f.puts <<-EOS
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
EOS
|
67
|
+
end
|
31
68
|
end
|
32
69
|
|
33
70
|
def edit_menu
|
@@ -4,9 +4,89 @@ class ::RuneBlog::Widget
|
|
4
4
|
class Pinned
|
5
5
|
def initialize(repo)
|
6
6
|
@blog = repo
|
7
|
+
@self = "pinned"
|
7
8
|
end
|
8
9
|
|
10
|
+
def _html_body(file, css = nil) # FIXME
|
11
|
+
file.puts "<html>"
|
12
|
+
if css
|
13
|
+
file.puts " <head>"
|
14
|
+
file.puts " <style>\n#{css}\n </style>"
|
15
|
+
file.puts " </head>"
|
16
|
+
end
|
17
|
+
file.puts " <body>"
|
18
|
+
yield
|
19
|
+
file.puts " </body>\n</html>"
|
20
|
+
end
|
21
|
+
|
9
22
|
def build
|
23
|
+
@tmp = File.new("/tmp/debug-out", "w")
|
24
|
+
posts = nil
|
25
|
+
Dir.chdir(@blog.root/:posts) { posts = Dir["*"] }
|
26
|
+
lines = File.readlines("list.data")
|
27
|
+
hash = {}
|
28
|
+
@links = []
|
29
|
+
lines.each do |x|
|
30
|
+
num, title = x.chomp.split(" ", 2)
|
31
|
+
hash[num] = title
|
32
|
+
pre = '%04d' % num
|
33
|
+
nslug = posts.grep(/#{pre}-/).first
|
34
|
+
name = nslug[5..-1]
|
35
|
+
link = name+".html"
|
36
|
+
@links << [title, link]
|
37
|
+
end
|
38
|
+
write_main
|
39
|
+
write_card
|
40
|
+
end
|
41
|
+
|
42
|
+
def write_main
|
43
|
+
tag = "pinned"
|
44
|
+
card_title = "Pinned posts" # FIXME
|
45
|
+
# setvar "card.title", card_title
|
46
|
+
css = "* { font-family: verdana }"
|
47
|
+
mainfile = "#@self-main"
|
48
|
+
File.open("#{mainfile}.html", "w") do |f|
|
49
|
+
_html_body(f, css) do
|
50
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
51
|
+
@links.each do |title, file|
|
52
|
+
title = title.gsub(/\\/, "") # kludge
|
53
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px"
|
54
|
+
f.puts %[<a style="#{css}" href="../../#{file}">#{title}</a> <br>]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def write_card
|
61
|
+
tag = "pinned"
|
62
|
+
url = :widgets/tag/tag+"-main.html"
|
63
|
+
card_title = "Pinned posts" # FIXME
|
64
|
+
cardfile = "#@self-card"
|
65
|
+
File.open("#{cardfile}.html", "w") do |f|
|
66
|
+
f.puts <<-EOS
|
67
|
+
<div class="card mb-3">
|
68
|
+
<div class="card-body">
|
69
|
+
<h5 class="card-title">
|
70
|
+
<button type="button" class="btn btn-primary" data-toggle="collapse" data-target="##{tag}">+</button>
|
71
|
+
<a href="javascript: void(0)"
|
72
|
+
onclick="javascript:open_main('#{url}')"
|
73
|
+
style="text-decoration: none; color: black"> #{card_title}</a>
|
74
|
+
</h5>
|
75
|
+
<div class="collapse" id="#{tag}">
|
76
|
+
EOS
|
77
|
+
@links.each do |title, file|
|
78
|
+
url2 = file
|
79
|
+
url_ref = %[href="javascript: void(0)" onclick="javascript:open_main('#{url2}')"]
|
80
|
+
anchor = %[<a #{url_ref}>#{title}</a>]
|
81
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
82
|
+
f.puts wrapper
|
83
|
+
end
|
84
|
+
f.puts <<-EOS
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
EOS
|
89
|
+
end
|
10
90
|
end
|
11
91
|
|
12
92
|
def edit_menu
|
data/lib/helpers-repl.rb
CHANGED
data/lib/liveblog.rb
CHANGED
@@ -19,7 +19,7 @@ def init_liveblog # FIXME - a lot of this logic sucks
|
|
19
19
|
@root = @blog.root
|
20
20
|
@view = @blog.view
|
21
21
|
@view_name = @blog.view.name unless @view.nil?
|
22
|
-
@vdir = @blog.view.dir
|
22
|
+
@vdir = @blog.view.dir rescue "NONAME"
|
23
23
|
@version = RuneBlog::VERSION
|
24
24
|
@theme = @vdir/:themes/:standard
|
25
25
|
end
|
@@ -96,12 +96,9 @@ def banner # still experimental
|
|
96
96
|
pieces.each do |piece|
|
97
97
|
_out " <td colspan=#{span}>"
|
98
98
|
case
|
99
|
-
when piece.start_with?("
|
100
|
-
|
101
|
-
|
102
|
-
when piece.start_with?("vnav")
|
103
|
-
# vertical navbar
|
104
|
-
# _out "vnav1<br>vnav2<br>vnav3<br>vnav4<br>"
|
99
|
+
when piece.start_with?("navbar")
|
100
|
+
file = "navbar/navbar.html"
|
101
|
+
_out File.read(file)
|
105
102
|
when piece.start_with?("text")
|
106
103
|
file = piece.split(":")[1]
|
107
104
|
file ||= "banner/text.html"
|
@@ -268,22 +265,30 @@ end
|
|
268
265
|
|
269
266
|
def pin
|
270
267
|
raise "'post' was not called" unless @meta
|
271
|
-
_debug "data = #{_args}"
|
272
|
-
|
273
|
-
@meta.pinned =
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
268
|
+
_debug "data = #{_args}" # verify only valid views?
|
269
|
+
pinned = @_args
|
270
|
+
@meta.pinned = pinned
|
271
|
+
pinned.each do |pinview|
|
272
|
+
dir = @blog.root/:views/pinview/"themes/standard/widgets/pinned/"
|
273
|
+
datafile = dir/"list.data"
|
274
|
+
if File.exist?(datafile)
|
275
|
+
pins = File.readlines(datafile)
|
276
|
+
else
|
277
|
+
pins = []
|
278
|
+
end
|
279
|
+
pins << "#{@meta.num} #{@meta.title}\n"
|
280
|
+
pins.uniq!
|
281
|
+
outfile = File.new(datafile, "w")
|
282
|
+
pins.each do |pin|
|
283
|
+
outfile.puts pin
|
284
|
+
end
|
285
|
+
outfile.close
|
285
286
|
end
|
286
287
|
_optional_blank_line
|
288
|
+
rescue => err
|
289
|
+
puts "err = #{err}"
|
290
|
+
puts err.backtrace.join("\n")
|
291
|
+
gets
|
287
292
|
end
|
288
293
|
|
289
294
|
def write_post
|
@@ -434,12 +439,16 @@ rescue => err
|
|
434
439
|
end
|
435
440
|
|
436
441
|
def sidebar
|
442
|
+
_debug "--- handling sidebar\r"
|
437
443
|
if _args.include? "off"
|
438
444
|
_body { } # iterate, do nothing
|
439
445
|
return
|
440
446
|
end
|
441
447
|
|
442
448
|
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
449
|
+
|
450
|
+
standard = %w[pinned pages links]
|
451
|
+
|
443
452
|
_body do |token|
|
444
453
|
tag = token.chomp.strip.downcase
|
445
454
|
wtag = :widgets/tag
|
@@ -448,12 +457,14 @@ def sidebar
|
|
448
457
|
|
449
458
|
code = _load_local(tag)
|
450
459
|
if code
|
451
|
-
if ["pages", "links"].include? tag
|
460
|
+
if ["pages", "links", "pinned"].include? tag
|
452
461
|
Dir.chdir(wtag) do
|
453
462
|
widget = code.new(@blog)
|
454
463
|
widget.build
|
455
464
|
end
|
456
465
|
end
|
466
|
+
_include_file wtag/tcard
|
467
|
+
next
|
457
468
|
end
|
458
469
|
|
459
470
|
if tag == "ad"
|
@@ -471,7 +482,8 @@ def sidebar
|
|
471
482
|
depend += %w[pieces/card-head.lt3 pieces/card-tail.lt3]
|
472
483
|
depend += %w[pieces/main-head.lt3 pieces/main-tail.lt3]
|
473
484
|
depend.map! {|x| @blog.view.dir/"themes/standard/widgets"/wtag/x }
|
474
|
-
|
485
|
+
_debug "--- call xlate #{tag} src = #{tag} dst = #{tcard}\r"
|
486
|
+
xlate cwd: wtag, src: tag, dst: tcard, force: true, deps: depend # , debug: true
|
475
487
|
_include_file wtag/tcard
|
476
488
|
end
|
477
489
|
_out %[</div>]
|
@@ -481,26 +493,6 @@ rescue => err
|
|
481
493
|
exit
|
482
494
|
end
|
483
495
|
|
484
|
-
=begin
|
485
|
-
ets/widgets/pages//card.css
|
486
|
-
ets/widgets/pages//custom.rb
|
487
|
-
ets/widgets/pages//disclaim.lt3
|
488
|
-
ets/widgets/pages//faq.lt3
|
489
|
-
ets/widgets/pages//like-dislike.lt3
|
490
|
-
ets/widgets/pages//list.data
|
491
|
-
ets/widgets/pages//local-vars.lt3
|
492
|
-
ets/widgets/pages//local.rb
|
493
|
-
ets/widgets/pages//main.css
|
494
|
-
ets/widgets/pages//other-stuff.lt3
|
495
|
-
ets/widgets/pages//pages.lt3
|
496
|
-
ets/widgets/pages//pages.rb
|
497
|
-
ets/widgets/pages//pieces
|
498
|
-
ets/widgets/pages//pieces/card-head.lt3
|
499
|
-
ets/widgets/pages//pieces/card-tail.lt3
|
500
|
-
ets/widgets/pages//pieces/main-head.lt3
|
501
|
-
ets/widgets/pages//pieces/main-tail.lt3
|
502
|
-
=end
|
503
|
-
|
504
496
|
def stylesheet
|
505
497
|
lines = _body
|
506
498
|
url = lines[0]
|
@@ -646,42 +638,53 @@ def tag_cloud
|
|
646
638
|
end
|
647
639
|
|
648
640
|
def vnavbar
|
641
|
+
_custom_navbar(:vert)
|
649
642
|
end
|
650
643
|
|
651
|
-
def
|
644
|
+
def hnavbar
|
645
|
+
_custom_navbar # horiz is default
|
646
|
+
end
|
647
|
+
|
648
|
+
def navbar
|
649
|
+
_custom_navbar # horiz is default
|
650
|
+
end
|
651
|
+
|
652
|
+
def _custom_navbar(orient = :horiz)
|
652
653
|
vdir = @blog.view.dir
|
653
654
|
title = _var(:blog)
|
654
655
|
|
656
|
+
extra = ""
|
657
|
+
extra = "navbar-expand-lg" if orient == :horiz
|
658
|
+
|
655
659
|
open = <<-HTML
|
656
|
-
<nav class="navbar navbar-light bg-light">
|
657
|
-
<
|
658
|
-
<ul class="navbar-nav mr-auto">
|
660
|
+
<nav class="navbar #{extra} navbar-light bg-light">
|
661
|
+
<ul class="navbar-nav mr-auto">
|
659
662
|
HTML
|
660
663
|
close = <<-HTML
|
661
|
-
|
662
|
-
</div>
|
664
|
+
</ul>
|
663
665
|
</nav>
|
664
666
|
HTML
|
665
667
|
|
666
|
-
|
667
|
-
|
668
|
+
html_file = @blog.root/:views/@blog.view/:themes/:standard/:navbar/"navbar.html"
|
669
|
+
output = File.new(@blog.root/:views/@blog.view/:themes/:standard/:navbar/"navbar.html", "w")
|
670
|
+
output.puts open
|
668
671
|
lines = _body
|
672
|
+
lines = [" index Home"] + lines unless _args.include?("nohome")
|
669
673
|
lines.each do |line|
|
670
674
|
basename, cdata = line.chomp.strip.split(" ", 2)
|
671
675
|
full = :navbar/basename+".html"
|
672
676
|
href_main = _main(full)
|
673
|
-
if
|
674
|
-
|
675
|
-
_out %[<li class="nav-item active"> <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> </li>]
|
677
|
+
if basename == "index" # special case
|
678
|
+
output.puts %[<li class="nav-item active"> <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> </li>]
|
676
679
|
else
|
677
680
|
xlate cwd: "navbar", src: basename, dst: vdir/"remote/navbar"/basename+".html" # , debug: true
|
678
|
-
|
681
|
+
output.puts %[<li class="nav-item"> <a class="nav-link" #{href_main}>#{cdata}</a> </li>]
|
679
682
|
end
|
680
683
|
end
|
681
|
-
|
684
|
+
output.puts close
|
682
685
|
end
|
683
686
|
|
684
|
-
def
|
687
|
+
def _old_navbar
|
685
688
|
vdir = @blog.view.dir
|
686
689
|
title = _var(:blog)
|
687
690
|
|
@@ -772,7 +775,7 @@ def _write_card(cardfile, mainfile, pairs, card_title, tag)
|
|
772
775
|
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
773
776
|
f.puts wrapper
|
774
777
|
end
|
775
|
-
|
778
|
+
_include_file cardfile+".html"
|
776
779
|
f.puts <<-EOS
|
777
780
|
</div>
|
778
781
|
</div>
|
data/lib/repl.rb
CHANGED
@@ -54,7 +54,7 @@ module RuneBlog::REPL
|
|
54
54
|
|
55
55
|
def cmd_manage(arg, testing = false)
|
56
56
|
case arg
|
57
|
-
when "pages";
|
57
|
+
when "pages"; _manage_pages(nil, testing = false)
|
58
58
|
when "links"; _manage_links(nil, testing = false)
|
59
59
|
when "navbar"; _manage_navbar(nil, testing = false)
|
60
60
|
# when "pinned"; _manage_pinned(nil, testing = false) # ditch this??
|
@@ -71,7 +71,6 @@ module RuneBlog::REPL
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def _manage_navbar(arg, testing = false) # cloned from manage_pages
|
74
|
-
puts "Got to #{__method__}"
|
75
74
|
check_empty(arg)
|
76
75
|
dir = @blog.view.dir/"themes/standard/navbar"
|
77
76
|
files = Dir.entries(dir) - %w[. .. navbar.lt3]
|
@@ -328,7 +327,7 @@ puts "Got to #{__method__}"
|
|
328
327
|
id = get_integer(arg)
|
329
328
|
# Simplify this
|
330
329
|
tag = "#{'%04d' % id}"
|
331
|
-
files = ::Find.find(@blog.root
|
330
|
+
files = ::Find.find(@blog.root/:drafts).to_a
|
332
331
|
files = files.grep(/#{tag}-.*lt3/)
|
333
332
|
files = files.map {|f| File.basename(f) }
|
334
333
|
if files.size > 1
|
@@ -345,7 +344,7 @@ puts "Got to #{__method__}"
|
|
345
344
|
end
|
346
345
|
|
347
346
|
file = files.first
|
348
|
-
draft =
|
347
|
+
draft = @blog.root/:drafts/file
|
349
348
|
result = edit_file(draft)
|
350
349
|
@blog.generate_post(draft)
|
351
350
|
rescue => err
|
@@ -478,10 +477,6 @@ puts "Got to #{__method__}"
|
|
478
477
|
cmd = "cp #{name} #{@blog.root}/drafts/#@fname"
|
479
478
|
result = system!(cmd)
|
480
479
|
raise CantCopy(name, "#{@blog.root}/drafts/#@fname") unless result
|
481
|
-
puts(`ls -l #{@blog.root}/drafts`)
|
482
|
-
puts "@fname = #@fname"
|
483
|
-
puts "Pause..."
|
484
|
-
gets
|
485
480
|
# post = Post.load(@slug)
|
486
481
|
draft = "#{@blog.root}/drafts/#@fname"
|
487
482
|
@meta = @blog.generate_post(draft)
|
@@ -499,9 +494,10 @@ gets
|
|
499
494
|
{h, help} This message {change view VIEW} Change current view
|
500
495
|
{q, quit} Exit the program {cv VIEW} Change current view
|
501
496
|
{v, version} Print version information {new view} Create a new view
|
502
|
-
|
497
|
+
{clear} Clear screen {list views} List all views available
|
503
498
|
{lsv} Same as: list views
|
504
499
|
|
500
|
+
|
505
501
|
{Posts:} {Advanced:}
|
506
502
|
------------------------------------------- -------------------------------------------
|
507
503
|
{p, post} Create a new post {config} Edit various system files
|
data/lib/runeblog.rb
CHANGED
@@ -118,13 +118,10 @@ class RuneBlog
|
|
118
118
|
Dir.chdir(dir) do
|
119
119
|
views = _retrieve_metadata(:views)
|
120
120
|
views.each do |v|
|
121
|
-
puts "VIEW = #{v} dir = #{dir}"
|
122
121
|
unless self.view?(v)
|
123
122
|
puts "#{fx("Warning:", :red)} #{fx(v, :bold)} is not a view"
|
124
123
|
next
|
125
124
|
end
|
126
|
-
puts "pwd = #{Dir.pwd}"
|
127
|
-
puts "cp *html #@root/views/#{v}/remote"
|
128
125
|
system!("cp *html #@root/views/#{v}/remote", show: true)
|
129
126
|
end
|
130
127
|
end
|
@@ -161,13 +158,9 @@ puts "cp *html #@root/views/#{v}/remote"
|
|
161
158
|
log!(enter: __method__, args: [sourcefile], level: 2)
|
162
159
|
nslug = sourcefile.sub(/.lt3/, "")
|
163
160
|
dir = @root/:posts/nslug
|
164
|
-
# puts "sourcefile = #{sourcefile}"
|
165
|
-
puts "-- dir = #{dir}\n pwd = #{Dir.pwd}\n @root = #@root"
|
166
|
-
gets
|
167
161
|
create_dirs(dir)
|
168
162
|
# FIXME dependencies?
|
169
163
|
xlate cwd: dir, src: @root/:drafts/sourcefile # , debug: true
|
170
|
-
# puts `ls -l #{dir}`
|
171
164
|
_deploy_local(dir)
|
172
165
|
rescue => err
|
173
166
|
_tmp_error(err)
|
@@ -346,7 +339,6 @@ gets
|
|
346
339
|
vp.nslug, vp.aslug, vp.title, vp.date, vp.teaser_text
|
347
340
|
path = vp.path
|
348
341
|
url = aslug + ".html"
|
349
|
-
# puts "--- vp = #{[vp.nslug, vp.aslug, vp.title, vp.date, vp.teaser_text].inspect}"; gets
|
350
342
|
date = ::Date.parse(date)
|
351
343
|
date = date.strftime("%B %e<br><div style='float: right'>%Y</div>")
|
352
344
|
text = interpolate(@_post_entry, binding)
|
@@ -447,11 +439,12 @@ gets
|
|
447
439
|
depend = [vdir/"remote/etc/blog.css", @theme/"global.lt3",
|
448
440
|
@theme/"blog/head.lt3", @theme/"navbar/navbar.lt3",
|
449
441
|
@theme/"blog/index.lt3"] # FIXME what about assets?
|
450
|
-
xlate cwd: vdir/"themes/standard/etc", deps: depend,
|
442
|
+
xlate cwd: vdir/"themes/standard/etc", deps: depend,
|
451
443
|
src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
|
452
|
-
xlate cwd: vdir/"themes/standard", deps: depend,
|
444
|
+
xlate cwd: vdir/"themes/standard", deps: depend, force: true,
|
453
445
|
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
454
446
|
copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
|
447
|
+
copy_widget_html(view)
|
455
448
|
rescue => err
|
456
449
|
_tmp_error(err)
|
457
450
|
end
|
@@ -459,7 +452,6 @@ gets
|
|
459
452
|
def _get_views(draft)
|
460
453
|
log!(enter: __method__, args: [draft], level: 2)
|
461
454
|
# FIXME dumb code
|
462
|
-
# view_line = File.readlines(self.root/:drafts/draft).grep(/^.views /)
|
463
455
|
view_line = File.readlines(draft).grep(/^.views /)
|
464
456
|
raise "More than one .views call!" if view_line.size > 1
|
465
457
|
raise "No .views call!" if view_line.size < 1
|
data/lib/runeblog_version.rb
CHANGED
data/lib/xlate.rb
CHANGED
@@ -24,19 +24,18 @@ def xlate(cwd: Dir.pwd, src:,
|
|
24
24
|
indent = " "*12
|
25
25
|
Dir.chdir(cwd) do
|
26
26
|
if debug
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
puts "#{indent} -- xlate #{src} >#{dst}"
|
28
|
+
puts "#{indent} in: #{Dir.pwd}"
|
29
|
+
puts "#{indent} from: #{caller[0]}"
|
30
|
+
puts "#{indent} copy: #{copy}" if copy
|
31
31
|
end
|
32
32
|
stale = stale?(src, dst, deps, force)
|
33
|
-
# puts "stale? src = #{src}\n dst = #{dst}\n #{stale}"
|
34
33
|
if stale
|
35
34
|
rc = system("livetext #{src} >#{dst}")
|
36
|
-
|
35
|
+
puts "...completed (shell returned #{rc})" if debug
|
37
36
|
system!("cp #{dst} #{copy}") if copy
|
38
37
|
else
|
39
|
-
|
38
|
+
puts "#{indent} -- ^ Already up to date!" if debug
|
40
39
|
return
|
41
40
|
end
|
42
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.54
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|