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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/zine/page.rb +21 -15
- data/lib/zine/post.rb +3 -3
- data/lib/zine/skeleton/source/templates/header_partial.erb +5 -2
- data/lib/zine/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c72d8eba392c259b5c9a7914da03137f9d85ad1a4aed6cd694401681ac5966b3
|
4
|
+
data.tar.gz: 0ac041d6c35d5608a81c2da8cb802d2aa3e324e5f16873a6069c4ef9e2060bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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, :
|
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
|
-
|
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:
|
35
|
-
links_array:
|
36
|
-
num_items_on_home:
|
37
|
-
site_author:
|
38
|
-
site_description:
|
39
|
-
site_name:
|
40
|
-
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:
|
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
|
129
|
-
|
130
|
-
|
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
|
-
|
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]}/#{
|
48
|
+
@formatted_data.uri = "#{page_data[:site_URL]}/#{file_path_str}"
|
49
49
|
TagData.new(page_data[:tags],
|
50
|
-
|
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="
|
12
|
-
|
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
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.
|
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
|
+
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:
|