perron 0.6.0 → 0.7.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/Gemfile.lock +1 -1
- data/README.md +0 -4
- data/lib/generators/perron/templates/initializer.rb.tt +4 -4
- data/lib/perron/configuration.rb +1 -1
- data/lib/perron/metatags.rb +7 -4
- data/lib/perron/site.rb +4 -2
- data/lib/perron/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab1fe5550ba3bfd474381303929b49e9dac552d2d086bcbeb79c0760ad59979
|
4
|
+
data.tar.gz: 4b64af0d6128def66419351d50f74dffc29e8c74b1cf6f00ec004dc122f426cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3490ff02b1c8612e99f6403d0db98008b88461dd73b430b3470623a33bd4bd5bdc2945ff61a7bae821e1ff1bbcd3ba9f707be86c28724807300cdf75f476493
|
7
|
+
data.tar.gz: 505b439b20f2dbc5d2310aa56d8b8bcd99b793ddf83395f5652be1814e598c26d3f2154cde99531ad79d621ef7377cb12ddc076677e233a54c96faa875ff4cbf
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,10 +26,6 @@ This creates an initializer:
|
|
26
26
|
```ruby
|
27
27
|
Perron.configure do |config|
|
28
28
|
config.site_name = "AppRefresher"
|
29
|
-
|
30
|
-
# Override the defaults (meta) title suffix
|
31
|
-
# Default: `— Perron.configuration.site_name`
|
32
|
-
# config.title_suffix = nil
|
33
29
|
end
|
34
30
|
```
|
35
31
|
|
@@ -11,12 +11,12 @@ Perron.configure do |config|
|
|
11
11
|
|
12
12
|
# config.default_url_options = {host: "apprefresher.com", protocol: "https", trailing_slash: true}
|
13
13
|
|
14
|
-
# Override the defaults (meta) title suffix
|
15
|
-
# Default: `— Perron.configuration.site_name`
|
16
|
-
# config.title_suffix = nil
|
17
|
-
|
18
14
|
# Set default meta values
|
19
15
|
# Examples:
|
20
16
|
# - `config.metadata.description = "AI-powered tool to keep your knowledge base articles images/screenshots and content up-to-date"`
|
21
17
|
# - `config.metadata.author = "Rails Designer"`
|
18
|
+
|
19
|
+
# Set meta title suffix
|
20
|
+
# config.metadata.title_suffix = nil
|
21
|
+
# config.metadata.title_separator = " — "
|
22
22
|
end
|
data/lib/perron/configuration.rb
CHANGED
@@ -23,7 +23,6 @@ module Perron
|
|
23
23
|
@config.include_root = false
|
24
24
|
|
25
25
|
@config.site_name = nil
|
26
|
-
@config.title_suffix = nil
|
27
26
|
|
28
27
|
@config.allowed_extensions = [".erb", ".md"]
|
29
28
|
@config.exclude_from_public = %w[assets storage]
|
@@ -36,6 +35,7 @@ module Perron
|
|
36
35
|
}
|
37
36
|
|
38
37
|
@config.metadata = ActiveSupport::OrderedOptions.new
|
38
|
+
@config.metadata.title_separator = " — "
|
39
39
|
end
|
40
40
|
|
41
41
|
def input = "app/content"
|
data/lib/perron/metatags.rb
CHANGED
@@ -29,7 +29,7 @@ module Perron
|
|
29
29
|
frontmatter = @resource&.metadata&.stringify_keys || {}
|
30
30
|
defaults = @config.metadata
|
31
31
|
|
32
|
-
title = frontmatter["title"] || defaults["title"] || @config.site_name
|
32
|
+
title = frontmatter["title"] || defaults["title"] || @config.site_name || Rails.application.name.underscore.camelize
|
33
33
|
description = frontmatter["description"] || defaults["description"]
|
34
34
|
author = frontmatter["author"] || defaults["author"]
|
35
35
|
image = frontmatter["image"] || defaults["image"]
|
@@ -59,9 +59,12 @@ module Perron
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def title_tag(content)
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
resource_title = content.to_s.strip
|
63
|
+
title_suffix = Perron.configuration.metadata.title_suffix&.strip
|
64
|
+
|
65
|
+
suffix = (title_suffix if title_suffix.present? && resource_title != title_suffix)
|
66
|
+
|
67
|
+
tag.title([resource_title, suffix].compact.join(Perron.configuration.metadata.title_separator))
|
65
68
|
end
|
66
69
|
|
67
70
|
def meta_tag(attributes)
|
data/lib/perron/site.rb
CHANGED
data/lib/perron/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rails Designer Developers
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.7.0
|
144
144
|
specification_version: 4
|
145
145
|
summary: Rails-based static site generator
|
146
146
|
test_files: []
|