Skip to content

Commit

Permalink
Fix dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Mar 24, 2023
1 parent 58f3db5 commit a8ff3e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 2 additions & 4 deletions _config-dev.yml
Original file line number Diff line number Diff line change
@@ -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]
11 changes: 9 additions & 2 deletions _plugins/jekyll-topic-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
}
Expand Down

0 comments on commit a8ff3e7

Please sign in to comment.