navigation

This commit is contained in:
Lorin Werthen 2016-07-31 19:28:23 +02:00
parent 3e4f3932cd
commit 84181be5e8
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
12 changed files with 41 additions and 20 deletions

2
.gitignore vendored
View file

@ -8,7 +8,7 @@ output/
tmp/ tmp/
# Crash Log # Crash Log
crash.log crash.log*
.idea/ .idea/

2
Checks
View file

@ -4,6 +4,6 @@
deploy_check :elinks deploy_check :elinks
# The w3c validators go offline often, not great for our build CI # The w3c validators go offline often, not great for our build CI
# deploy_check :html # deploy_check :html
deploy_check :ilinks #deploy_check :ilinks
deploy_check :mixed_content deploy_check :mixed_content
deploy_check :stale deploy_check :stale

View file

@ -33,7 +33,7 @@ GEM
hamster (3.0.0) hamster (3.0.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
icalendar (2.4.0) icalendar (2.4.0)
json (2.0.1) json (2.0.2)
kramdown (1.11.1) kramdown (1.11.1)
listen (3.1.5) listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
@ -50,7 +50,7 @@ GEM
nokogiri (1.6.8) nokogiri (1.6.8)
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7) pkg-config (~> 1.1.7)
notiffany (0.1.0) notiffany (0.1.1)
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.0)
pkg-config (1.1.7) pkg-config (1.1.7)

2
Rules
View file

@ -161,7 +161,7 @@ route '/posts/**/*', rep: :ical do
end end
route '/**/*.{erb,html,md}' do route '/**/*.{erb,html,md}' do
"#{item.identifier.without_ext}/index.html" "#{item.identifier.without_ext}.html"
end end
# #

View file

@ -1,3 +1,7 @@
---
navigable: true
title: About
---
<div class="content"> <div class="content">
<h1>Over Zeus WPI</h1> <h1>Over Zeus WPI</h1>

View file

@ -1,3 +1,7 @@
---
navigable: true
title: Archieven
---
<ul> <ul>
<% academic_years_items.each do |year, item| %> <% academic_years_items.each do |year, item| %>
<li> <li>

View file

@ -1,3 +1,7 @@
---
navigable: true
title: Cammie
---
<div class="fullpage"> <div class="fullpage">
<img <img
id="cammie" id="cammie"

View file

@ -1,3 +1,7 @@
---
navigable: true
title: Projecten
---
<% 5.times do %> <% 5.times do %>
<section class="hero is-primary"> <section class="hero is-primary">
<div class="hero-body"> <div class="hero-body">

View file

@ -1,3 +1,7 @@
---
navigable: true
title: Search
---
<form action="?" method="get"> <form action="?" method="get">
<input type="text" name="q" id="tipue_search_input" autocomplete="off" required> <input type="text" name="q" id="tipue_search_input" autocomplete="off" required>
</form> </form>

View file

@ -4,21 +4,11 @@
<img id="logo" src="https://zeus.ugent.be/wp-content/uploads/2009/05/logo-new.png" alt="" /> <img id="logo" src="https://zeus.ugent.be/wp-content/uploads/2009/05/logo-new.png" alt="" />
</a> </a>
<a class="nav-item is-tab" href="/about"> <% nav_items do |item, active| %>
About <a class="nav-item is-tab <%= 'is-active' if active %>" href="<%= relative_path_to(item) %>">
</a> <%= item[:title] %>
<a class="nav-item is-tab" href="/archives"> </a>
Archief <% end %>
</a>
<a class="nav-item is-tab" href="/projects">
Projecten
</a>
<a class="nav-item is-tab" href="/cammie">
Cammie
</a>
<a class="nav-item is-tab" href="/search">
Zoeken
</a>
</div> </div>
<div class="nav-right"> <div class="nav-right">

10
lib/helpers/nav.rb Normal file
View file

@ -0,0 +1,10 @@
module NavigationHelper
def nav_items
navigables = items.select { |i| i[:navigable] }
navigables.each do |item|
is_active = @item_rep && @item_rep.path == item.path
yield item, is_active
end
end
end

View file

@ -6,3 +6,4 @@ include Nanoc::Helpers::Text
include ArchiveHelper include ArchiveHelper
include IcalHelper include IcalHelper
include NavigationHelper