IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 0d855689 authored by Amy Rose's avatar Amy Rose
Browse files

use breadcrumbs in project pages

parent cf8bdf2f
Pipeline #785 passed with stage
in 3 minutes and 18 seconds
......@@ -57,11 +57,15 @@ layout: default
<!-- Sidenav -->
<div id="sidenav">
{% if page.breadcrumbs %}
{% assign breadcrumbs = page.breadcrumbs | default: layout.breadcrumbs %}
{% if breadcrumbs %}
<div id="breadcrumbs">
<a href="{{ '/' | relative_url }}"> <b>Open@RIT</b> </a>
{% for crumb in page.breadcrumbs %}
/ <a href="{{ crumb.path | relative_url }}"> {{crumb.name}} </a>
{% for crumb in breadcrumbs %}
/
<a href="{{ crumb.path | flatify | relative_url }}">
{{ crumb.name | flatify }}
</a>
{% endfor %}
</div>
{% endif %}
......
......@@ -3,6 +3,14 @@ layout: base
banner: /assets/images/banners/our-work.webp
load_scripts:
- /assets/js/project.js
breadcrumbs:
- name: Our Open Work
path: /our-work/
- name: Our Fellows' Projects
path: /our-work/fellows-projects
- name: "{{ page.name }}"
path: "{{ page.url }}"
---
<div id="project-content" style="display: none;">
......
# credit: http://acegik.net/blog/ruby/jekyll/plugins/howto-nest-liquid-template-variables-inside-yaml-front-matter-block.html
# modified to ignore non-templated content
module Jekyll
module ExpandNestedVariableFilter
def flatify(input)
Liquid::Template.parse(input).render(@context)
end
end
module ExpandNestedVariableFilter
def flatify(input)
text = input.to_s
if text.match?(/\{\{(.*?)\}\}/)
return Liquid::Template.parse(input).render(@context)
end
return text
end
end
end
Liquid::Template.register_filter(Jekyll::ExpandNestedVariableFilter)
......@@ -3,11 +3,13 @@ layout: base
banner: /assets/images/banners/our-work.webp
breadcrumbs:
- name: PLACEHOLDER-RENAME
- name: Our Open Work
path: /our-work/
- name: Our Fellows' Projects
path: /our-work/fellows-projects
subnav:
- name: PLACEHOLDER-RENAME
- name: Our Work and Projects
link: /our-work
sections:
- LibreCorps Team
......
......@@ -3,11 +3,13 @@ layout: base
banner: /assets/images/banners/our-work.webp
breadcrumbs:
- name: PLACEHOLDER-RENAME
- name: Our Open Work
path: /our-work/
- name: Our Work and Projects
path: /our-work/
subnav:
- name: PLACEHOLDER-RENAME
- name: Our Work and Projects
link: /our-work
active: true
sections:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment