zine 0.19.0 → 0.20.0

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: d01e24a10aef7862c7680b23ed3690761e11fea353dcba75860e10613c47c2aa
4
- data.tar.gz: e5bfdf23fe573be6be9974392536972c027e32e7606fcc4a99070ed20fd6de9e
3
+ metadata.gz: c72d8eba392c259b5c9a7914da03137f9d85ad1a4aed6cd694401681ac5966b3
4
+ data.tar.gz: 0ac041d6c35d5608a81c2da8cb802d2aa3e324e5f16873a6069c4ef9e2060bde
5
5
  SHA512:
6
- metadata.gz: a3deb89272c028b9c50771df629a25472770fd8e07d0ab54eaa820efe5a67f7860326746077723dc555176d34300eb0d645eefe2dcac13df307534727f0e8e66
7
- data.tar.gz: 057b9d63b71610d0ffb7756ddcd8e5d32d7916b48eddd299b138fbf39a920c237c48c9745c86cabada832b3484d1e4312877f82b58789a7693c3df649e9dafc2
6
+ metadata.gz: '004903591348d94c69026caec60e849cf071f180a63aaeb2c2481e7dbab731d3a4f0b32c1d9cb011ed3d9848dd6d15c41022aefebbc2e72a977c8d6989278d0e'
7
+ data.tar.gz: 9e720d20097b3219035d828c78f7bf2739c8938875401822550ebfe4e8350302ffe09d4056ce12355c83fb13c076b9ccaf45fc1fd8c037be91aa271009f4fd60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Zine Changelog
2
2
 
3
+ ## 0.20.0 - 5 December, 2023
4
+
5
+ - added Open Graph & canonical link tags - source/templates/header_partial.erb will need to be updated on your site
6
+ - added an extra 'git push' in the Rakefile, to push code changes as well as the tag
7
+ - expanded the meta data in the gemspec file
8
+
3
9
  ## 0.19.0 - 22 November, 2023
4
10
 
5
11
  - moved the repo from GitHub to Codeberg, changed the links in the README, gemspec, and skeleton files
data/lib/zine/page.rb CHANGED
@@ -15,32 +15,33 @@ module Zine
15
15
  # A page on the site where the content comes from a file's markdown, and the
16
16
  # destination's location mirrors its own
17
17
  class Page
18
- attr_accessor :source_file # used in zine notice --
18
+ attr_accessor :formatted_data, :source_file # used in zine notice --
19
19
  # PostsAndHeadlines.one_new_post
20
- attr_reader :dest_path, :formatted_data, :template_bundle
20
+ attr_reader :dest_path, :template_bundle
21
21
 
22
22
  # the meta data, passed formatted to the template
23
23
  class FormattedData
24
24
  include ERB::Util
25
25
 
26
- attr_accessor :data, :footer_partial, :header_partial, :html, :uri
26
+ attr_accessor :config, :data, :footer_partial, :header_partial, :html, :uri
27
27
  attr_reader :page
28
28
 
29
29
  def initialize(front_matter, site_opt)
30
- site = site_opt['options']
30
+ @config = site_opt
31
+ options = @config['options']
31
32
  @page = { date_rfc3339: front_matter['date'],
32
33
  date_rfc822: parse_822_date(front_matter['date']),
33
34
  date_us: parse_date(front_matter['date']),
34
- github_name: site['github_name'],
35
- links_array: site_opt['links'],
36
- num_items_on_home: site['num_items_on_home'],
37
- site_author: site['site_author'],
38
- site_description: site['site_description'],
39
- site_name: site['site_name'],
40
- site_URL: site['site_URL'],
35
+ github_name: options['github_name'],
36
+ links_array: @config['links'],
37
+ num_items_on_home: options['num_items_on_home'],
38
+ site_author: options['site_author'],
39
+ site_description: options['site_description'],
40
+ site_name: options['site_name'],
41
+ site_URL: options['site_URL'],
41
42
  tags: slugify_tags(front_matter['tags']),
42
43
  title: html_escape(front_matter['title']),
43
- twitter_name: site['twitter_name'],
44
+ twitter_name: options['twitter_name'],
44
45
  uri: '' } # uri only generated for posts, and not until after markdown, TO DO
