runeblog 0.2.18 → 0.2.22

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f937d26af0033b5370fb7057e148cf2a0c9574f1fd2a3575f19ba11a9fb412f
4
- data.tar.gz: 54ee56282b161b3b114d968f31d818f35eb9d9116bebda68f2de380d8aa5d290
3
+ metadata.gz: cd57361521e7c935c03e98dbdfdabea0d04a36ff4082c67017d2a5d90a889af8
4
+ data.tar.gz: 10aab8f0bf2dda01cbd2f65d16bb5808a865360527c878262df9cf02b1247394
5
5
  SHA512:
6
- metadata.gz: b820edb205e03e5a4ba420daa50b8e163e2dc74fdc3dcebb96deecc963e0ef0e64d1a9c592bd0825e2589fca6998323990b6b76c1c015483038693bf7af500dc
7
- data.tar.gz: 07e9915006923ba7de0e33963ce4ecf9a63d4fbe20368f8962f13d0ed131951905219ccaafdff636f6100bd230546877ab6122e4cc48151e06dcdbeb7469cdc6
6
+ metadata.gz: '007719e1eb7df131e68b470f53e292ea82742bcccb2226979af578258645b21fc6d9904a6ebce028621709858363f364baa3b0d72957901f7c1cdff28c377ab7'
7
+ data.tar.gz: 459286ef17981cfb9a322e2e8210a50e294eb282639993a352c1f611d83992b3986ce5009ace7762a26bff85fd0304b0d427a62424ffa656cd9306139c8be127
Binary file
@@ -103,16 +103,16 @@ def _html_body(file)
103
103
  end
104
104
 
105
105
  def _write_card(cardfile, mainfile, pairs, card_title, tag, relative: true)
106
- # HTML for card
107
106
  log!(str: "Creating #{cardfile}.html", pwd: true)
108
- # TTY.puts "Creating #{cardfile}.html - pwd = #{Dir.pwd}"
107
+ url = mainfile
108
+ url = :widgets/tag/mainfile + ".html" # if tag == "pages" # FIXME
109
109
  File.open("#{cardfile}.html", "w") do |f|
110
110
  f.puts <<-EOS
111
111
  <div class="card mb-3">
112
112
  <div class="card-body">
113
113
  <h5 class="card-title">
114
114
  <a href="javascript: void(0)"
115
- onclick="javascript:open_main('widgets/#{tag}/#{mainfile}.html')"
115
+ onclick="javascript:open_main('#{url}')"
116
116
  style="text-decoration: none; color: black">#{card_title}</a>
117
117
  </h5>
118
118
  EOS
@@ -131,9 +131,6 @@ def _write_card(cardfile, mainfile, pairs, card_title, tag, relative: true)
131
131
  url = :widgets/tag/file
132
132
  anchor = %[<a href="javascript: void(0)" onclick="javascript:open_main('#{url}')">#{title}</a>]
133
133
  end
134
- STDERR.puts [file, title].inspect
135
- STDERR.puts [tag, frameable, anchor].inspect
136
- STDERR.puts
137
134
  wrapper = %[<li class="list-group-item">#{anchor}</li>]
138
135
  f.puts wrapper
139
136
  end
@@ -144,17 +141,23 @@ STDERR.puts
144
141
  end
145
142
  end
146
143
 
147
- def _write_main(mainfile, pairs, card_title)
144
+ def _write_main(mainfile, pairs, card_title, tag)
148
145
  log!(str: "Creating #{mainfile}.html", pwd: true)
146
+ STDERR.puts "---- tag = #{tag.inspect}"
149
147
  File.open("#{mainfile}.html", "w") do |f|
150
148
  _html_body(f) do
151
149
  f.puts "<h1>#{card_title}</h1>"
152
150
  pairs.each do |file, title|
153
- main = (file.start_with?("http") ? _main(file) : file)
154
- f.puts %[<a style="text-decoration: none; font-size: 24px" #{main}>#{title}</a> <br>]
151
+ # FIXME please!
152
+ STDERR.puts "---- title1 = #{title.inspect}"
153
+ yesno, title = title.split(/, */) if title =~ /^[yes|no]/
154
+ STDERR.puts "---- title2 = #{title.inspect}"
155
+ url = (file.start_with?("http") ? _main(file) : :widgets/tag/file)
156
+ f.puts %[<a style="text-decoration: none; font-size: 24px" href='#{url}'>#{title}</a> <br>]
155
157
  end
156
158
  end
157
159
  end
160
+ STDERR.puts
158
161
  end
159
162
 
160
163
  def make_main_links
@@ -166,7 +169,7 @@ def make_main_links
166
169
  input = "list.data"
167
170
  log!(str: "Reading #{input}", pwd: true)
168
171
  pairs = File.readlines(input).map {|line| line.chomp.split(/, */, 2) }
169
- _write_main(mainfile, pairs, card_title)
172
+ _write_main(mainfile, pairs, card_title, tag)
170
173
  widget_relative = false # (tag != "news") # FIXME kludge!!!
171
174
  _write_card(cardfile, mainfile, pairs, card_title, tag, relative: widget_relative)
172
175
  log!(str: "...returning from method", pwd: true)
@@ -543,7 +546,7 @@ def card_iframe
543
546
  end
544
547
 
545
548
  def _main(url)
546
- %[href="javascript: void(0)" onclick="javascript:open_main('#{url}')"]
549
+ %["javascript: void(0)" onclick="javascript:open_main('#{url}')"]
547
550
  end
548
551
 
549
552
  def card1
@@ -605,6 +608,7 @@ def tag_cloud
605
608
  end
606
609
 
607
610
  def navbar
611
+ vdir = @blog.view.dir
608
612
  title = _var(:blog)
609
613
 
610
614
  open = <<-HTML
@@ -631,15 +635,17 @@ def navbar
631
635
 
632
636
  first = true
633
637
  _out open
634
- _body do |line|
635
- href, cdata = line.chomp.strip.split(" ", 2)
636
- main = _main(href)
638
+ lines = _body
639
+ lines.each do |line|
640
+ basename, cdata = line.chomp.strip.split(" ", 2)
641
+ full = :navbar/basename+".html"
642
+ href_main = _main(full)
637
643
  if first
638
- first = false
639
- _out %[<li class="nav-item active"> <a class="nav-link" href="#{href}">#{cdata}<span class="sr-only">(current)</span></a> </li>]
644
+ first = false # hardcode this part??
645
+ _out %[<li class="nav-item active"> <a class="nav-link" href="index.html">#{cdata}<span class="sr-only">(current)</span></a> </li>]
640
646
  else
641
- main = _main(:navbar/href)
642
- _out %[<li class="nav-item"> <a class="nav-link" #{main}>#{cdata}</a> </li>]
647
+ xlate cwd: "navbar", src: basename, dst: vdir/"remote/navbar"/basename+".html" # , debug: true
648
+ _out %[<li class="nav-item"> <a class="nav-link" #{href_main}>#{cdata}</a> </li>]
643
649
  end
644
650
  end
645
651
  _out close
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.18"
5
+ VERSION = "0.2.22"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
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.18
4
+ version: 0.2.22
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-04 00:00:00.000000000 Z
11
+ date: 2019-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext