Skip to content

Commit

Permalink
Add unpublished info pages to the scraper page to have their previews
Browse files Browse the repository at this point in the history
  • Loading branch information
octopusinvitro committed Apr 18, 2017
1 parent 07e3980 commit 71e7098
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@
@posts = finder.find_previews
finder = Document::Finder.new(pattern: events_pattern, baseurl: '/events/')
@events = finder.find_previews
finder = Document::Finder.new(pattern: "#{info_dir}/*.md", baseurl: '/info/')
@infopages = finder.find_previews
erb :scraper_start_page, layout: false
end
1 change: 1 addition & 0 deletions tests/web/unlinked_pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
get '/scraper-start-page.html'
refute_empty(subject.xpath('//a[contains(@href, "/blog/")]'))
refute_empty(subject.xpath('//a[contains(@href, "/events/")]'))
refute_empty(subject.xpath('//a[contains(@href, "/info/") and not(contains(@href, "events"))][1]'))
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions views/scraper_start_page.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
<p><a href="<%= event.url %>">Unlinked event - <%= event.title %></a></p>
<% end %>

<% @infopages.each do |infopage| %>
<p><a href="<%= infopage.url %>">Unlinked infopage - <%= infopage.title %></a></p>
<% end %>

0 comments on commit 71e7098

Please sign in to comment.