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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0b81363110b0cb0392e016c289ee76b841d05a2d4ed2167ce26b9f08bb2e1ae
4
- data.tar.gz: c57eedabc749e9bee009dd3dc68c9f5ad8f430ae858ff6e307b027cd90fbf147
3
+ metadata.gz: a8bb9a39d611dfe53e5ef484072a68b6c28791563469f591c0ed0b1f2af8d19b
4
+ data.tar.gz: 3280e0cec145361c3422de113d54f1c54fa617993c96010a06604f8a81f9b2d3
5
5
  SHA512:
6
- metadata.gz: 20a947a5d88018aa3a9942b559cba915f15c733120ffbdd46433e50ea018bd9997184a194220a530882c9bcfab818a364c141b3ba62a4d36411b4241617521b4
7
- data.tar.gz: '019e9d9fbff78f670ea225014e3ec9208aa9fb0fd31fbc4241262d9f4ed39c365f5be14c6d3439e9bb996a9cea568ef81ddd1b1a41ad369b14279339160f91a8'
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
- You can create views with the command: new view
20
- Create a post within the current view: new post
21
- You can't publish until you set up the publish file
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
- print fx("\n Enter default view name: ", :bold)
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=12% valign=top>
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> <!-- <span class="post-title-box"> -->
15
- <span class="post-title-text"><a href="#{url}">#{title}</a></span>
16
- <b>#{teaser_text}</b>
17
- <br>
18
- <a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a></p> <!-- </span> -->
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>&nbsp;&nbsp;
18
+ <a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a>
19
+ <!-- </span> -->
19
20
  </td>
20
21
  </tr>
21
22
  </table>
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Bydates
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -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
- def self.build
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 self.edit_menu
33
+ def edit_menu
9
34
  end
10
35
 
11
- def self.refresh
36
+ def refresh
12
37
  end
13
38
  end
14
39
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class News
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -4,7 +4,11 @@
4
4
 
5
5
  class ::RuneBlog::Widget
6
6
  class Pages
7
- def self.build
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 self.edit_menu
22
+ def edit_menu
19
23
  end
20
24
 
21
- def self.refresh
25
+ def refresh
22
26
  end
23
27
  end
24
28
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Pinned
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Search
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class Sitemap
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@
2
2
 
3
3
  class ::RuneBlog::Widget
4
4
  class TagCloud
5
- def self.build
5
+ def initialize(repo)
6
+ @blog = repo
6
7
  end
7
8
 
8
- def self.edit_menu
9
+ def build
9
10
  end
10
11
 
11
- def self.refresh
12
+ def edit_menu
13
+ end
14
+
15
+ def refresh
12
16
  end
13
17
  end
14
18
  end
@@ -375,9 +375,13 @@ def sidebar
375
375
  tcard = "#{tag}-card.html"
376
376
 
377
377
  code = _load_local(tag)
378
- if code && tag == "pages"
379
- Dir.chdir(wtag) { code.build }
380
- else
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"
@@ -144,6 +144,7 @@ module RuneBlog::REPL
144
144
  check_empty(arg)
145
145
  puts unless testing
146
146
  @blog.generate_view(@blog.view)
147
+ @blog.generate_index(@blog.view)
147
148
  @out
148
149
  end
149
150
 
@@ -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, views: [])
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
@@ -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.44"
5
+ VERSION = "0.2.45"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -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
- x.create_new_post(title, true, teaser: teaser, body: body, views: views)
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)
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.2.44
4
+ version: 0.2.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton