From a8ff3e70b47a3f1fd262ec10a448f32056b561ab Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Fri, 24 Mar 2023 13:05:42 +0100 Subject: [PATCH] Fix dev builds --- _config-dev.yml | 6 ++---- _plugins/jekyll-topic-filter.rb | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/_config-dev.yml b/_config-dev.yml index 9eae4f616ed7e1..dbc25a51927d89 100644 --- a/_config-dev.yml +++ b/_config-dev.yml @@ -1,7 +1,5 @@ -# Exclude jekyll-scholar for speed -plugins: - - jekyll-feed - - jekyll-redirect-from +# Exclude jekyll-scholar, jekyll-feed, jekyll-redirect-from for speed +plugins: [] # include the fake scholar plugin to prevent "unknown tag" errors plugins_dir: [_plugins,_plugins_dev] diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb index c3322e2aa9c010..3b97daae8ebca5 100644 --- a/_plugins/jekyll-topic-filter.rb +++ b/_plugins/jekyll-topic-filter.rb @@ -307,6 +307,13 @@ def self.resolve_material(site, material) } end + # In dev configuration, this breaks for me. Not sure why config isn't available. + if not site.config.nil? and site.config.has_key? "url" + domain = "#{site.config['url']}#{site.config['baseurl']}" + else + domain = "/training-material/" + end + # Similar as above. workflows = Dir.glob("#{folder}/workflows/*.ga") # TODO: support gxformat2 if workflows.length > 0 @@ -323,11 +330,11 @@ def self.resolve_material(site, material) { "workflow" => wf, "tests" => Dir.glob("#{folder}/workflows/" + wf.gsub(/.ga/, '-test*')).length > 0, - "url" => "#{site.config['url']}#{site.config['baseurl']}/#{folder}/workflows/#{wf}", + "url" => "#{domain}/#{folder}/workflows/#{wf}", "path" => wf_path, "wfid" => wfid, "wfname" => wfname, - "trs_endpoint" => "#{site.config['url']}#{site.config['baseurl']}/#{trs}", + "trs_endpoint" => "#{domain}/#{trs}", "license" => license, "creators" => creators, }