runeblog 0.2.27 → 0.2.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view.tgz +0 -0
- data/lib/liveblog.rb +48 -25
- data/lib/post.rb +4 -3
- data/lib/publish.rb +3 -3
- data/lib/repl.rb +0 -8
- data/lib/runeblog.rb +8 -6
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +2 -1
- data/test/make_blog.rb +29 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1504fe8e39cd4ed6b42b0b6a9a8b1189d6a67b8b78c5e7a62031027f6ab10259
|
4
|
+
data.tar.gz: cfc166148ecf09d303e355fa2770b07f8affe79743fa5ad2d554f8d3411063d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3a7d4e429cd06e79bb213ed7fe79062117ba52d1a2238e55f2ed68ae88d23b0781190a7e27b7e3894650bbb1a79ebae33598f87ecd76368d4071fcd656296a
|
7
|
+
data.tar.gz: 4550b4d5f419d096b0ebf98574d7c6f8277bad4821730df88dbb8b404132f13fcf5bccb6b56e3cb7430c1ca19fe6c5562b6285470d6674f3c8bd7c65370d3ff3
|
data/empty_view.tgz
CHANGED
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -37,6 +37,27 @@ def backlink
|
|
37
37
|
_out %[<br><a href="javascript:history.go(-1)">[Back]</a>]
|
38
38
|
end
|
39
39
|
|
40
|
+
def dropcap
|
41
|
+
# Bad form: adds another HEAD
|
42
|
+
_out <<-HTML
|
43
|
+
<head>
|
44
|
+
<style>
|
45
|
+
p:first-child:first-letter {
|
46
|
+
color: #0000ff;
|
47
|
+
float: left;
|
48
|
+
font-family: Georgia;
|
49
|
+
font-size: 75px;
|
50
|
+
line-height: 60px;
|
51
|
+
padding-top: 4px;
|
52
|
+
padding-right: 8px;
|
53
|
+
padding-left: 3px;
|
54
|
+
}
|
55
|
+
</style>
|
56
|
+
</head>
|
57
|
+
HTML
|
58
|
+
_out " "
|
59
|
+
end
|
60
|
+
|
40
61
|
def quote
|
41
62
|
_passthru "<blockquote>"
|
42
63
|
_passthru _body
|
@@ -292,7 +313,7 @@ end
|
|
292
313
|
def recent_posts # side-effect
|
293
314
|
_out <<-HTML
|
294
315
|
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
|
295
|
-
<iframe id="main" style="width:
|
316
|
+
<iframe id="main" style="width: 70vw; height: 100vh; position: relative;"
|
296
317
|
src='recent.html' width=100% frameborder="0" allowfullscreen>
|
297
318
|
</iframe>
|
298
319
|
</div>
|
@@ -542,24 +563,17 @@ def _write_card(cardfile, mainfile, pairs, card_title, tag, relative: true)
|
|
542
563
|
local = _local_tag?(tag)
|
543
564
|
pairs.each do |file, title|
|
544
565
|
url = file
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
when
|
550
|
-
url_ref = "href='#{file}'"
|
551
|
-
when ["yes", true] # can iframe, local file
|
552
|
-
url_ref = _widget_card(file, tag)
|
553
|
-
when ["no", false] # CAN'T iframe, remote file
|
554
|
-
url_ref = _blank(file)
|
555
|
-
when ["no", true] # CAN'T iframe, local file (possible?)
|
556
|
-
url_ref = _blank(file)
|
566
|
+
type, title = page_type(tag, title)
|
567
|
+
case type
|
568
|
+
when :local; url_ref = _widget_main(file, tag) # local always frameable
|
569
|
+
when :frame; url_ref = _main(file) # remote, frameable
|
570
|
+
when :noframe; url_ref = _blank(file) # remote, not frameable
|
557
571
|
end
|
558
|
-
|
559
572
|
anchor = %[<a #{url_ref}>#{title}</a>]
|
560
573
|
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
561
574
|
f.puts wrapper
|
562
575
|
end
|
576
|
+
_include_file cardfile+".html"
|
563
577
|
f.puts <<-EOS
|
564
578
|
</div>
|
565
579
|
</div>
|
@@ -579,6 +593,20 @@ def _local_tag?(tag)
|
|
579
593
|
end
|
580
594
|
end
|
581
595
|
|
596
|
+
def page_type(tag, title)
|
597
|
+
yesno = "yes"
|
598
|
+
yesno, title = title.split(/, */) if title =~ /^[yes|no]/
|
599
|
+
local = _local_tag?(tag)
|
600
|
+
frameable = (yesno == "yes")
|
601
|
+
if local
|
602
|
+
return [:local, title]
|
603
|
+
elsif frameable
|
604
|
+
return [:frame, title]
|
605
|
+
else
|
606
|
+
return [:noframe, title]
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
582
610
|
def _write_main(mainfile, pairs, card_title, tag)
|
583
611
|
log!(str: "Creating #{mainfile}.html", pwd: true)
|
584
612
|
local = _local_tag?(tag)
|
@@ -586,17 +614,12 @@ def _write_main(mainfile, pairs, card_title, tag)
|
|
586
614
|
_html_body(f) do
|
587
615
|
f.puts "<h1>#{card_title}</h1>"
|
588
616
|
pairs.each do |file, title|
|
589
|
-
|
590
|
-
|
591
|
-
case
|
592
|
-
when
|
593
|
-
|
594
|
-
when
|
595
|
-
url_ref = _widget_main(file, tag)
|
596
|
-
when ["no", false] # CAN'T iframe, remote file
|
597
|
-
url_ref = _blank(file)
|
598
|
-
when ["no", true] # CAN'T iframe, local file (possible?)
|
599
|
-
url_ref = _blank(file)
|
617
|
+
type, title = page_type(tag, title)
|
618
|
+
title = title.gsub(/\\/, "") # kludge
|
619
|
+
case type
|
620
|
+
when :local; url_ref = _widget_main(file, tag) # local always frameable
|
621
|
+
when :frame; url_ref = "href = '#{file}'" # local always frameable
|
622
|
+
when :noframe; url_ref = _blank(file) # local always frameable
|
600
623
|
end
|
601
624
|
css = "color: #8888FF; text-decoration: none; font-size: 24px; font-family: verdana"
|
602
625
|
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
data/lib/post.rb
CHANGED
@@ -63,8 +63,8 @@ class RuneBlog::Post
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.create(title:, teaser:, body:, pubdate: Time.now.strftime("%Y-%m-%d"),
|
66
|
-
|
67
|
-
log!(enter: __method__, args: [title, teaser, body, pubdate,
|
66
|
+
views:[])
|
67
|
+
log!(enter: __method__, args: [title, teaser, body, pubdate, views])
|
68
68
|
post = self.new
|
69
69
|
# NOTE: This is the ONLY place next_sequence is called!
|
70
70
|
num = post.meta.num = post.blog.next_sequence
|
@@ -72,7 +72,8 @@ class RuneBlog::Post
|
|
72
72
|
# new_metadata
|
73
73
|
post.meta.title, post.meta.teaser, post.meta.body, post.meta.pubdate =
|
74
74
|
title, teaser, body, pubdate
|
75
|
-
post.meta.views = [post.blog.view.to_s] +
|
75
|
+
post.meta.views = [post.blog.view.to_s] + views
|
76
|
+
# STDERR.puts "Post.create: views = #{views.inspect}"
|
76
77
|
post.meta.tags = []
|
77
78
|
post.blog.make_slug(post.meta) # adds to meta
|
78
79
|
|
data/lib/publish.rb
CHANGED
@@ -39,7 +39,7 @@ class RuneBlog::Publishing
|
|
39
39
|
def url
|
40
40
|
log!(enter: __method__)
|
41
41
|
vname = @blog.view.name # .gsub(/_/, "\\_")
|
42
|
-
url = "#@proto://#@server/#@path/#{vname}"
|
42
|
+
url = "#@proto://#@server/#@path" # /#{vname}"
|
43
43
|
end
|
44
44
|
|
45
45
|
def system!(str)
|
@@ -52,11 +52,11 @@ class RuneBlog::Publishing
|
|
52
52
|
log!(enter: __method__, args: [files, assets])
|
53
53
|
dir = @docroot/@path
|
54
54
|
view_name = @blog.view.name
|
55
|
-
viewpath = dir/view_name
|
55
|
+
viewpath = dir # /view_name
|
56
56
|
# result = system!("ssh #@user@#@server -x mkdir -p #{viewpath}")
|
57
57
|
result = system!("ssh #@user@#@server -x mkdir -p #{viewpath}/assets")
|
58
58
|
files.each do |file|
|
59
|
-
dest = "#@user@#@server:" + dir/view_name
|
59
|
+
dest = "#@user@#@server:" + dir # /view_name
|
60
60
|
file.gsub!(/\/\//, "/") # weird... :-/
|
61
61
|
cmd = "scp -r #{file} #{dest} >/dev/null 2>/tmp/wtf"
|
62
62
|
debug "cmd = #{cmd.inspect} - see /tmp/wtf"
|
data/lib/repl.rb
CHANGED
@@ -91,26 +91,18 @@ module RuneBlog::REPL
|
|
91
91
|
|
92
92
|
def cmd_publish(arg, testing = false)
|
93
93
|
# Future Hal says please refactor this
|
94
|
-
STDERR.puts :CP1
|
95
94
|
puts unless testing
|
96
|
-
STDERR.puts :CP2
|
97
95
|
reset_output
|
98
|
-
STDERR.puts :CP3
|
99
96
|
check_empty(arg)
|
100
|
-
STDERR.puts :CP4
|
101
97
|
unless @blog.view.can_publish?
|
102
|
-
STDERR.puts :CP5
|
103
98
|
msg = "Can't publish... see globals.lt3"
|
104
99
|
puts msg unless testing
|
105
100
|
output! msg
|
106
101
|
return @out
|
107
102
|
end
|
108
103
|
|
109
|
-
STDERR.puts :CP6
|
110
104
|
# Need to check dirty/clean status first
|
111
105
|
dirty, all, assets = @blog.view.publishable_files
|
112
|
-
STDERR.puts [dirty, all, assets].inspect
|
113
|
-
sleep 8
|
114
106
|
files = dirty
|
115
107
|
if dirty.empty?
|
116
108
|
puts fx("\n No files are out of date." + " "*20, :bold)
|
data/lib/runeblog.rb
CHANGED
@@ -118,7 +118,7 @@ class RuneBlog
|
|
118
118
|
result = nil # not found
|
119
119
|
when 1
|
120
120
|
front = "#{key}: "
|
121
|
-
n = front.size
|
121
|
+
n = front.size
|
122
122
|
str = lines.first.chomp[n..-1]
|
123
123
|
case key
|
124
124
|
when "views", "tags" # plurals
|
@@ -297,7 +297,7 @@ class RuneBlog
|
|
297
297
|
id = slug.to_i
|
298
298
|
text = nil
|
299
299
|
post_entry_name = @theme/"blog/post_entry.lt3"
|
300
|
-
xlate src: post_entry_name, dst: "/tmp/post_entry.html", debug: true
|
300
|
+
xlate src: post_entry_name, dst: "/tmp/post_entry.html" # , debug: true
|
301
301
|
@_post_entry ||= File.read("/tmp/post_entry.html")
|
302
302
|
vp = post_lookup(id)
|
303
303
|
nslug, aslug, title, date, teaser_text =
|
@@ -336,12 +336,12 @@ class RuneBlog
|
|
336
336
|
File.write(@vdir/:remote/file, text)
|
337
337
|
end
|
338
338
|
|
339
|
-
def create_new_post(title, testing = false, teaser: nil, body: nil,
|
340
|
-
log!(enter: __method__, args: [title, testing, teaser, body,
|
339
|
+
def create_new_post(title, testing = false, teaser: nil, body: nil, views: [])
|
340
|
+
log!(enter: __method__, args: [title, testing, teaser, body, views])
|
341
341
|
meta = nil
|
342
|
-
|
342
|
+
views = views + [self.view.to_s]
|
343
343
|
Dir.chdir(@root/:posts) do
|
344
|
-
post = Post.create(title: title, teaser: teaser, body: body,
|
344
|
+
post = Post.create(title: title, teaser: teaser, body: body, views: views)
|
345
345
|
post.edit unless testing
|
346
346
|
post.build
|
347
347
|
meta = post.meta
|
@@ -401,6 +401,8 @@ STDERR.puts other_views.inspect
|
|
401
401
|
src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
|
402
402
|
xlate cwd: vdir/"themes/standard",
|
403
403
|
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
404
|
+
copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
|
405
|
+
|
404
406
|
end
|
405
407
|
|
406
408
|
def _get_views(draft)
|
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -41,7 +41,8 @@ class RuneBlog::View
|
|
41
41
|
vdir = dir()
|
42
42
|
remote = local_index()
|
43
43
|
files = [remote]
|
44
|
-
others = Dir.entries(vdir
|
44
|
+
others = Dir.entries(vdir/:remote) - %w[. ..]
|
45
|
+
others.map! {|x| "#{vdir}/remote/#{x}" }
|
45
46
|
|
46
47
|
assets = Dir.entries("#{vdir}/assets") - %w[. ..]
|
47
48
|
assets.map! {|x| "#{vdir}/assets/#{x}" }
|
data/test/make_blog.rb
CHANGED
@@ -29,7 +29,7 @@ end
|
|
29
29
|
|
30
30
|
def make_post(x, title, teaser, body, views=[])
|
31
31
|
debug " make_post #{bold(title)}"
|
32
|
-
x.create_new_post(title, true, teaser: teaser, body: body,
|
32
|
+
x.create_new_post(title, true, teaser: teaser, body: body, views: views)
|
33
33
|
views.each do |view|
|
34
34
|
debug
|
35
35
|
debug "** generate_index #{bold(view)}"
|
@@ -46,7 +46,7 @@ end
|
|
46
46
|
|
47
47
|
# "Main"...
|
48
48
|
|
49
|
-
puts
|
49
|
+
puts bold("\nGenerating test blog...")
|
50
50
|
|
51
51
|
system("rm -rf .blogs")
|
52
52
|
RuneBlog.create_new_blog_repo(".blogs")
|
@@ -116,8 +116,32 @@ x.change_view("around_austin")
|
|
116
116
|
make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
|
117
117
|
RIP, Hope Gallery
|
118
118
|
EXCERPT
|
119
|
+
.dropcap
|
120
|
+
|
119
121
|
It's been a while since I was there. They say it was torn down
|
120
122
|
while I wasn't looking.
|
123
|
+
|
124
|
+
This fake entry is a long one so as to demonstrate both drop-caps
|
125
|
+
(above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
|
126
|
+
a partridge in a pear tree.
|
127
|
+
|
128
|
+
Wherever you go, there you are. Last night I saw upon the stair
|
129
|
+
a little man who was not there. He wasn't there again today; I
|
130
|
+
wish, I wish he'd go away.
|
131
|
+
|
132
|
+
As far as we know, our computer has never had an undetected error.
|
133
|
+
And never let it be denied that pobbles are happier without their
|
134
|
+
toes. And may your snark never be a boojum.
|
135
|
+
|
136
|
+
Contact light. Houston, this is Tranquility Base. The Eagle has
|
137
|
+
landed. That's one small step for (a) man, one giant leap for
|
138
|
+
mankind.
|
139
|
+
.inset left 20
|
140
|
+
On a clean disk, you can seek forever.
|
141
|
+
.end
|
142
|
+
|
143
|
+
Pity this busy monster, manunkind, not. Pity rather... Listen:
|
144
|
+
There's a hell of a universe next door; let's go.
|
121
145
|
BODY
|
122
146
|
|
123
147
|
make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
|
@@ -145,5 +169,7 @@ BODY
|
|
145
169
|
debug
|
146
170
|
debug("** generate_view: #{bold('around_austin')}")
|
147
171
|
x.generate_view("around_austin")
|
172
|
+
x.change_view("around_austin")
|
173
|
+
|
174
|
+
puts bold("...finished.\n")
|
148
175
|
|
149
|
-
debug
|
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.
|
4
|
+
version: 0.2.32
|
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-
|
11
|
+
date: 2019-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|