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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aec5b477d7f2cb604623e089adbaae8bb87d5ddcb784ebc3d2935aa02892e9d1
4
- data.tar.gz: f3a03f9555b4bc7a4d9e6149e0cd9606e1d1269ceb184cac04e8d579797647ff
3
+ metadata.gz: 7ecf2ea93c7b100f433d4cf9a822655ba6f4c95997e96b09dee870c8234a10e8
4
+ data.tar.gz: d1d6da2a7c78cb201b9fd6d3359347b6b6cf4534286f2c12c44ff72fcb545c85
5
5
  SHA512:
6
- metadata.gz: 2956b5197b0d57215fdf7701eb3369755cdc04494b357b0dbfe538e8614c8f41f643f78cd26e67d6687a925a47b9486f6375af0d3a16810d2598625b7156ae0e
7
- data.tar.gz: f788243f1c0c1802ecc99218de1d92f87d51a67093f8d31fbf330a8825b43e8c70f478c6b756c993a295f26c76dbe0dbcd5e7d3a9d4fa39e3b22bd365cc1c482
6
+ metadata.gz: b9af872813d5420811971839357debb0c6197302e832d15c5749164c8a87523def9370943fa0bd14b15a44ab3b8fbdf9eee97744df91d98920f23dcde8413e6d
7
+ data.tar.gz: e995fb01bdc9073957c2e762fdff55f4502a906cb0176df76af45d65ca2ea75b19934d74e6e0909c0c7f26ba370abaebad5d24bd3ae4e61007a171d2fa263114
@@ -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('#{mainfile}')"
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
- _body do |line|
400
- tag = line.chomp.strip.downcase
419
+ _args do |token|
420
+ tag = token.chomp.strip.downcase
401
421
  Dir.chdir("widgets/#{tag}") do
402
- source = "#{tag}.lt3"
403
- livetext source, "/dev/null"
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
@@ -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")
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.1.99"
5
+ VERSION = "0.2.1"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -1,6 +1,6 @@
1
1
  .recent_posts
2
2
 
3
- .sidebar! news ad tag-cloud
3
+ .sidebar news tag-cloud
4
4
 
5
5
  . for now, skip: ad calendar tag-cloud
6
6
 
@@ -1,11 +1,12 @@
1
- . This is the "card" (sidebar) version.
2
-
3
- . In real life, there may be complex code here
4
- . referencing some advertiser or ad network
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>
@@ -1,3 +1,5 @@
1
+ .mixin liveblog
2
+
1
3
  .tag_cloud
2
4
  https://google.com/,btn btn-dark m-1,Programming
3
5
  https://google.com/,btn btn-danger m-1,Science Fiction
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.99
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>