45
46
  end
46
47
 
@@ -125,12 +126,17 @@ module Zine
125
126
  { 'date' => DateTime.now.to_s, 'title' => md_file_name, 'tags' => [] }
126
127
  end
127
128
 
128
- def rel_path_from_build_dir(path)
129
- full = Pathname(path)
130
- full.relative_path_from(Pathname(@build_dir))
129
+ def rel_path_str_from_build_dir
130
+ dest_file = Pathname.new(@dest_path)
131
+ build_dir = Pathname.new(@formatted_data.config['directories']['build'])
132
+ dest_file.relative_path_from(build_dir).to_s
131
133
  end
132
134
 
133
135
  def template_the_html
136
+ # kludge to fix in rewrite, path wasn't created until after data originally
137
+ @formatted_data.page[:uri] = URI.join(@formatted_data.page[:site_URL],
138
+ rel_path_str_from_build_dir).to_s
139
+
134
140
  data_binding = @formatted_data.public_binding
135
141
  @formatted_data.header_partial = @header_partial.result data_binding
136
142
  @formatted_data.footer_partial = @footer_partial.result data_binding
data/lib/zine/post.rb CHANGED
@@ -43,11 +43,11 @@ module Zine
43
43
 
44
44
  def tag_and_uri_subprocess
45
45
  page_data = @formatted_data.page
46
- file_path = rel_path_from_build_dir(@dest_path).to_s
46
+ file_path_str = rel_path_str_from_build_dir
47
47
  # URI.join will expect a root directory to start...
48
- @formatted_data.uri = "#{page_data[:site_URL]}/#{file_path}"
48
+ @formatted_data.uri = "#{page_data[:site_URL]}/#{file_path_str}"
49
49
  TagData.new(page_data[:tags],
50
- file_path,
50
+ file_path_str,
51
51
  page_data[:title],
52
52
  page_data[:date_rfc3339],
53
53
  page_data[:date_us])
@@ -8,8 +8,11 @@
8
8
  <link rel="home alternate" href="<%= page[:site_URL] %>/atom.xml" type="application/atom+xml" title="<%= page[:site_name] %>">
9
9
  <link rel="home alternate" href="<%= page[:site_URL] %>/rss.xml" type="application/rss+xml" title="<%= page[:site_name] %>">
10
10
  <link rel="stylesheet" href="/screen.css">
11
- <link rel="apple-touch-icon" href="/apple-touch-icon.png">
12
- <!--<link rel="canonical" href="<%= page[:uri] %>" />-->
11
+ <link rel="apple-touch-icon" href="<%= page[:site_URL] %>/apple-touch-icon.png">
12
+ <meta property="og:title" content="<%= page[:site_name] %> - <%= page[:title] %>" />
13
+ <meta property="og:url" content="<%= page[:uri] %>" />
14
+ <meta property="og:image" content="<%= page[:site_URL] %>/apple-touch-icon.png" />
15
+ <link rel="canonical" href="<%= page[:uri] %>">
13
16
  </head>
14
17
  <body>
15
18
  <div id="skiptocontent">
data/lib/zine/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Zine
4
4
  # The version
5
- VERSION = '0.19.0'
5
+ VERSION = '0.20.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kreuzer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-22 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudfront
@@ -248,7 +248,10 @@ homepage: https://codeberg.org/kreuzer/zine
248
248
  licenses:
249
249
  - AGPL-3.0-or-later
250
250
  metadata:
251
+ changelog_uri: https://codeberg.org/kreuzer/zine/src/branch/main/CHANGELOG.md
252
+ homepage_uri: https://codeberg.org/kreuzer/zine
251
253
  rubygems_mfa_required: 'true'
254
+ source_code_uri: https://codeberg.org/kreuzer/zine
252
255
  post_install_message:
253
256
  rdoc_options: []
254
257
  require_paths: