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/
# Crash Log
crash.log
crash.log*
.idea/

2
Checks
View file

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

View file

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

2
Rules
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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