nanoc 4.12.18 → 4.12.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +25 -3
- data/README.md +1 -1
- data/lib/nanoc/data_sources/filesystem/parser.rb +1 -2
- data/lib/nanoc/data_sources/filesystem.rb +1 -3
- data/lib/nanoc/extra.rb +0 -1
- data/lib/nanoc/helpers/blogging.rb +3 -3
- data/lib/nanoc/helpers/breadcrumbs.rb +1 -1
- data/lib/nanoc/helpers/capturing.rb +3 -3
- data/lib/nanoc/helpers/child_parent.rb +1 -1
- data/lib/nanoc/helpers/filtering.rb +1 -1
- data/lib/nanoc/helpers/html_escape.rb +1 -1
- data/lib/nanoc/helpers/link_to.rb +1 -1
- data/lib/nanoc/helpers/rendering.rb +1 -1
- data/lib/nanoc/helpers/tagging.rb +1 -1
- data/lib/nanoc/helpers/text.rb +1 -1
- data/lib/nanoc/helpers/xml_sitemap.rb +1 -1
- data/lib/nanoc/rule_dsl/compilation_rule_context.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/lib/nanoc.rb +0 -1
- metadata +9 -9
- data/lib/nanoc/extra/link_collector.rb +0 -131
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f4f1156179e5c1fc63d9d2a7eb8539d41f3f2141fa1109027935cd7191f6e6
|
4
|
+
data.tar.gz: e80a883c6c173dd2c767539ecbf060b30f0a41e23dfaaa028cb00037c80819a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54f4bc19b599bb1223fedce0c505896c6554596ee8a110f1f171b9cddc6faa1ca5a72f675e8a404483c250e897da0ca85347280c96f48fe3c13cb1e093bd3ddb
|
7
|
+
data.tar.gz: 4605c0f855c3cdb3b1d352089087eb6a1ddbfc333fe3b11e77b7ddb3d6a8313f92cf8c20c93d22ea23887af8afa9b71d743c1bfe8852dd6f394a17b933e80fc9
|
data/NEWS.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.12.20 (2024-03-15)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
- Add base64 as a gem dependency (#1681)
|
8
|
+
- Specify pry as one of nanoc-cli's runtime dependencies (#1679) [Junichi Sato]
|
9
|
+
- Add `org` extension (for Org Mode) to list of text file extensions (#1688) [Antar]
|
10
|
+
|
11
|
+
## 4.12.19 (2023-12-08)
|
12
|
+
|
13
|
+
Fixes:
|
14
|
+
|
15
|
+
- Restored support for YAML aliases (#1677) [zor-el]
|
16
|
+
- Fixed inadvertent reference to `Nanoc::` namespace from within `nanoc-cli` gem (#1673)
|
17
|
+
|
18
|
+
Enhancements:
|
19
|
+
|
20
|
+
- Made the default Rules file use `#passthrough` (#1668) [Hendrik Jäger]
|
21
|
+
- Added support for slim 5.x (#1675)
|
22
|
+
- Added support for psych 5.x (#1674)
|
23
|
+
- Added `source_code_uri` metadata to gemspecs (#1669) [Junichi Sato]
|
24
|
+
|
3
25
|
## 4.12.18 (2023-10-15)
|
4
26
|
|
5
27
|
Fixes:
|
@@ -1327,11 +1349,11 @@ Enhancements:
|
|
1327
1349
|
|
1328
1350
|
- Added several convenience methods to view classes (#570, #572)
|
1329
1351
|
|
1330
|
-
See the [nanoc 4 upgrade guide](https://nanoc.
|
1352
|
+
See the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/) for details.
|
1331
1353
|
|
1332
1354
|
## 4.0.0a1 (2015-05-09)
|
1333
1355
|
|
1334
|
-
This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.
|
1356
|
+
This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/).
|
1335
1357
|
|
1336
1358
|
This release provides no new features, but streamlines the API and functionality, in order to easen future development, both for features and for optimisations.
|
1337
1359
|
|
@@ -2044,7 +2066,7 @@ Removed:
|
|
2044
2066
|
## 2.1 (2008-08-17)
|
2045
2067
|
|
2046
2068
|
This is only a short summary of all changes in 2.1. For details, see the
|
2047
|
-
[nanoc web site](https://nanoc.
|
2069
|
+
[nanoc web site](https://nanoc.app/). Especially the blog and the
|
2048
2070
|
updated manual will be useful.
|
2049
2071
|
|
2050
2072
|
New:
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
class Nanoc::DataSources::Filesystem
|
5
5
|
class Parser
|
6
6
|
SEPARATOR = /(-{5}|-{3})/.source
|
7
|
-
PERMITTED_YAML_CLASSES = Nanoc::Core::ConfigLoader::PERMITTED_YAML_CLASSES
|
8
7
|
|
9
8
|
class ParseResult
|
10
9
|
attr_reader :content
|
@@ -61,7 +60,7 @@ class Nanoc::DataSources::Filesystem
|
|
61
60
|
# @return [Hash]
|
62
61
|
def parse_metadata(data, filename)
|
63
62
|
begin
|
64
|
-
meta =
|
63
|
+
meta = Nanoc::Core::YamlLoader.load(data) || {}
|
65
64
|
rescue => e
|
66
65
|
raise Errors::UnparseableMetadata.new(filename, e)
|
67
66
|
end
|
@@ -48,8 +48,6 @@ module Nanoc::DataSources
|
|
48
48
|
#
|
49
49
|
# @api private
|
50
50
|
class Filesystem < Nanoc::DataSource
|
51
|
-
PERMITTED_YAML_CLASSES = Nanoc::Core::ConfigLoader::PERMITTED_YAML_CLASSES
|
52
|
-
|
53
51
|
class AmbiguousMetadataAssociationError < ::Nanoc::Core::Error
|
54
52
|
def initialize(content_filenames, meta_filename)
|
55
53
|
super("There are multiple content files (#{content_filenames.sort.join(', ')}) that could match the file containing metadata (#{meta_filename}).")
|
@@ -154,7 +152,7 @@ module Nanoc::DataSources
|
|
154
152
|
is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..])
|
155
153
|
|
156
154
|
if is_binary && klass == Nanoc::Core::Item
|
157
|
-
meta = (meta_filename &&
|
155
|
+
meta = (meta_filename && Nanoc::Core::YamlLoader.load_file(meta_filename)) || {}
|
158
156
|
|
159
157
|
ProtoDocument.new(is_binary: true, filename: content_filename, attributes: meta)
|
160
158
|
elsif is_binary && klass == Nanoc::Core::Layout
|
data/lib/nanoc/extra.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
# @see https://nanoc.
|
4
|
+
# @see https://nanoc.app/doc/reference/helpers/#blogging
|
5
5
|
module Blogging
|
6
6
|
# @return [Array]
|
7
7
|
def articles
|
@@ -120,8 +120,8 @@ module Nanoc::Helpers
|
|
120
120
|
xml.updated(updated.__nanoc_to_iso8601_time)
|
121
121
|
|
122
122
|
# Add links
|
123
|
-
xml.link(rel: 'alternate', href:
|
124
|
-
xml.link(rel: 'self', href: feed_url,
|
123
|
+
xml.link(rel: 'alternate', href: alt_link || root_url, type: 'text/html')
|
124
|
+
xml.link(rel: 'self', href: feed_url, type: 'application/atom+xml')
|
125
125
|
|
126
126
|
# Add author information
|
127
127
|
xml.author do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
# @see https://nanoc.
|
4
|
+
# @see https://nanoc.app/doc/reference/helpers/#breadcrumbs
|
5
5
|
module Breadcrumbs
|
6
6
|
class AmbiguousAncestorError < ::Nanoc::Core::Error
|
7
7
|
def initialize(pattern, items)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
# @see https://nanoc.
|
4
|
+
# @see https://nanoc.app/doc/reference/helpers/#capturing
|
5
5
|
module Capturing
|
6
6
|
# @api private
|
7
7
|
class SetContent
|
@@ -22,7 +22,7 @@ module Nanoc::Helpers
|
|
22
22
|
# Get existing contents and prep for store
|
23
23
|
compiled_content_store = @item._context.compiled_content_store
|
24
24
|
rep = @item.reps[:default]._unwrap
|
25
|
-
capture_name = "__capture_#{@name}"
|
25
|
+
capture_name = :"__capture_#{@name}"
|
26
26
|
old_content_string =
|
27
27
|
case existing_behavior
|
28
28
|
when :overwrite
|
@@ -74,7 +74,7 @@ module Nanoc::Helpers
|
|
74
74
|
end
|
75
75
|
|
76
76
|
compiled_content_store = @config._context.compiled_content_store
|
77
|
-
content = compiled_content_store.get(rep, "__capture_#{@name}"
|
77
|
+
content = compiled_content_store.get(rep, :"__capture_#{@name}")
|
78
78
|
content&.string
|
79
79
|
end
|
80
80
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
# @see https://nanoc.
|
4
|
+
# @see https://nanoc.app/doc/reference/helpers/#filtering
|
5
5
|
module HTMLEscape
|
6
6
|
require 'nanoc/helpers/capturing'
|
7
7
|
include Nanoc::Helpers::Capturing
|
data/lib/nanoc/helpers/text.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nanoc::Helpers
|
4
|
-
# @see https://nanoc.
|
4
|
+
# @see https://nanoc.app/doc/reference/helpers/#xmlsitemap
|
5
5
|
module XMLSitemap
|
6
6
|
# @option params [Array] :items
|
7
7
|
# @option params [Proc] :rep_select
|
data/lib/nanoc/version.rb
CHANGED
data/lib/nanoc.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.12.
|
4
|
+
version: 4.12.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -64,28 +64,28 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - '='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 4.12.
|
67
|
+
version: 4.12.20
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - '='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 4.12.
|
74
|
+
version: 4.12.20
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: nanoc-core
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - '='
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 4.12.
|
81
|
+
version: 4.12.20
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 4.12.
|
88
|
+
version: 4.12.20
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: nanoc-deploying
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +166,6 @@ files:
|
|
166
166
|
- lib/nanoc/extra/core_ext.rb
|
167
167
|
- lib/nanoc/extra/core_ext/time.rb
|
168
168
|
- lib/nanoc/extra/jruby_nokogiri_warner.rb
|
169
|
-
- lib/nanoc/extra/link_collector.rb
|
170
169
|
- lib/nanoc/extra/srcset_parser.rb
|
171
170
|
- lib/nanoc/filters.rb
|
172
171
|
- lib/nanoc/filters/asciidoc.rb
|
@@ -230,11 +229,12 @@ files:
|
|
230
229
|
- lib/nanoc/rule_dsl/rules_collection.rb
|
231
230
|
- lib/nanoc/rule_dsl/rules_loader.rb
|
232
231
|
- lib/nanoc/version.rb
|
233
|
-
homepage: https://nanoc.
|
232
|
+
homepage: https://nanoc.app/
|
234
233
|
licenses:
|
235
234
|
- MIT
|
236
235
|
metadata:
|
237
236
|
rubygems_mfa_required: 'true'
|
237
|
+
source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.20/nanoc
|
238
238
|
post_install_message:
|
239
239
|
rdoc_options: []
|
240
240
|
require_paths:
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
|
-
rubygems_version: 3.
|
253
|
+
rubygems_version: 3.5.3
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: A static-site generator with a focus on flexibility.
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ::Nanoc::Extra
|
4
|
-
# @api private
|
5
|
-
class LinkCollector
|
6
|
-
# HTML5 element attributes
|
7
|
-
URI_ATTRS = {
|
8
|
-
'a' => %i[href ping],
|
9
|
-
'area' => %i[href ping],
|
10
|
-
'audio' => %i[src],
|
11
|
-
'base' => %i[href],
|
12
|
-
'blockquote' => %i[cite],
|
13
|
-
'form' => %i[action],
|
14
|
-
'iframe' => %i[src],
|
15
|
-
'img' => %i[src srcset],
|
16
|
-
'link' => %i[href],
|
17
|
-
'object' => %i[data],
|
18
|
-
'script' => %i[src],
|
19
|
-
'source' => %i[src srcset],
|
20
|
-
'video' => %i[poster src],
|
21
|
-
}.freeze
|
22
|
-
# HTML+RDFa global URI attributes
|
23
|
-
GLOBAL_ATTRS = %i[about resource].freeze
|
24
|
-
|
25
|
-
def initialize(filenames, mode = nil)
|
26
|
-
Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
|
27
|
-
|
28
|
-
@filenames = filenames
|
29
|
-
@filter =
|
30
|
-
case mode
|
31
|
-
when nil
|
32
|
-
->(_h) { true }
|
33
|
-
when :external
|
34
|
-
->(h) { external_href?(h) }
|
35
|
-
when :internal
|
36
|
-
->(h) { internal_href?(h) }
|
37
|
-
else
|
38
|
-
raise ArgumentError, 'Expected mode argument to be :internal, :external or nil'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def filenames_per_href
|
43
|
-
grouped_filenames { |filename| hrefs_in_file(filename) }
|
44
|
-
end
|
45
|
-
|
46
|
-
def filenames_per_resource_uri
|
47
|
-
grouped_filenames { |filename| resource_uris_in_file(filename) }
|
48
|
-
end
|
49
|
-
|
50
|
-
def external_href?(href)
|
51
|
-
return false if internal_href?(href)
|
52
|
-
|
53
|
-
href =~ %r{^(//|[a-z-]+:)}
|
54
|
-
end
|
55
|
-
|
56
|
-
def internal_href?(href)
|
57
|
-
return false if href.nil?
|
58
|
-
|
59
|
-
href.start_with?('file:/')
|
60
|
-
end
|
61
|
-
|
62
|
-
# all links
|
63
|
-
def hrefs_in_file(filename)
|
64
|
-
uris_in_file filename, nil
|
65
|
-
end
|
66
|
-
|
67
|
-
# embedded resources, used by the mixed-content checker
|
68
|
-
def resource_uris_in_file(filename)
|
69
|
-
uris_in_file filename, %w[audio base form iframe img link object script source video]
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
def grouped_filenames
|
75
|
-
require 'nokogiri'
|
76
|
-
grouped_filenames = {}
|
77
|
-
@filenames.each do |filename|
|
78
|
-
yield(filename).each do |resouce_uri|
|
79
|
-
grouped_filenames[resouce_uri] ||= Set.new
|
80
|
-
grouped_filenames[resouce_uri] << filename
|
81
|
-
end
|
82
|
-
end
|
83
|
-
grouped_filenames
|
84
|
-
end
|
85
|
-
|
86
|
-
def uris_in_file(filename, tag_names)
|
87
|
-
uris = Set.new
|
88
|
-
base_uri = URI("file://#{filename}")
|
89
|
-
doc = Nokogiri::HTML(::File.read(filename))
|
90
|
-
doc.traverse do |tag|
|
91
|
-
next unless tag_names.nil? || tag_names.include?(tag.name)
|
92
|
-
|
93
|
-
attrs = []
|
94
|
-
attrs += URI_ATTRS[tag.name] unless URI_ATTRS[tag.name].nil?
|
95
|
-
attrs += GLOBAL_ATTRS if tag_names.nil?
|
96
|
-
next if attrs.nil?
|
97
|
-
|
98
|
-
attrs.each do |attr_name|
|
99
|
-
next if tag[attr_name].nil?
|
100
|
-
|
101
|
-
if attr_name == :srcset
|
102
|
-
uris = uris.merge(tag[attr_name].split(',').map { |v| v.strip.split[0].strip }.compact)
|
103
|
-
elsif %i[about ping resource].include?(attr_name)
|
104
|
-
uris = uris.merge(tag[attr_name].split.map(&:strip).compact)
|
105
|
-
else
|
106
|
-
uris << tag[attr_name.to_s]
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# Strip fragment
|
112
|
-
uris.map! { |uri| uri.gsub(/#.*$/, '') }
|
113
|
-
|
114
|
-
# Resolve paths relative to the filename, return invalid URIs as-is
|
115
|
-
uris.map! do |uri|
|
116
|
-
if uri.start_with?('//')
|
117
|
-
# Don’t modify protocol-relative URLs. They’re absolute!
|
118
|
-
uri
|
119
|
-
else
|
120
|
-
begin
|
121
|
-
URI.join(base_uri, uri).to_s
|
122
|
-
rescue
|
123
|
-
uri
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
uris.select(&@filter)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|