runeblog 0.1.95 → 0.1.96
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 +8 -1
- data/lib/liveblog.rb +6 -3
- data/lib/repl.rb +3 -2
- data/lib/runeblog.rb +5 -20
- data/lib/runeblog_version.rb +1 -1
- data/themes/standard/blog/head.lt3 +1 -0
- data/themes/standard/etc/blog.css.lt3 +1 -12
- data/themes/standard/etc/misc.js +6 -0
- data/themes/standard/global.lt3 +9 -0
- data/themes/standard/navbar/about.html +4 -2
- metadata +3 -3
- data/themes/standard/etc/blog.css +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43e0f35e5c032653d07acda3b5cfcaf0ff06cb8fe53d77f32969e37447200c41
|
4
|
+
data.tar.gz: dd558ffa5a91dd1ef68cd4935517844cdf3c9deba18ff349d92b2f36e1fd790a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19161f1b4000f4ede35cb7c8393c1f8fcee3d0f190a61abe231ef098adedcaf99fc15ce7ccd2a7f983db924b05f110e279cf8c79417b61ee40bbdf9201c297b0
|
7
|
+
data.tar.gz: d06e92c711e868357b8c67f8da49dcddd7d2d983bd457675ac7c61c070fb5e1cfae2244d592327af6c1660b9fcaff05993cc80c90343af6c5d4476f493b5b0f4
|
data/lib/helpers-blog.rb
CHANGED
@@ -12,9 +12,16 @@ module RuneBlog::Helpers
|
|
12
12
|
system("cp -r #{src} #{dst}")
|
13
13
|
end
|
14
14
|
|
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
|
+
|
15
21
|
def livetext(src, dst)
|
16
22
|
src << ".lt3" unless src.end_with?(".lt3")
|
17
23
|
dst << ".html" unless dst.end_with?(".html")
|
24
|
+
return unless stale?(src, dst)
|
18
25
|
system("livetext #{src} >#{dst}")
|
19
26
|
end
|
20
27
|
|
@@ -65,7 +72,7 @@ module RuneBlog::Helpers
|
|
65
72
|
vals
|
66
73
|
end
|
67
74
|
|
68
|
-
def put_config(root:, view:"test_view", editor: "/bin/vim")
|
75
|
+
def put_config(root:, view:"test_view", editor: "/usr/local/bin/vim")
|
69
76
|
Dir.mkdir(root) unless Dir.exist?(root)
|
70
77
|
Dir.chdir(root) do
|
71
78
|
File.open("config", "w") do |cfg|
|
data/lib/liveblog.rb
CHANGED
@@ -451,7 +451,7 @@ def all_teasers
|
|
451
451
|
end
|
452
452
|
text << "</body></html>"
|
453
453
|
File.write("recent.html", text)
|
454
|
-
_out %[<iframe style="width: 100vw;height: 100vh;position: relative;" src='recent.html' width=100% frameborder="0" allowfullscreen></iframe>]
|
454
|
+
_out %[<iframe id="main" style="width: 100vw;height: 100vh;position: relative;" src='recent.html' width=100% frameborder="0" allowfullscreen></iframe>]
|
455
455
|
end
|
456
456
|
|
457
457
|
def _post_lookup(postid) # side-effect
|
@@ -578,6 +578,7 @@ end
|
|
578
578
|
|
579
579
|
def navbar
|
580
580
|
title = _var(:blog)
|
581
|
+
|
581
582
|
open = <<-HTML
|
582
583
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
583
584
|
<a class="navbar-brand" href="index.html">#{title}</a>
|
@@ -590,7 +591,6 @@ def navbar
|
|
590
591
|
aria-label="Toggle navigation">
|
591
592
|
<span class="navbar-toggler-icon"></span>
|
592
593
|
</button>
|
593
|
-
|
594
594
|
<div class="collapse navbar-collapse pull-right"
|
595
595
|
id="navbarSupportedContent">
|
596
596
|
<ul class="navbar-nav mr-auto">
|
@@ -605,11 +605,14 @@ def navbar
|
|
605
605
|
_out open
|
606
606
|
_body do |line|
|
607
607
|
href, cdata = line.chomp.strip.split(" ", 2)
|
608
|
+
# <!-- href="javascript:void(0);" onClick="urlChange('www.mypdf.com/test.pdf')" -->
|
608
609
|
if first
|
609
610
|
first = false
|
610
611
|
_out %[<li class="nav-item active"> <a class="nav-link" href="#{href}">#{cdata}<span class="sr-only">(current)</span></a> </li>]
|
611
612
|
else
|
612
|
-
|
613
|
+
href = "navbar/#{href}"
|
614
|
+
href_click = %[href="javascript:void(0)" onclick="javascript:open_main('#{href}')"]
|
615
|
+
_out %[<li class="nav-item"> <a class="nav-link" #{href_click}>#{cdata}</a> </li>]
|
613
616
|
end
|
614
617
|
end
|
615
618
|
_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,7 +177,8 @@ 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", "themes/standard/etc/blog.css" # simplify this
|
181
182
|
copy!("themes/standard/*", "staging/")
|
182
183
|
copy!("themes/standard/etc", "remote/")
|
183
184
|
copy!("themes/standard/assets", "remote/")
|
@@ -185,8 +186,6 @@ class RuneBlog
|
|
185
186
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
186
187
|
dump(pub, "publish")
|
187
188
|
|
188
|
-
# Add to global.lt3 here? FIXME
|
189
|
-
|
190
189
|
view = RuneBlog::View.new(arg)
|
191
190
|
self.view = view
|
192
191
|
vdir = self.view.dir
|
@@ -212,14 +211,6 @@ class RuneBlog
|
|
212
211
|
files.reject! {|f| File.mtime(f) < File.mtime("#{vdir}/last_published") }
|
213
212
|
end
|
214
213
|
|
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
214
|
def post_lookup(postid) # side-effect?
|
224
215
|
# .. = templates, ../.. = views/thisview
|
225
216
|
slug = title = date = teaser_text = nil
|
@@ -278,11 +269,10 @@ class RuneBlog
|
|
278
269
|
text << "</body></html>"
|
279
270
|
File.write(file, text) # FIXME ???
|
280
271
|
iframe_text = <<-HTML
|
281
|
-
<iframe style="width: 100vw;height: 100vh;position: relative;"
|
272
|
+
<iframe name="main" style="width: 100vw;height: 100vh;position: relative;"
|
282
273
|
src='recent.html' width=100% frameborder="0" allowfullscreen>
|
283
274
|
</iframe>
|
284
275
|
HTML
|
285
|
-
# _out iframe_text # FIXME ??
|
286
276
|
end
|
287
277
|
|
288
278
|
def create_new_post(title, testing = false, teaser: nil, body: nil, other_views: [])
|
@@ -409,6 +399,7 @@ class RuneBlog
|
|
409
399
|
livetext "post/permalink.lt3", "../remote/permalink/#{html}"
|
410
400
|
collect_recent_posts("recent.html")
|
411
401
|
copy("recent.html", "../remote")
|
402
|
+
copy!("navbar/*html", "../remote/navbar/")
|
412
403
|
livetext "blog/generate", "../remote/index"
|
413
404
|
end
|
414
405
|
end
|
@@ -424,7 +415,7 @@ class RuneBlog
|
|
424
415
|
check_meta(meta, "index_entry1")
|
425
416
|
raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
|
426
417
|
check_meta(meta, "index_entry2")
|
427
|
-
self.make_slug(meta)
|
418
|
+
self.make_slug(meta)
|
428
419
|
check_meta(meta, "index_entry3")
|
429
420
|
# FIXME clean up and generalize
|
430
421
|
ref = "#{view}/#{meta.slug}/index.html"
|
@@ -489,12 +480,6 @@ class RuneBlog
|
|
489
480
|
system("rm -rf #@root/drafts/#{tag}-*")
|
490
481
|
end
|
491
482
|
|
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
483
|
def make_slug(meta)
|
499
484
|
raise ArgumentError unless meta.title.is_a?(String)
|
500
485
|
label = '%04d' % meta.num # FIXME can do better
|
data/lib/runeblog_version.rb
CHANGED
@@ -1,16 +1,5 @@
|
|
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
5
|
color: $post_title_color;
|
data/themes/standard/global.lt3
CHANGED
@@ -7,6 +7,15 @@ 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?
|
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.1.96
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -82,10 +82,10 @@ 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
91
|
- themes/standard/navbar/navbar.lt3
|
@@ -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
|
-
}
|