Skip to content

Commit ad27426

Browse files
author
ebembi-crdb
committed
Clean up archive-v22.1 branch
- Remove debug file output.txt - Update sidebar_htmltest.rb to respect htmltest config and skip archived versions
1 parent e03339e commit ad27426

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/current/_plugins/sidebar_htmltest.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
require 'json'
22
require 'liquid'
3+
require 'yaml'
34

45
module SidebarHTMLTest
56
class Generator < Jekyll::Generator
67
def generate(site)
78
@site = site
89

10+
# Read htmltest configuration to get ignored directories
11+
htmltest_config = YAML.load_file('.htmltest.yml') rescue {}
12+
ignored_dirs = htmltest_config['IgnoreDirs'] || []
13+
14+
# Extract version numbers from ignored directories
15+
ignored_versions = ignored_dirs.map do |dir|
16+
match = dir.match(/\^?docs\/?(v\d+\.\d+)/)
17+
match[1] if match
18+
end.compact
19+
920
Dir[File.join(site.config['includes_dir'], 'sidebar-data-v*.json')].each do |f|
1021
next unless !!site.config['cockroachcloud'] == f.include?('cockroachcloud')
22+
23+
# Extract version from filename
24+
version = f.match(/sidebar-data-(v\d+\.\d+)/)[1]
25+
26+
# Skip if this version is in the ignored list
27+
if ignored_versions.include?(version)
28+
Jekyll.logger.info "SidebarHTMLTest:", "Skipping ignored version #{version}"
29+
next
30+
end
31+
1132
partial = site.liquid_renderer.file(f).parse(File.read(f))
1233
json = partial.render!(site.site_payload, {registers: {site: site}})
13-
version = f.match(/sidebar-data-(v\d+\.\d+)/)[1]
1434
render_sidebar(json, version)
1535
end
1636
end

src/current/output.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)