nanoc 4.12.19 → 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 +11 -3
- data/README.md +1 -1
- data/lib/nanoc/extra.rb +0 -1
- data/lib/nanoc/helpers/blogging.rb +1 -1
- data/lib/nanoc/helpers/breadcrumbs.rb +1 -1
- data/lib/nanoc/helpers/capturing.rb +1 -1
- 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/version.rb +1 -1
- data/lib/nanoc.rb +0 -1
- metadata +9 -10
- 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,13 @@
|
|
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
|
+
|
3
11
|
## 4.12.19 (2023-12-08)
|
4
12
|
|
5
13
|
Fixes:
|
@@ -1341,11 +1349,11 @@ Enhancements:
|
|
1341
1349
|
|
1342
1350
|
- Added several convenience methods to view classes (#570, #572)
|
1343
1351
|
|
1344
|
-
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.
|
1345
1353
|
|
1346
1354
|
## 4.0.0a1 (2015-05-09)
|
1347
1355
|
|
1348
|
-
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/).
|
1349
1357
|
|
1350
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.
|
1351
1359
|
|
@@ -2058,7 +2066,7 @@ Removed:
|
|
2058
2066
|
## 2.1 (2008-08-17)
|
2059
2067
|
|
2060
2068
|
This is only a short summary of all changes in 2.1. For details, see the
|
2061
|
-
[nanoc web site](https://nanoc.
|
2069
|
+
[nanoc web site](https://nanoc.app/). Especially the blog and the
|
2062
2070
|
updated manual will be useful.
|
2063
2071
|
|
2064
2072
|
New:
|
data/README.md
CHANGED
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/#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/#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,12 +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'
|
238
|
-
source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.
|
237
|
+
source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.20/nanoc
|
239
238
|
post_install_message:
|
240
239
|
rdoc_options: []
|
241
240
|
require_paths:
|
@@ -251,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
250
|
- !ruby/object:Gem::Version
|
252
251
|
version: '0'
|
253
252
|
requirements: []
|
254
|
-
rubygems_version: 3.
|
253
|
+
rubygems_version: 3.5.3
|
255
254
|
signing_key:
|
256
255
|
specification_version: 4
|
257
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
|