runeblog 0.1.99 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liveblog.rb +27 -19
- data/lib/runeblog.rb +2 -0
- data/lib/runeblog_version.rb +1 -1
- data/themes/standard/blog/index.lt3 +1 -1
- data/themes/standard/widgets/ad/ad.lt3 +11 -10
- data/themes/standard/widgets/tag-cloud/tag-cloud.lt3 +2 -0
- metadata +1 -2
- data/themes/standard/widgets/ad/ad2.lt3 +0 -12
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/liveblog.rb
CHANGED
@@ -22,6 +22,25 @@ 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]
|
@@ -96,13 +115,14 @@ def make_magic_links
|
|
96
115
|
end
|
97
116
|
end
|
98
117
|
# HTML for sidebar card
|
118
|
+
STDERR.puts %[File is: 'widgets/#{tag}/#{mainfile}.html']
|
99
119
|
File.open("#{cardfile}.html", "w") do |f|
|
100
120
|
f.puts <<-EOS
|
101
121
|
<div class="card mb-3">
|
102
122
|
<div class="card-body">
|
103
123
|
<h5 class="card-title">
|
104
124
|
<a href="javascript: void(0)"
|
105
|
-
onclick="javascript:open_main('
|
125
|
+
onclick="javascript:open_main('widgets/#{tag}/#{mainfile}.html')"
|
106
126
|
style="text-decoration: none; color: black">#{card_title}</a>
|
107
127
|
</h5>
|
108
128
|
EOS
|
@@ -396,30 +416,16 @@ end
|
|
396
416
|
|
397
417
|
def sidebar
|
398
418
|
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
399
|
-
|
400
|
-
tag =
|
419
|
+
_args do |token|
|
420
|
+
tag = token.chomp.strip.downcase
|
401
421
|
Dir.chdir("widgets/#{tag}") do
|
402
|
-
|
403
|
-
|
404
|
-
_include_file "card-#{source}.html"
|
422
|
+
livetext tag, "card-#{tag}.html"
|
423
|
+
_include_file "card-#{tag}.html"
|
405
424
|
end
|
406
425
|
end
|
407
426
|
_out %[</div>]
|
408
427
|
end
|
409
428
|
|
410
|
-
def sidebar!
|
411
|
-
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
412
|
-
_args do |line|
|
413
|
-
tag = line.chomp.strip
|
414
|
-
source = "sidebar/#{tag.downcase}.lt3"
|
415
|
-
unless File.exist?(source)
|
416
|
-
source = "widgets/#{tag.downcase}/main.lt3"
|
417
|
-
end
|
418
|
-
_include_file source
|
419
|
-
end
|
420
|
-
_out %[</div>]
|
421
|
-
end
|
422
|
-
|
423
429
|
def stylesheet
|
424
430
|
lines = _body
|
425
431
|
url = lines[0]
|
@@ -614,6 +620,8 @@ def tag_cloud
|
|
614
620
|
main = _main(url)
|
615
621
|
_out %[<a #{main} class="#{classname}">#{cdata}</a>]
|
616
622
|
end
|
623
|
+
close = %[ </div>\n </div>]
|
624
|
+
_out close
|
617
625
|
end
|
618
626
|
|
619
627
|
def navbar
|
data/lib/runeblog.rb
CHANGED
@@ -180,8 +180,10 @@ class RuneBlog
|
|
180
180
|
create_dirs(:staging, "remote/permalink", "remote/navbar")
|
181
181
|
livetext "themes/standard/etc/blog.css.lt3" # strip ext
|
182
182
|
copy!("themes/standard/*", "staging/")
|
183
|
+
|
183
184
|
copy!("themes/standard/etc", "remote/")
|
184
185
|
copy!("themes/standard/assets", "remote/")
|
186
|
+
copy!("themes/standard/widgets", "remote/")
|
185
187
|
|
186
188
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
187
189
|
dump(pub, "publish")
|
data/lib/runeblog_version.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
.
|
4
|
-
.
|
5
|
-
. which will bring up a random ad.
|
6
|
-
|
7
|
-
.card1 Advertisement
|
8
|
-
Build your amazing website with blabla.com.
|
9
|
-
https://google.com/,btn btn-light float-right,Visit Page
|
10
|
-
.end
|
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"
|
11
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>
|
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.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
@@ -97,7 +97,6 @@ files:
|
|
97
97
|
- themes/standard/sidebar/README
|
98
98
|
- themes/standard/widgets/README
|
99
99
|
- themes/standard/widgets/ad/ad.lt3
|
100
|
-
- themes/standard/widgets/ad/ad2.lt3
|
101
100
|
- themes/standard/widgets/calendar/calendar.lt3
|
102
101
|
- themes/standard/widgets/news/card-news.html
|
103
102
|
- themes/standard/widgets/news/list.data
|
@@ -1,12 +0,0 @@
|
|
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>
|