trmnl_preview 0.14.0 → 0.14.1
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 +4 -0
- data/README.md +1 -1
- data/lib/trmnlp/lint/checks/recipe_overview_length.rb +26 -0
- data/lib/trmnlp/lint/source.rb +1 -0
- data/lib/trmnlp/lint.rb +2 -0
- data/lib/trmnlp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fbe879abcadc7c6f7efceb9e54c88606aafd090a9538c9942f8cd3afef9596da
|
|
4
|
+
data.tar.gz: d9a123366e021a55b8bdc5b55016e38f1f1b4107163bc570a5112d89c8084270
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0cd3eb90f4a2231a28dfe8e08097a90bc0d70d93861f9decd1946708b77c0ddf4b5ba3e3dd1acbae0b1daac7238cb88ea74d9f504880adeb1ee7c6ac6402c774
|
|
7
|
+
data.tar.gz: fbd799614df7d3c978ca2a67fb1b7916b446994bfbd15ce268f764ad0dbd62fed7a34f6c8e63621926490a3eabece74d44b089f3175bd0ad305de7958cf622a1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
# Changelog
|
|
3
3
|
|
|
4
|
+
## 0.14.1
|
|
5
|
+
|
|
6
|
+
- `trmnlp lint` reports a `recipe_overview` under 100 words. Below that, TRMNL serves the public recipe page with `robots: noindex`, so the recipe never appears in Google or other search engines, and nothing said so: the page looked fine, and only its HTML gave it away. A blank overview still passes, since private plugins have none. (#144)
|
|
7
|
+
|
|
4
8
|
## 0.14.0
|
|
5
9
|
|
|
6
10
|
- `trmnlp serve` and `build` print what the transform writes to stdout and stderr (`console.log`, `print`, `puts`), one `transform stdout:` / `transform stderr:` line each, so a transform can be debugged without returning its logs in the data. (#128)
|
data/README.md
CHANGED
|
@@ -434,7 +434,7 @@ The `settings.yml` file is part of the plugin definition, and is uploaded and do
|
|
|
434
434
|
|
|
435
435
|
`description:` is an optional one-line summary of the plugin, up to 35 characters. `trmnlp lint` reports anything longer, and `trmnlp list` shows it next to each plugin name.
|
|
436
436
|
|
|
437
|
-
`recipe_overview:` is optional free text for a published recipe, with no length limit. TRMNL shows it on the public recipe page with its line breaks kept, and its first 120 characters feed the page's link preview. An overview of at least 100 words lets the recipe appear in Google and other search engines. Put credits and links in an About This Plugin field instead. Leave the key out to keep the overview already on TRMNL; an empty value clears it.
|
|
437
|
+
`recipe_overview:` is optional free text for a published recipe, with no length limit. TRMNL shows it on the public recipe page with its line breaks kept, and its first 120 characters feed the page's link preview. An overview of at least 100 words lets the recipe appear in Google and other search engines; `trmnlp lint` reports one that is shorter. Put credits and links in an About This Plugin field instead. Leave the key out to keep the overview already on TRMNL; an empty value clears it.
|
|
438
438
|
|
|
439
439
|
See [TRMNL documentation](https://help.trmnl.com/en/articles/10542599-importing-and-exporting-private-plugins#h_581fb988f0) for details on this file's contents.
|
|
440
440
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../check'
|
|
4
|
+
|
|
5
|
+
module TRMNLP
|
|
6
|
+
module Lint
|
|
7
|
+
module Checks
|
|
8
|
+
# Below this many words the hosted service serves the public recipe page
|
|
9
|
+
# with `robots: noindex`, so search engines drop it. The overview is
|
|
10
|
+
# optional (private plugins never show one), so a blank value passes.
|
|
11
|
+
# Words are counted on whitespace; there is no upstream count to match.
|
|
12
|
+
class RecipeOverviewLength < Check
|
|
13
|
+
MIN_WORDS = 100
|
|
14
|
+
MESSAGE = "Recipe overview should be at least #{MIN_WORDS} words long " \
|
|
15
|
+
'for the recipe page to appear in Google and other search engines.'.freeze
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def pass?
|
|
20
|
+
words = source.recipe_overview.split.size
|
|
21
|
+
words.zero? || words >= MIN_WORDS
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/trmnlp/lint/source.rb
CHANGED
|
@@ -17,6 +17,7 @@ module TRMNLP
|
|
|
17
17
|
|
|
18
18
|
def plugin_name = settings['name'].to_s
|
|
19
19
|
def plugin_description = settings['description'].to_s
|
|
20
|
+
def recipe_overview = settings['recipe_overview'].to_s
|
|
20
21
|
def settings = config.plugin.settings
|
|
21
22
|
def custom_field_values = config.project.custom_fields
|
|
22
23
|
def custom_field_definitions = config.plugin.custom_field_definitions
|
data/lib/trmnlp/lint.rb
CHANGED
|
@@ -5,6 +5,7 @@ require_relative 'lint/source'
|
|
|
5
5
|
require_relative 'lint/checks/title_casing'
|
|
6
6
|
require_relative 'lint/checks/title_length'
|
|
7
7
|
require_relative 'lint/checks/description_length'
|
|
8
|
+
require_relative 'lint/checks/recipe_overview_length'
|
|
8
9
|
require_relative 'lint/checks/layouts_have_content'
|
|
9
10
|
require_relative 'lint/checks/no_async_functions'
|
|
10
11
|
require_relative 'lint/checks/waits_for_dom_load'
|
|
@@ -25,6 +26,7 @@ module TRMNLP
|
|
|
25
26
|
Checks::TitleCasing,
|
|
26
27
|
Checks::TitleLength,
|
|
27
28
|
Checks::DescriptionLength,
|
|
29
|
+
Checks::RecipeOverviewLength,
|
|
28
30
|
Checks::LayoutsHaveContent,
|
|
29
31
|
Checks::NoAsyncFunctions,
|
|
30
32
|
Checks::WaitsForDomLoad,
|
data/lib/trmnlp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trmnl_preview
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.14.
|
|
4
|
+
version: 0.14.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rockwell Schrock
|
|
@@ -315,6 +315,7 @@ files:
|
|
|
315
315
|
- lib/trmnlp/lint/checks/no_async_functions.rb
|
|
316
316
|
- lib/trmnlp/lint/checks/no_opacity.rb
|
|
317
317
|
- lib/trmnlp/lint/checks/no_size_classes.rb
|
|
318
|
+
- lib/trmnlp/lint/checks/recipe_overview_length.rb
|
|
318
319
|
- lib/trmnlp/lint/checks/title_casing.rb
|
|
319
320
|
- lib/trmnlp/lint/checks/title_length.rb
|
|
320
321
|
- lib/trmnlp/lint/checks/waits_for_dom_load.rb
|