runeblog 0.1.95 → 0.2.1
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/lib/helpers-blog.rb +14 -3
- data/lib/liveblog.rb +119 -69
- data/lib/repl.rb +3 -2
- data/lib/runeblog.rb +7 -20
- data/lib/runeblog_version.rb +1 -1
- data/runeblog.gemspec +1 -1
- data/themes/standard/blog/head.lt3 +1 -0
- data/themes/standard/blog/index.lt3 +3 -1
- data/themes/standard/etc/blog.css.lt3 +7 -18
- data/themes/standard/etc/misc.js +6 -0
- data/themes/standard/global.lt3 +10 -1
- data/themes/standard/navbar/about.html +4 -2
- data/themes/standard/navbar/contact.html +6 -0
- data/themes/standard/sidebar/README +3 -0
- data/themes/standard/widgets/README +4 -0
- data/themes/standard/widgets/ad/ad.lt3 +12 -0
- data/themes/standard/{sidebar → widgets/calendar}/calendar.lt3 +0 -0
- data/themes/standard/widgets/news/card-news.html +17 -0
- data/themes/standard/widgets/news/list.data +4 -0
- data/themes/standard/widgets/news/main-news.html +9 -0
- data/themes/standard/widgets/news/news.lt3 +4 -0
- data/themes/standard/widgets/pages/README +2 -0
- data/themes/standard/widgets/pages/disclaim.lt3 +6 -0
- data/themes/standard/widgets/pages/faq.lt3 +6 -0
- data/themes/standard/widgets/pages/generated.lt3 +4 -0
- data/themes/standard/widgets/pages/lifestory.lt3 +6 -0
- data/themes/standard/widgets/pages/like-dislike.lt3 +6 -0
- data/themes/standard/widgets/pages/list.data +4 -0
- data/themes/standard/widgets/pages/main.html +9 -0
- data/themes/standard/widgets/pages/main.lt3 +18 -0
- data/themes/standard/widgets/tag-cloud/tag-cloud.lt3 +12 -0
- metadata +24 -9
- data/themes/standard/etc/blog.css +0 -34
- data/themes/standard/sidebar/ad.lt3 +0 -5
- data/themes/standard/sidebar/news.lt3 +0 -7
- data/themes/standard/sidebar/tag-cloud.lt3 +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ecf2ea93c7b100f433d4cf9a822655ba6f4c95997e96b09dee870c8234a10e8
|
4
|
+
data.tar.gz: d1d6da2a7c78cb201b9fd6d3359347b6b6cf4534286f2c12c44ff72fcb545c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9af872813d5420811971839357debb0c6197302e832d15c5749164c8a87523def9370943fa0bd14b15a44ab3b8fbdf9eee97744df91d98920f23dcde8413e6d
|
7
|
+
data.tar.gz: e995fb01bdc9073957c2e762fdff55f4502a906cb0176df76af45d65ca2ea75b19934d74e6e0909c0c7f26ba370abaebad5d24bd3ae4e61007a171d2fa263114
|
data/lib/helpers-blog.rb
CHANGED
@@ -12,9 +12,20 @@ module RuneBlog::Helpers
|
|
12
12
|
system("cp -r #{src} #{dst}")
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def stale?(src, dst)
|
16
|
+
return true unless File.exist?(dst)
|
17
|
+
return true if File.mtime(src) > File.mtime(dst)
|
18
|
+
return false
|
19
|
+
end
|
20
|
+
|
21
|
+
def livetext(src, dst=nil)
|
16
22
|
src << ".lt3" unless src.end_with?(".lt3")
|
17
|
-
|
23
|
+
if dst
|
24
|
+
dst << ".html" unless dst.end_with?(".html")
|
25
|
+
else
|
26
|
+
dst = src.sub(/.lt3$/, "")
|
27
|
+
end
|
28
|
+
return unless stale?(src, dst)
|
18
29
|
system("livetext #{src} >#{dst}")
|
19
30
|
end
|
20
31
|
|
@@ -65,7 +76,7 @@ module RuneBlog::Helpers
|
|
65
76
|
vals
|
66
77
|
end
|
67
78
|
|
68
|
-
def put_config(root:, view:"test_view", editor: "/bin/vim")
|
79
|
+
def put_config(root:, view:"test_view", editor: "/usr/local/bin/vim")
|
69
80
|
Dir.mkdir(root) unless Dir.exist?(root)
|
70
81
|
Dir.chdir(root) do
|
71
82
|
File.open("config", "w") do |cfg|
|
data/lib/liveblog.rb
CHANGED
@@ -5,7 +5,7 @@ require 'date'
|
|
5
5
|
require 'livetext'
|
6
6
|
require 'runeblog'
|
7
7
|
|
8
|
-
errfile = File.new("liveblog.out", "w")
|
8
|
+
errfile = File.new("/tmp/liveblog.out", "w")
|
9
9
|
STDERR.reopen(errfile)
|
10
10
|
|
11
11
|
def init_liveblog # FIXME - a lot of this logic sucks
|
@@ -22,18 +22,31 @@ def init_liveblog # FIXME - a lot of this logic sucks
|
|
22
22
|
@theme = @vdir + "/themes/standard/"
|
23
23
|
end
|
24
24
|
|
25
|
+
# FIXME - stale? and livetext are duplicated from helpers-blog
|
26
|
+
|
27
|
+
def stale?(src, dst)
|
28
|
+
return true unless File.exist?(dst)
|
29
|
+
return true if File.mtime(src) > File.mtime(dst)
|
30
|
+
return false
|
31
|
+
end
|
32
|
+
|
33
|
+
def livetext(src, dst=nil)
|
34
|
+
src += ".lt3" unless src.end_with?(".lt3")
|
35
|
+
if dst
|
36
|
+
dst += ".html" unless dst.end_with?(".html")
|
37
|
+
else
|
38
|
+
dst = src.sub(/.lt3$/, "")
|
39
|
+
end
|
40
|
+
return unless stale?(src, dst)
|
41
|
+
system("livetext #{src} >#{dst}")
|
42
|
+
end
|
43
|
+
|
25
44
|
def post
|
26
45
|
@meta = OpenStruct.new
|
27
46
|
@meta.num = _args[0]
|
28
47
|
_out " <!-- Post number #{@meta.num} -->\n "
|
29
48
|
end
|
30
49
|
|
31
|
-
def _view_from_cwd
|
32
|
-
md = Dir.pwd.match(%r[.*/views/(.*?)/])
|
33
|
-
return md[1] if md
|
34
|
-
nil
|
35
|
-
end
|
36
|
-
|
37
50
|
def quote
|
38
51
|
_passthru "<blockquote>"
|
39
52
|
_passthru _body
|
@@ -60,11 +73,69 @@ def h6; _passthru "
#{@_data}"; end |
|
60
73
|
|
61
74
|
def hr; _passthru "<hr>"; end
|
62
75
|
|
63
|
-
def
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
76
|
+
def list
|
77
|
+
_out "<ul>"
|
78
|
+
_body {|line| _out "<li>#{line}</li>" }
|
79
|
+
_out "</ul>"
|
80
|
+
_optional_blank_line
|
81
|
+
end
|
82
|
+
|
83
|
+
def list!
|
84
|
+
_out "<ul>"
|
85
|
+
lines = _body.each
|
86
|
+
loop do
|
87
|
+
line = lines.next
|
88
|
+
line = _format(line)
|
89
|
+
if line[0] == " "
|
90
|
+
_out line
|
91
|
+
else
|
92
|
+
_out "<li>#{line}</li>"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
_out "</ul>"
|
96
|
+
_optional_blank_line
|
97
|
+
end
|
98
|
+
|
99
|
+
def html_body(file)
|
100
|
+
file.puts "<html>\n <body>"
|
101
|
+
yield
|
102
|
+
file.puts " </body>\n</html>"
|
103
|
+
end
|
104
|
+
|
105
|
+
def make_magic_links
|
106
|
+
# FIXME remember strings may not be safe
|
107
|
+
line = _data.chomp
|
108
|
+
input, cardfile, mainfile, card_title = *line.split(" ", 4)
|
109
|
+
pairs = File.readlines(input).map {|line| line.chomp.split(",", 2) }
|
110
|
+
# HTML for main area (iframe)
|
111
|
+
File.open("#{mainfile}.html", "w") do |f|
|
112
|
+
html_body(f) do
|
113
|
+
f.puts "<h1>#{card_title}</h1>"
|
114
|
+
pairs.each {|file, title| f.puts %[<a href="#{file}">#{title}</a> <br>] }
|
115
|
+
end
|
116
|
+
end
|
117
|
+
# HTML for sidebar card
|
118
|
+
STDERR.puts %[File is: 'widgets/#{tag}/#{mainfile}.html']
|
119
|
+
File.open("#{cardfile}.html", "w") do |f|
|
120
|
+
f.puts <<-EOS
|
121
|
+
<div class="card mb-3">
|
122
|
+
<div class="card-body">
|
123
|
+
<h5 class="card-title">
|
124
|
+
<a href="javascript: void(0)"
|
125
|
+
onclick="javascript:open_main('widgets/#{tag}/#{mainfile}.html')"
|
126
|
+
style="text-decoration: none; color: black">#{card_title}</a>
|
127
|
+
</h5>
|
128
|
+
EOS
|
129
|
+
pairs.each do |file, title|
|
130
|
+
f.puts <<-EOS
|
131
|
+
<li class="list-group-item"> <a href="javascript: void(0)"
|
132
|
+
onclick="javascript:open_main('#{file}')">#{title}</a> </li>
|
133
|
+
EOS
|
134
|
+
end
|
135
|
+
f.puts <<-EOS
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
EOS
|
68
139
|
end
|
69
140
|
end
|
70
141
|
|
@@ -164,29 +235,6 @@ def pin
|
|
164
235
|
_optional_blank_line
|
165
236
|
end
|
166
237
|
|
167
|
-
def list
|
168
|
-
_out "<ul>"
|
169
|
-
_body {|line| _out "<li>#{line}</li>" }
|
170
|
-
_out "</ul>"
|
171
|
-
_optional_blank_line
|
172
|
-
end
|
173
|
-
|
174
|
-
def list!
|
175
|
-
_out "<ul>"
|
176
|
-
lines = _body.each
|
177
|
-
loop do
|
178
|
-
line = lines.next
|
179
|
-
line = _format(line)
|
180
|
-
if line[0] == " "
|
181
|
-
_out line
|
182
|
-
else
|
183
|
-
_out "<li>#{line}</li>"
|
184
|
-
end
|
185
|
-
end
|
186
|
-
_out "</ul>"
|
187
|
-
_optional_blank_line
|
188
|
-
end
|
189
|
-
|
190
238
|
def write_post
|
191
239
|
raise "'post' was not called" unless @meta
|
192
240
|
save = Dir.pwd
|
@@ -277,6 +325,8 @@ class Livetext::Functions
|
|
277
325
|
end
|
278
326
|
end
|
279
327
|
|
328
|
+
###
|
329
|
+
|
280
330
|
def _var(name) # FIXME scope issue!
|
281
331
|
::Livetext::Vars[name] || "[:#{name} is undefined]"
|
282
332
|
end
|
@@ -291,12 +341,12 @@ def head # Does NOT output tags
|
|
291
341
|
defaults = {}
|
292
342
|
defaults = { "charset" => %[<meta charset="utf-8">],
|
293
343
|
"http-equiv" => %[<meta http-equiv="X-UA-Compatible" content="IE=edge">],
|
294
|
-
"title" => %[<title>\n #{_var(:blog)} | #{_var(
|
344
|
+
"title" => %[<title>\n #{_var(:blog)} | #{_var("blog.desc")}\n </title>],
|
295
345
|
"generator" => %[<meta name="generator" content="Runeblog v #@version">],
|
296
346
|
"og:title" => %[<meta property="og:title" content="#{_var(:blog)}">],
|
297
347
|
"og:locale" => %[<meta property="og:locale" content="#{_var(:locale)}">],
|
298
|
-
"description" => %[<meta name="description" content="#{_var(
|
299
|
-
"og:description" => %[<meta property="og:description" content="#{_var(
|
348
|
+
"description" => %[<meta name="description" content="#{_var("blog.desc")}">],
|
349
|
+
"og:description" => %[<meta property="og:description" content="#{_var("blog.desc")}">],
|
300
350
|
"linkc" => %[<link rel="canonical" href="#{_var(:host)}">],
|
301
351
|
"og:url" => %[<meta property="og:url" content="#{_var(:host)}">],
|
302
352
|
"og:site_name" => %[<meta property="og:site_name" content="#{_var(:blog)}">],
|
@@ -366,20 +416,12 @@ end
|
|
366
416
|
|
367
417
|
def sidebar
|
368
418
|
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
369
|
-
|
370
|
-
tag =
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
end
|
376
|
-
|
377
|
-
def sidebar!
|
378
|
-
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
379
|
-
_args do |line|
|
380
|
-
tag = line.chomp.strip
|
381
|
-
self.data = "sidebar/#{tag.downcase}.lt3"
|
382
|
-
_include
|
419
|
+
_args do |token|
|
420
|
+
tag = token.chomp.strip.downcase
|
421
|
+
Dir.chdir("widgets/#{tag}") do
|
422
|
+
livetext tag, "card-#{tag}.html"
|
423
|
+
_include_file "card-#{tag}.html"
|
424
|
+
end
|
383
425
|
end
|
384
426
|
_out %[</div>]
|
385
427
|
end
|
@@ -451,7 +493,7 @@ def all_teasers
|
|
451
493
|
end
|
452
494
|
text << "</body></html>"
|
453
495
|
File.write("recent.html", text)
|
454
|
-
_out %[<iframe style="width: 100vw;height: 100vh;position: relative;" src='recent.html' width=100% frameborder="0" allowfullscreen></iframe>]
|
496
|
+
_out %[<iframe id="main" style="width: 100vw; height: 100vh; position: relative;" src='recent.html' width=100% frameborder="0" allowfullscreen></iframe>]
|
455
497
|
end
|
456
498
|
|
457
499
|
def _post_lookup(postid) # side-effect
|
@@ -512,7 +554,7 @@ def card_iframe
|
|
512
554
|
stuff = lines[1..-1].join(" ") # FIXME later
|
513
555
|
middle = <<-HTML
|
514
556
|
<iframe src="#{url}" #{stuff}
|
515
|
-
style="border: 0"
|
557
|
+
style="border: 0" #{stuff}
|
516
558
|
frameborder="0" scrolling="no">
|
517
559
|
</iframe>
|
518
560
|
HTML
|
@@ -520,23 +562,30 @@ def card_iframe
|
|
520
562
|
_card_generic(card_title: title, middle: middle, extra: "bg-dark text-white")
|
521
563
|
end
|
522
564
|
|
565
|
+
def _main(url)
|
566
|
+
%[href="javascript: void(0)" onclick="javascript:open_main('#{url}')"]
|
567
|
+
end
|
568
|
+
|
523
569
|
def card1
|
524
570
|
title, lines = _data, _body
|
525
571
|
lines.map!(&:chomp)
|
526
572
|
|
527
573
|
card_text = lines[0]
|
528
|
-
url,
|
574
|
+
url, classname, cdata = lines[1].split(",", 4)
|
575
|
+
main = _main(url)
|
529
576
|
|
530
577
|
middle = <<-HTML
|
531
578
|
<p class="card-text">#{card_text}</p>
|
532
|
-
<a
|
579
|
+
<a #{main} class="#{classname}">#{cdata}</a>
|
533
580
|
HTML
|
534
581
|
|
535
582
|
_card_generic(card_title: title, middle: middle, extra: "bg-dark text-white")
|
536
583
|
end
|
537
584
|
|
538
585
|
def card2
|
539
|
-
|
586
|
+
str = _data
|
587
|
+
file, card_title = str.chomp.split(" ", 2)
|
588
|
+
card_title = %[<a #{_main(file)} style="text-decoration: none; color: black">#{card_title}</a>]
|
540
589
|
|
541
590
|
# FIXME is this wrong??
|
542
591
|
|
@@ -544,18 +593,16 @@ def card2
|
|
544
593
|
<div class="card mb-3">
|
545
594
|
<div class="card-body">
|
546
595
|
<h5 class="card-title">#{card_title}</h5>
|
547
|
-
</div>
|
548
596
|
<ul class="list-group list-group-flush">
|
549
597
|
HTML
|
550
598
|
_out open
|
551
599
|
_body do |line|
|
552
|
-
url,
|
553
|
-
|
600
|
+
url, cdata = line.chomp.split(",", 3)
|
601
|
+
main = _main(url)
|
602
|
+
_out %[<li class="list-group-item"><a #{main}}">#{cdata}</a> </li>]
|
554
603
|
end
|
555
|
-
close = %[ </ul>\n </div>]
|
604
|
+
close = %[ </ul>\n </div>\n </div>]
|
556
605
|
_out close
|
557
|
-
rescue
|
558
|
-
puts @live.body
|
559
606
|
end
|
560
607
|
|
561
608
|
def tag_cloud
|
@@ -569,15 +616,17 @@ def tag_cloud
|
|
569
616
|
_out open
|
570
617
|
_body do |line|
|
571
618
|
line.chomp!
|
572
|
-
url,
|
573
|
-
|
619
|
+
url, classname, cdata = line.split(",", 4)
|
620
|
+
main = _main(url)
|
621
|
+
_out %[<a #{main} class="#{classname}">#{cdata}</a>]
|
574
622
|
end
|
575
|
-
|
576
|
-
|
623
|
+
close = %[ </div>\n </div>]
|
624
|
+
_out close
|
577
625
|
end
|
578
626
|
|
579
627
|
def navbar
|
580
628
|
title = _var(:blog)
|
629
|
+
|
581
630
|
open = <<-HTML
|
582
631
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
583
632
|
<a class="navbar-brand" href="index.html">#{title}</a>
|
@@ -590,7 +639,6 @@ def navbar
|
|
590
639
|
aria-label="Toggle navigation">
|
591
640
|
<span class="navbar-toggler-icon"></span>
|
592
641
|
</button>
|
593
|
-
|
594
642
|
<div class="collapse navbar-collapse pull-right"
|
595
643
|
id="navbarSupportedContent">
|
596
644
|
<ul class="navbar-nav mr-auto">
|
@@ -605,11 +653,13 @@ def navbar
|
|
605
653
|
_out open
|
606
654
|
_body do |line|
|
607
655
|
href, cdata = line.chomp.strip.split(" ", 2)
|
656
|
+
main = _main(href)
|
608
657
|
if first
|
609
658
|
first = false
|
610
659
|
_out %[<li class="nav-item active"> <a class="nav-link" href="#{href}">#{cdata}<span class="sr-only">(current)</span></a> </li>]
|
611
660
|
else
|
612
|
-
|
661
|
+
main = _main("navbar/#{href}")
|
662
|
+
_out %[<li class="nav-item"> <a class="nav-link" #{main}>#{cdata}</a> </li>]
|
613
663
|
end
|
614
664
|
end
|
615
665
|
_out close
|
data/lib/repl.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
require 'runeblog'
|
2
2
|
require 'global'
|
3
3
|
require 'ostruct'
|
4
4
|
require 'helpers-repl' # FIXME structure
|
5
5
|
|
6
6
|
make_exception(:PublishError, "Error during publishing")
|
7
|
-
|
7
|
+
make_exception(:EditorProblem, "Could not edit $1")
|
8
8
|
|
9
9
|
module RuneBlog::REPL
|
10
10
|
|
11
11
|
def edit_file(file)
|
12
12
|
result = system("#{@blog.editor} #{file}")
|
13
|
+
STDERR.puts "editor = #{@blog.editor} FILE = #{file}"
|
13
14
|
raise EditorProblem(file) unless result
|
14
15
|
sleep 0.1
|
15
16
|
STDSCR.clear
|
data/lib/runeblog.rb
CHANGED
@@ -177,16 +177,17 @@ class RuneBlog
|
|
177
177
|
x = RuneBlog::Default
|
178
178
|
copy!("#{Themes}", "themes")
|
179
179
|
create_dirs(:assets, :posts)
|
180
|
-
create_dirs(:staging, "remote/permalink")
|
180
|
+
create_dirs(:staging, "remote/permalink", "remote/navbar")
|
181
|
+
livetext "themes/standard/etc/blog.css.lt3" # strip ext
|
181
182
|
copy!("themes/standard/*", "staging/")
|
183
|
+
|
182
184
|
copy!("themes/standard/etc", "remote/")
|
183
185
|
copy!("themes/standard/assets", "remote/")
|
186
|
+
copy!("themes/standard/widgets", "remote/")
|
184
187
|
|
185
188
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
186
189
|
dump(pub, "publish")
|
187
190
|
|
188
|
-
# Add to global.lt3 here? FIXME
|
189
|
-
|
190
191
|
view = RuneBlog::View.new(arg)
|
191
192
|
self.view = view
|
192
193
|
vdir = self.view.dir
|
@@ -212,14 +213,6 @@ class RuneBlog
|
|
212
213
|
files.reject! {|f| File.mtime(f) < File.mtime("#{vdir}/last_published") }
|
213
214
|
end
|
214
215
|
|
215
|
-
def files_by_id(id) # FIXME get rid of this later
|
216
|
-
raise ArgumentError unless id.is_a?(Integer)
|
217
|
-
files = Find.find(self.view.dir).to_a
|
218
|
-
tag = prefix(id)
|
219
|
-
result = files.grep(/#{tag}-/)
|
220
|
-
result
|
221
|
-
end
|
222
|
-
|
223
216
|
def post_lookup(postid) # side-effect?
|
224
217
|
# .. = templates, ../.. = views/thisview
|
225
218
|
slug = title = date = teaser_text = nil
|
@@ -278,11 +271,10 @@ class RuneBlog
|
|
278
271
|
text << "</body></html>"
|
279
272
|
File.write(file, text) # FIXME ???
|
280
273
|
iframe_text = <<-HTML
|
281
|
-
<iframe style="width: 100vw;height: 100vh;position: relative;"
|
274
|
+
<iframe name="main" style="width: 100vw;height: 100vh;position: relative;"
|
282
275
|
src='recent.html' width=100% frameborder="0" allowfullscreen>
|
283
276
|
</iframe>
|
284
277
|
HTML
|
285
|
-
# _out iframe_text # FIXME ??
|
286
278
|
end
|
287
279
|
|
288
280
|
def create_new_post(title, testing = false, teaser: nil, body: nil, other_views: [])
|
@@ -409,6 +401,7 @@ class RuneBlog
|
|
409
401
|
livetext "post/permalink.lt3", "../remote/permalink/#{html}"
|
410
402
|
collect_recent_posts("recent.html")
|
411
403
|
copy("recent.html", "../remote")
|
404
|
+
copy!("navbar/*html", "../remote/navbar/")
|
412
405
|
livetext "blog/generate", "../remote/index"
|
413
406
|
end
|
414
407
|
end
|
@@ -424,7 +417,7 @@ class RuneBlog
|
|
424
417
|
check_meta(meta, "index_entry1")
|
425
418
|
raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
|
426
419
|
check_meta(meta, "index_entry2")
|
427
|
-
self.make_slug(meta)
|
420
|
+
self.make_slug(meta)
|
428
421
|
check_meta(meta, "index_entry3")
|
429
422
|
# FIXME clean up and generalize
|
430
423
|
ref = "#{view}/#{meta.slug}/index.html"
|
@@ -489,12 +482,6 @@ class RuneBlog
|
|
489
482
|
system("rm -rf #@root/drafts/#{tag}-*")
|
490
483
|
end
|
491
484
|
|
492
|
-
def post_exists?(num)
|
493
|
-
raise ArgumentError unless num.is_a?(Integer)
|
494
|
-
list = files_by_id(num) # FIXME search under view dirs
|
495
|
-
list.empty? ? nil : list
|
496
|
-
end
|
497
|
-
|
498
485
|
def make_slug(meta)
|
499
486
|
raise ArgumentError unless meta.title.is_a?(String)
|
500
487
|
label = '%04d' % meta.num # FIXME can do better
|
data/lib/runeblog_version.rb
CHANGED
data/runeblog.gemspec
CHANGED
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
|
|
20
20
|
s.authors = ["Hal Fulton"]
|
21
21
|
s.email = 'rubyhacker@gmail.com'
|
22
22
|
s.executables << "blog"
|
23
|
-
s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.
|
23
|
+
s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.92'
|
24
24
|
s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.16'
|
25
25
|
|
26
26
|
# Files...
|
@@ -1,20 +1,9 @@
|
|
1
1
|
.nopara
|
2
|
-
|
3
|
-
.variables
|
4
|
-
post_title_color #010101
|
5
|
-
post_title_size 28px
|
6
|
-
|
7
|
-
post_text_color #0101a1
|
8
|
-
post_text_size 22px
|
9
|
-
|
10
|
-
post_date_color #9a9a9a
|
11
|
-
post_date_size 15px
|
12
|
-
.end
|
13
|
-
|
2
|
+
.include themes/standard/global.lt3
|
14
3
|
|
15
4
|
\.post-title a {
|
16
|
-
color: $
|
17
|
-
font-size: $
|
5
|
+
color: $post.title.color;
|
6
|
+
font-size: $post.title.size;
|
18
7
|
float: right;
|
19
8
|
display: inline-block;
|
20
9
|
text-align: top;
|
@@ -26,8 +15,8 @@ post_date_size 15px
|
|
26
15
|
}
|
27
16
|
|
28
17
|
\.post-title-text a {
|
29
|
-
color: $
|
30
|
-
font-size: $
|
18
|
+
color: $post.text.color;
|
19
|
+
font-size: $post.text.size;
|
31
20
|
# float: right;
|
32
21
|
display: block;
|
33
22
|
text-decoration: none;
|
@@ -38,8 +27,8 @@ post_date_size 15px
|
|
38
27
|
}
|
39
28
|
|
40
29
|
\.post-date {
|
41
|
-
color: $
|
42
|
-
font-size: $
|
30
|
+
color: $post.date.color;
|
31
|
+
font-size: $post.date.size;
|
43
32
|
display: block;
|
44
33
|
float: left;
|
45
34
|
text-align: top;
|
data/themes/standard/global.lt3
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
.variables
|
2
2
|
author Hal Fulton
|
3
3
|
blog My Blog (and Welcome To It)
|
4
|
-
|
4
|
+
blog.desc All the stuff you never needed to know
|
5
5
|
host localhost:4000//
|
6
6
|
charset utf-8
|
7
7
|
site rubyhacker.com
|
8
8
|
url localhost:4000//
|
9
9
|
locale en_US
|
10
|
+
|
11
|
+
post.title.color #010101
|
12
|
+
post.title.size 28px
|
13
|
+
|
14
|
+
post.text.color #0101a1
|
15
|
+
post.text.size 22px
|
16
|
+
|
17
|
+
post.date.color #9a9a9a
|
18
|
+
post.date.size 15px
|
10
19
|
.end
|
11
20
|
|
12
21
|
. Maybe move publish info here?
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.set classname="btn btn-light float-right"
|
2
|
+
.set card.title="Advertisement"
|
3
|
+
.set card.text="Build your amazing website with blabla.com."
|
4
|
+
.set extra="bg-dark text-white"
|
5
|
+
|
6
|
+
<div class="card #{_var[:extra]} mb-3">
|
7
|
+
<div class="card-body">
|
8
|
+
<h5 class="card-title">#{_var["card.title"]}</h5>
|
9
|
+
<p class="card-text">#{_var["card.text"]}</p>
|
10
|
+
<a #{main} class="#{classname}">#{_var["card.text"]}</a>
|
11
|
+
</div>
|
12
|
+
</div>
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="card mb-3">
|
2
|
+
<div class="card-body">
|
3
|
+
<h5 class="card-title">
|
4
|
+
<a href="javascript: void(0)"
|
5
|
+
onclick="javascript:open_main('main-news')"
|
6
|
+
style="text-decoration: none; color: black">Recent News</a>
|
7
|
+
</h5>
|
8
|
+
<li class="list-group-item"> <a href="javascript: void(0)"
|
9
|
+
onclick="javascript:open_main('https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/')">FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses</a> </li>
|
10
|
+
<li class="list-group-item"> <a href="javascript: void(0)"
|
11
|
+
onclick="javascript:open_main('https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/')">SpaceX’s orbital Starship prototype construction progress detailed in new photos</a> </li>
|
12
|
+
<li class="list-group-item"> <a href="javascript: void(0)"
|
13
|
+
onclick="javascript:open_main('https://developers.googleblog.com/2019/05/Flutter-io19.html')">Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop</a> </li>
|
14
|
+
<li class="list-group-item"> <a href="javascript: void(0)"
|
15
|
+
onclick="javascript:open_main('https://jaycarlson.net/microcontrollers/')">The Amazing \$1 Microcontroller (2017)</a> </li>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/,FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses
|
2
|
+
https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/,SpaceX’s orbital Starship prototype construction progress detailed in new photos
|
3
|
+
https://developers.googleblog.com/2019/05/Flutter-io19.html,Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
|
4
|
+
https://jaycarlson.net/microcontrollers/,The Amazing \$1 Microcontroller (2017)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<h1>Recent News</h1>
|
4
|
+
<a href="https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/">FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses</a> <br>
|
5
|
+
<a href="https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/">SpaceX’s orbital Starship prototype construction progress detailed in new photos</a> <br>
|
6
|
+
<a href="https://developers.googleblog.com/2019/05/Flutter-io19.html">Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop</a> <br>
|
7
|
+
<a href="https://jaycarlson.net/microcontrollers/">The Amazing \$1 Microcontroller (2017)</a> <br>
|
8
|
+
</body>
|
9
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.card_iframe
|
2
|
+
<h1>Pages</h1>
|
3
|
+
|
4
|
+
.def make_links
|
5
|
+
pairs = File.readlines("list.data").map {|line| line.chomp.split(" ", 2) }
|
6
|
+
File.open("generated.lt3", "w") do |f|
|
7
|
+
pairs.each do |file, title|
|
8
|
+
f.puts <<-EOS
|
9
|
+
<a href="#{file}">#{title}</a> <br>
|
10
|
+
EOS
|
11
|
+
end
|
12
|
+
end
|
13
|
+
.end
|
14
|
+
|
15
|
+
.make_links
|
16
|
+
|
17
|
+
.include generated.lt3
|
18
|
+
.end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.mixin liveblog
|
2
|
+
|
3
|
+
.tag_cloud
|
4
|
+
https://google.com/,btn btn-dark m-1,Programming
|
5
|
+
https://google.com/,btn btn-danger m-1,Science Fiction
|
6
|
+
https://google.com/,btn btn-light m-1,Art
|
7
|
+
https://google.com/,btn btn-dark m-1,Robotics
|
8
|
+
https://google.com/,btn btn-warning m-1,Food and Travel
|
9
|
+
https://google.com/,btn btn-light m-1,DIY Hacks
|
10
|
+
https://google.com/,btn btn-info m-1,Surfing
|
11
|
+
.end
|
12
|
+
|
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.1
|
4
|
+
version: 0.2.1
|
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-09-
|
11
|
+
date: 2019-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.8'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.8.
|
22
|
+
version: 0.8.92
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.8'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.8.
|
32
|
+
version: 0.8.92
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rubytext
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,21 +82,36 @@ files:
|
|
82
82
|
- themes/standard/blog/head.lt3
|
83
83
|
- themes/standard/blog/index.lt3
|
84
84
|
- themes/standard/blog/post_entry.lt3
|
85
|
-
- themes/standard/etc/blog.css
|
86
85
|
- themes/standard/etc/blog.css.lt3
|
87
86
|
- themes/standard/etc/externals.lt3
|
88
87
|
- themes/standard/etc/favicon.ico
|
88
|
+
- themes/standard/etc/misc.js
|
89
89
|
- themes/standard/global.lt3
|
90
90
|
- themes/standard/navbar/about.html
|
91
|
+
- themes/standard/navbar/contact.html
|
91
92
|
- themes/standard/navbar/navbar.lt3
|
92
93
|
- themes/standard/post/generate.lt3
|
93
94
|
- themes/standard/post/head.lt3
|
94
95
|
- themes/standard/post/index.lt3
|
95
96
|
- themes/standard/post/permalink.lt3
|
96
|
-
- themes/standard/sidebar/
|
97
|
-
- themes/standard/
|
98
|
-
- themes/standard/
|
99
|
-
- themes/standard/
|
97
|
+
- themes/standard/sidebar/README
|
98
|
+
- themes/standard/widgets/README
|
99
|
+
- themes/standard/widgets/ad/ad.lt3
|
100
|
+
- themes/standard/widgets/calendar/calendar.lt3
|
101
|
+
- themes/standard/widgets/news/card-news.html
|
102
|
+
- themes/standard/widgets/news/list.data
|
103
|
+
- themes/standard/widgets/news/main-news.html
|
104
|
+
- themes/standard/widgets/news/news.lt3
|
105
|
+
- themes/standard/widgets/pages/README
|
106
|
+
- themes/standard/widgets/pages/disclaim.lt3
|
107
|
+
- themes/standard/widgets/pages/faq.lt3
|
108
|
+
- themes/standard/widgets/pages/generated.lt3
|
109
|
+
- themes/standard/widgets/pages/lifestory.lt3
|
110
|
+
- themes/standard/widgets/pages/like-dislike.lt3
|
111
|
+
- themes/standard/widgets/pages/list.data
|
112
|
+
- themes/standard/widgets/pages/main.html
|
113
|
+
- themes/standard/widgets/pages/main.lt3
|
114
|
+
- themes/standard/widgets/tag-cloud/tag-cloud.lt3
|
100
115
|
homepage: https://github.com/Hal9000/runeblog
|
101
116
|
licenses:
|
102
117
|
- Ruby
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# include variables before this file?
|
2
|
-
|
3
|
-
.post-title a {
|
4
|
-
color: #010101;
|
5
|
-
font-size: 28px;
|
6
|
-
float: right;
|
7
|
-
display: inline-block;
|
8
|
-
text-align: top;
|
9
|
-
text-decoration: none;
|
10
|
-
}
|
11
|
-
|
12
|
-
.post-title a:hover {
|
13
|
-
text-decoration: none;
|
14
|
-
}
|
15
|
-
|
16
|
-
.post-title-text a {
|
17
|
-
color: #0101a1;
|
18
|
-
font-size: 22px;
|
19
|
-
# float: right;
|
20
|
-
display: block;
|
21
|
-
text-decoration: none;
|
22
|
-
}
|
23
|
-
|
24
|
-
.post-title-text a:hover {
|
25
|
-
text-decoration: none;
|
26
|
-
}
|
27
|
-
|
28
|
-
.post-date {
|
29
|
-
color: #9a9a9a;
|
30
|
-
font-size: 15px;
|
31
|
-
display: block;
|
32
|
-
float: left;
|
33
|
-
text-align: top;
|
34
|
-
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
.card2 Recent News
|
2
|
-
https://nest.com/whats-happening/,_blank,Google Is Turning Off the Works-with-Nest API
|
3
|
-
https://developers.googleblog.com/2019/05/Flutter-io19.html,_blank,Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
|
4
|
-
https://github.com/kkuchta/css-only-chat,_blank,Css-only-chat: A truly monstrous async web chat using no JS on the front end
|
5
|
-
https://jaycarlson.net/microcontrollers/,_blank,The Amazing $1 Microcontroller (2017)
|
6
|
-
.end
|
7
|
-
|
@@ -1,10 +0,0 @@
|
|
1
|
-
.tag_cloud
|
2
|
-
https://google.com/,_blank,btn btn-dark m-1,Programming
|
3
|
-
https://google.com/,_blank,btn btn-danger m-1,Science Fiction
|
4
|
-
https://google.com/,_blank,btn btn-light m-1,Art
|
5
|
-
https://google.com/,_blank,btn btn-dark m-1,Robotics
|
6
|
-
https://google.com/,_blank,btn btn-warning m-1,Food and Travel
|
7
|
-
https://google.com/,_blank,btn btn-light m-1,DIY Hacks
|
8
|
-
https://google.com/,_blank,btn btn-info m-1,Surfing
|
9
|
-
.end
|
10
|
-
|