Skip to content

Commit

Permalink
Merge pull request #7 from ELIXIR-Belgium/no-pages
Browse files Browse the repository at this point in the history
Add support for repositories without pages dir
  • Loading branch information
bedroesb authored Jul 26, 2023
2 parents 5e39d91 + f2fdb2d commit a9aeed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/elixir-toolkit-theme-plugins/tool_table_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ def add_related_pages(data)

def load_page_data
@related_pages = {}
pages_path = File.join(Dir.pwd, "pages", "**", "*.md")
pages_path = File.join(Dir.pwd, "**", "*.md")
Dir.glob(pages_path).each do |f|
file = File.read(f)
page_id_matches = file.match(/page_id:\s*(\w+)/)

if page_id_matches
page_id = page_id_matches[1]
file.scan(/\{% tool "([^"]+)" %}/).flatten.each do |m|
file.scan(/\{%\s*tool\s*"([^"]+)"\s*%}/).flatten.each do |m|
@related_pages[m] = Set[] unless @related_pages[m]
@related_pages[m].add(page_id)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir-toolkit-theme-plugins/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Jekyll
class Ett
VERSION = '0.1.7'
VERSION = '0.1.8'
end
end

0 comments on commit a9aeed5

Please sign in to comment.