runeblog 0.2.44 → 0.2.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +4 -7
- data/empty_view/themes/standard/blog/post_entry.lt3 +11 -10
- data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
- data/empty_view/themes/standard/widgets/links/links.rb +28 -3
- data/empty_view/themes/standard/widgets/news/news.rb +7 -3
- data/empty_view/themes/standard/widgets/pages/pages.rb +7 -3
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
- data/empty_view/themes/standard/widgets/search/search.rb +7 -3
- data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
- data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
- data/lib/liveblog.rb +7 -3
- data/lib/repl.rb +1 -0
- data/lib/runeblog.rb +3 -2
- data/lib/runeblog_version.rb +1 -1
- data/test/austin.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8bb9a39d611dfe53e5ef484072a68b6c28791563469f591c0ed0b1f2af8d19b
|
4
|
+
data.tar.gz: 3280e0cec145361c3422de113d54f1c54fa617993c96010a06604f8a81f9b2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfa3e81153739ccbb5cbea452a33ba523141025df409cd2a33e55d03dd51b4c800a5e49e5fa102063dd71793187df5bed62e847e00bfa75b35dcbc35ed5c3ddf
|
7
|
+
data.tar.gz: 3b93280f1ac1a370d7ab7ff4f4c1fd28a4cba94af74ebdfb0fc59f21ea1081079786a39f8de9f75216205a256193e774bc379841e675e49600ca7748ed0e655b
|
data/bin/blog
CHANGED
@@ -16,10 +16,9 @@ def get_started
|
|
16
16
|
puts
|
17
17
|
puts fx(<<-TEXT, :bold)
|
18
18
|
Blog repo successfully created.
|
19
|
-
|
20
|
-
Create
|
21
|
-
|
22
|
-
via the config command.
|
19
|
+
For help, type h or help.
|
20
|
+
Create views with: new view
|
21
|
+
Create a post (within current view): new post
|
23
22
|
TEXT
|
24
23
|
end
|
25
24
|
|
@@ -55,9 +54,7 @@ if ! RuneBlog.exist?
|
|
55
54
|
print fx("\n No blog repo found. Create new one? (y/n): ", :bold)
|
56
55
|
response = gets.chomp
|
57
56
|
if response.downcase == "y"
|
58
|
-
|
59
|
-
view_name = gets.chomp
|
60
|
-
RuneBlog.create_new_blog_repo(view_name)
|
57
|
+
RuneBlog.create_new_blog_repo
|
61
58
|
get_started
|
62
59
|
else
|
63
60
|
exit
|
@@ -4,18 +4,19 @@
|
|
4
4
|
. --------------------------------------------------
|
5
5
|
|
6
6
|
<div class="post">
|
7
|
-
<table width=100
|
7
|
+
<table width=100% cellpadding=7>
|
8
8
|
<tr>
|
9
|
-
<td width=
|
10
|
-
<span class="post-date mt-1 mb-1">
|
11
|
-
<b>#{date}</b>
|
12
|
-
</span>
|
9
|
+
<td width=14% valign=top align=right style="margin-top: -1px;">
|
10
|
+
<!-- <span class="post-date mt-1 mb-1" style="margin-top: 3px; text-align: right"> -->
|
11
|
+
<font size=-1><b>#{date}</b></font>
|
12
|
+
<!-- </span> -->
|
13
13
|
</td>
|
14
|
-
<td>
|
15
|
-
|
16
|
-
<
|
17
|
-
<
|
18
|
-
<a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a
|
14
|
+
<td>
|
15
|
+
<!-- <span class="post-title-box"> -->
|
16
|
+
<span class="post-title-text"><a href="#{url}" style="margin-top: -5px">#{title}</a></span>
|
17
|
+
<b>#{teaser_text}</b>
|
18
|
+
<a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a>
|
19
|
+
<!-- </span> -->
|
19
20
|
</td>
|
20
21
|
</tr>
|
21
22
|
</table>
|
@@ -1,14 +1,39 @@
|
|
1
1
|
# Custom code for 'links' widget
|
2
2
|
|
3
|
+
require 'liveblog'
|
4
|
+
|
3
5
|
class ::RuneBlog::Widget
|
4
6
|
class Links
|
5
|
-
|
7
|
+
Type = "links"
|
8
|
+
|
9
|
+
def initialize(repo)
|
10
|
+
@blog = repo
|
11
|
+
end
|
12
|
+
|
13
|
+
def build
|
14
|
+
input = "list.data"
|
15
|
+
lines = File.readlines(input)
|
16
|
+
data = lines.map! {|x| x.chomp.split(/, */, 3) }
|
17
|
+
css = "* { font-family: verdana }"
|
18
|
+
card_title = "External Links" # FIXME
|
19
|
+
File.open("#{Type}-main.html", "w") do |f|
|
20
|
+
_html_body(f, css) do
|
21
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
22
|
+
url_ref = nil
|
23
|
+
data.each do |url, frameable, title|
|
24
|
+
url_ref = (frameable == "yes") ? "href = '#{url}'" : _blank(url)
|
25
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
|
26
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# remember -card also
|
6
31
|
end
|
7
32
|
|
8
|
-
def
|
33
|
+
def edit_menu
|
9
34
|
end
|
10
35
|
|
11
|
-
def
|
36
|
+
def refresh
|
12
37
|
end
|
13
38
|
end
|
14
39
|
end
|
@@ -4,7 +4,11 @@
|
|
4
4
|
|
5
5
|
class ::RuneBlog::Widget
|
6
6
|
class Pages
|
7
|
-
def
|
7
|
+
def initialize(repo)
|
8
|
+
@blog = repo
|
9
|
+
end
|
10
|
+
|
11
|
+
def build
|
8
12
|
# build child pages
|
9
13
|
children = Dir["*.lt3"] - ["pages.lt3"]
|
10
14
|
children.each do |child|
|
@@ -15,10 +19,10 @@ class ::RuneBlog::Widget
|
|
15
19
|
# build cardfile
|
16
20
|
end
|
17
21
|
|
18
|
-
def
|
22
|
+
def edit_menu
|
19
23
|
end
|
20
24
|
|
21
|
-
def
|
25
|
+
def refresh
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
data/lib/liveblog.rb
CHANGED
@@ -375,9 +375,13 @@ def sidebar
|
|
375
375
|
tcard = "#{tag}-card.html"
|
376
376
|
|
377
377
|
code = _load_local(tag)
|
378
|
-
if code
|
379
|
-
|
380
|
-
|
378
|
+
if code
|
379
|
+
if ["pages", "links"].include? tag
|
380
|
+
Dir.chdir(wtag) do
|
381
|
+
widget = code.new(@blog)
|
382
|
+
widget.build
|
383
|
+
end
|
384
|
+
end
|
381
385
|
end
|
382
386
|
|
383
387
|
if tag == "ad"
|
data/lib/repl.rb
CHANGED
data/lib/runeblog.rb
CHANGED
@@ -336,12 +336,13 @@ 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,
|
339
|
+
def create_new_post(title, testing = false, teaser: nil, body: nil,
|
340
|
+
pubdate: Time.now.strftime("%Y-%m-%d"), views: [])
|
340
341
|
log!(enter: __method__, args: [title, testing, teaser, body, views], level: 1)
|
341
342
|
meta = nil
|
342
343
|
views = views + [self.view.to_s]
|
343
344
|
Dir.chdir(@root/:posts) do
|
344
|
-
post = Post.create(title: title, teaser: teaser, body: body, views: views)
|
345
|
+
post = Post.create(title: title, teaser: teaser, body: body, pubdate: pubdate, views: views)
|
345
346
|
post.edit unless testing
|
346
347
|
post.build
|
347
348
|
meta = post.meta
|
data/lib/runeblog_version.rb
CHANGED
data/test/austin.rb
CHANGED
@@ -4,7 +4,9 @@ major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
|
4
4
|
ver = major.to_i*10 + minor.to_i
|
5
5
|
abort "Need Ruby 2.4 or greater" unless ver >= 24
|
6
6
|
|
7
|
-
Home = Dir.pwd
|
7
|
+
# Home = Dir.pwd
|
8
|
+
|
9
|
+
require 'date'
|
8
10
|
|
9
11
|
require 'global'
|
10
12
|
require 'runeblog'
|
@@ -27,9 +29,14 @@ def debug(str = "")
|
|
27
29
|
STDERR.puts "#{'%-11s' % time} #{str}"
|
28
30
|
end
|
29
31
|
|
32
|
+
@fake_date = Date.today - 20
|
33
|
+
|
30
34
|
def make_post(x, title, teaser, body, views=[])
|
31
35
|
debug " make_post #{bold(title)}"
|
32
|
-
|
36
|
+
pubdate = @fake_date.strftime("%Y-%m-%d")
|
37
|
+
@fake_date += (rand(2) + 1)
|
38
|
+
x.create_new_post(title, true, teaser: teaser, body: body, views: views,
|
39
|
+
pubdate: pubdate)
|
33
40
|
end
|
34
41
|
|
35
42
|
def show_lines(text)
|