jekyll-vitepress-theme 1.12.0 → 1.12.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: 92fbcc13d3a8a09416bc7f3db061472ce56f96c9bb0957547950face3c740f32
4
- data.tar.gz: 97a7e1547607241f197b69346c47ddfbf5a85ad9a2ee30f61ba9e67aee361b59
3
+ metadata.gz: 44d2fd26511e4e91bc4e9e51c781e5839aaba113b98a41e14d5a41679d4579ab
4
+ data.tar.gz: 795966c63dc7e849ed693c405869780512f9d24142f63bf2826049d175e4b1c4
5
5
  SHA512:
6
- metadata.gz: 2903fdd47be94142d7b697490d082a918e50da8010fdb28d52ef2b7b2626153c020f0bd28c43cf6d22f2f0240058e9e41274fe78ea5c1cfb5a211f634d209596
7
- data.tar.gz: c0f453fb3e597ae5c42f8a63a6b0f34bab5bbdc0d7e08befe95d659322104e2582a2471bf2b5a916a2128465093bcc3d822aa368b4d729e3ceec246c2d34d922
6
+ metadata.gz: 0b9b662c2a541fc3b316a3b5a3f8753e648d68101a353833527799466888d360a140de8934027b32165a17f0232b19bbf739cd1cd0d7aa2a1ea97e1192953e9b
7
+ data.tar.gz: 8e57ceabe73f98152ab8a032856b8100981cfa087060a7747453e3bbf2715bb75cd86ab04dc50549444433a5f6798eec64d79a06d44177c7b9405016de92e28b
@@ -146,6 +146,7 @@ module Jekyll
146
146
  def robots_for(item, page_config, config)
147
147
  explicit = page_config['robots'] || item.data['robots']
148
148
  return clean_text(explicit) if explicit && explicit != true
149
+ return 'noindex,follow' if other_version_hidden?(item.site, config)
149
150
 
150
151
  site_index = !config.is_a?(Hash) || config.fetch('index', true) != false
151
152
  noindex = page_config['noindex'] == true || item.data['noindex'] == true || !site_index
@@ -540,6 +541,14 @@ module Jekyll
540
541
  nil
541
542
  end
542
543
 
544
+ # Next and older versions repeat most of the stable pages, so search
545
+ # engines should index only the stable docs unless the site opts in.
546
+ def other_version_hidden?(site, config)
547
+ return false if Versions.stable?(site)
548
+
549
+ !(config.is_a?(Hash) && config['index_versions'] == true)
550
+ end
551
+
543
552
  def sitemap_enabled?(config)
544
553
  config.fetch('index', true) != false && config.fetch('sitemap', true) != false
545
554
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module VitePressTheme
3
- VERSION = "1.12.0".freeze
3
+ VERSION = "1.12.1".freeze
4
4
  end
5
5
  end
@@ -296,13 +296,15 @@ module Jekyll
296
296
  end
297
297
 
298
298
  # Search engines find the stable sitemap through robots.txt; the other
299
- # versions' sitemaps are listed beside it.
299
+ # versions' sitemaps are listed beside it when they list any page, which
300
+ # they only do when `seo.index_versions` lets those versions be indexed.
300
301
  def list_sitemaps(versions)
301
302
  robots = File.join(destination, 'robots.txt')
302
303
  return unless File.file?(robots) && File.read(robots).match?(/^Sitemap:/)
303
304
 
304
305
  lines = versions.filter_map do |version|
305
- next unless File.file?(File.join(version.output, 'sitemap.xml'))
306
+ sitemap = File.join(version.output, 'sitemap.xml')
307
+ next unless File.file?(sitemap) && File.read(sitemap).include?('<loc>')
306
308
 
307
309
  "Sitemap: #{@site_url}#{baseurl}#{version.path}sitemap.xml"
308
310
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-vitepress-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino