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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23e1959e442066534a715efcc371a9c7d4cb41c7dda22727712b12b7b1eb90af
4
- data.tar.gz: fbf07c5d835d4981b0380ce774fdfb74edab699c16772e187776ba58a1aee152
3
+ metadata.gz: fbe879abcadc7c6f7efceb9e54c88606aafd090a9538c9942f8cd3afef9596da
4
+ data.tar.gz: d9a123366e021a55b8bdc5b55016e38f1f1b4107163bc570a5112d89c8084270
5
5
  SHA512:
6
- metadata.gz: 8caa7eeef62cb562df06f7e0b3e1fcbf025cabe1f98fcda83fc365a0ee0fa9d8ce70fca9a3c16514a8ce3c320296c234e96e358d45cf3481e2b0451772e8866a
7
- data.tar.gz: 01b1248e629516ab0c1857138807a27066f7b4e97be26024dd5e3365152d399e3e301fefcb864eb8e355546a5d5d6149f7c9851a345a3c8f09819099cd54c5bc
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
@@ -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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TRMNLP
4
- VERSION = '0.14.0'
4
+ VERSION = '0.14.1'
5
5
  end
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.0
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