From 283368c5bf7fd991bf3596d3e9efa3484028d981 Mon Sep 17 00:00:00 2001 From: Tom Wiesing <tkw01536@gmail.com> Date: Fri, 6 Apr 2018 02:27:21 +0200 Subject: [PATCH] Cleanup include tags --- _includes/course.html | 2 +- _includes/date.html | 2 +- _includes/header.html | 4 ++-- _includes/menu_single.html | 20 +++++++++---------- _includes/menu_sub.html | 6 ++++-- _includes/pagination.html | 2 ++ _includes/people_chip.html | 4 ++-- _includes/people_list.html | 8 ++++---- _includes/post_link.html | 7 +++---- _includes/post_meta.html | 15 ++++++++------ _includes/psitem.html | 8 ++++---- _includes/semester.html | 2 ++ _layouts/course.html | 4 ++-- _layouts/person.html | 6 ++---- _layouts/post.html | 3 +-- _layouts/project.html | 12 +++++------ _layouts/system.html | 12 +++++------ ...DreamKit.md => 2015-05-08-OpenDreamKit.md} | 0 ...-Demo-OEIS => 2015-07-22-New-Demo-OEIS.md} | 0 _posts/2016-10-01-KWARC-established.md | 2 +- _posts/2016-10-01.md | 8 -------- courses/meta/former.html | 4 ++-- courses/meta/index.html | 2 +- courses/meta/upcoming.html | 2 +- index.md | 2 +- news/index.html | 4 ++-- people/meta/current.html | 2 +- people/meta/former.html | 2 +- projects/meta/completed.md | 4 ++-- projects/meta/index.md | 4 ++-- systems/meta/historic.md | 2 +- systems/meta/index.md | 2 +- systems/meta/orphans.md | 2 +- 33 files changed, 76 insertions(+), 83 deletions(-) rename _posts/{2015-05-08OpenDreamKit.md => 2015-05-08-OpenDreamKit.md} (100%) rename _posts/{2015-07-22-New-Demo-OEIS => 2015-07-22-New-Demo-OEIS.md} (100%) delete mode 100644 _posts/2016-10-01.md diff --git a/_includes/course.html b/_includes/course.html index 86d8d43..e64be1a 100644 --- a/_includes/course.html +++ b/_includes/course.html @@ -3,5 +3,5 @@ {% endcomment %} <li class="collection-item"> - <a href="{{item.url}}" class="title">{{item.title}}</a> + <a href="{{include.item.url}}" class="title">{{include.item.title}}</a> </li> \ No newline at end of file diff --git a/_includes/date.html b/_includes/date.html index 7bd201e..9cf3afa 100644 --- a/_includes/date.html +++ b/_includes/date.html @@ -2,7 +2,7 @@ Properly formats the date in yyyy[-mm] format. Expects 'date' to be formatted as an argument. {% endcomment %} -{% assign dateparts = date | split: "-" %} +{% assign dateparts = include.date | split: "-" %} {% assign year = dateparts[0] %} {% assign month = dateparts[1] %} diff --git a/_includes/header.html b/_includes/header.html index 0307a4b..456ff2b 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -28,9 +28,9 @@ {% for item in site.menu | sort:"menu_order" %} {% if (item.folder or item.items) %} - {% include menu_sub.html %} + {% include menu_sub.html item=item %} {% else %} - {% include menu_single.html %} + {% include menu_single.html item=item %} {% endif %} {% endfor %} </ul> \ No newline at end of file diff --git a/_includes/menu_single.html b/_includes/menu_single.html index 4e8b3c7..139433d 100644 --- a/_includes/menu_single.html +++ b/_includes/menu_single.html @@ -7,7 +7,7 @@ {% assign base_folder = page.url | split: '/' %} {% assign base_folder = base_folder[1] %} -{% assign represents = item.active | split: '/' %} +{% assign represents = include.item.active | split: '/' %} {% assign represents = represents[1] %} {% if represents %} @@ -16,25 +16,25 @@ {% endif %} {% endif %} -{% if page.url == item.url %} +{% if page.url == include.item.url %} {% assign menu_active = true %} {% endif %} -{% unless item.menu_hidden %} +{% unless include.item.menu_hidden %} <li {% if menu_active %}class="active"{% endif %} - {% if page.url == item.url %}class="active"{% endif %} + {% if page.url == include.item.url %}class="active"{% endif %} > - {% if item.external %} - <a href="{{ item.url }}" target="_blank"> + {% if include.item.external %} + <a href="{{ include.item.url }}" target="_blank"> {% else %} - <a href="{{ site.baseurl }}{{ item.url }}"> + <a href="{{ site.baseurl }}{{ include.item.url }}"> {% endif %} - {% if item.menu_title %} - {{ item.menu_title }} + {% if include.item.menu_title %} + {{ include.item.menu_title }} {% else %} - {{ item.title }} + {{ include.item.title }} {% endif %} </a> </li> diff --git a/_includes/menu_sub.html b/_includes/menu_sub.html index 4b4210b..190d159 100644 --- a/_includes/menu_sub.html +++ b/_includes/menu_sub.html @@ -4,6 +4,8 @@ It also expects the global 'sorted_pages' argument. {% endcomment %} +{% assign item = include.item %} + {% unless item.menu_hidden %} {% assign base_folder = page.url | split: '/' %} {% assign base_folder = base_folder[1] %} @@ -59,7 +61,7 @@ {% assign sub_components = item.url | split: '/' %} {% unless item.hidden %} {% if sub_components[1] == item_folder %} - {% include menu_single.html %} + {% include menu_single.html item=item %} {% endif %} {% endunless %} {% endfor %} @@ -68,7 +70,7 @@ <!-- if we have items, iterate over them --> {% if item.items %} {% for item in item.items %} - {% include menu_single.html %} + {% include menu_single.html item=item %} {% endfor %} {% endif %} </ul> diff --git a/_includes/pagination.html b/_includes/pagination.html index 029e2e8..1952cb5 100644 --- a/_includes/pagination.html +++ b/_includes/pagination.html @@ -3,6 +3,8 @@ Expects the default jekyll 'paginator' as argument. {% endcomment %} +{% assign paginator = paginator %} + <ul class="pagination"> <!-- The previous page --> diff --git a/_includes/people_chip.html b/_includes/people_chip.html index c2a98d6..adf170a 100644 --- a/_includes/people_chip.html +++ b/_includes/people_chip.html @@ -3,7 +3,7 @@ It expects the username of the person as the 'person' variable {% endcomment %} -{% capture purl %}/people/{{person}}/{% endcapture %} +{% capture purl %}/people/{{include.person}}/{% endcapture %} {% assign pp = site.pages | where: "url", purl | first %} {% if pp %} @@ -15,6 +15,6 @@ </a> {% else %} <div class="chip"> - {{person}} + {{include.person}} </div> {% endif %} diff --git a/_includes/people_list.html b/_includes/people_list.html index 4406d4c..50078c3 100644 --- a/_includes/people_list.html +++ b/_includes/people_list.html @@ -3,6 +3,8 @@ Expects 'people' as an argument, representing the list of people to show. {% endcomment %} +{% assign people = include.people %} + {% for role in site.roles %} {% assign rollers = people | where: "role", role.id %} @@ -19,13 +21,11 @@ {% unless person.end_date %} KWARCie since {% endunless %} - {% assign date = person.start_date %} - {% include date.html %} + {% include date.html date=person.start_date %} {% if person.end_date %} - - {% assign date = person.end_date %} - {% include date.html %} + {% include date.html date=person.end_date %} {% endif %} {% endif %} </p> diff --git a/_includes/post_link.html b/_includes/post_link.html index 497c599..276bdd2 100644 --- a/_includes/post_link.html +++ b/_includes/post_link.html @@ -4,12 +4,11 @@ {% endcomment %} <li class="collection-item"> - <a href="{{post.url}}" class="title"> - {{post.title}} {{post.subtitle}} + <a href="{{include.post.url}}" class="title"> + {{include.post.title}} {{include.post.subtitle}} </a> <div> - {% assign post = page %} - {% include post_meta.html %} + {% include post_meta.html post=include.post %} </div> </li> \ No newline at end of file diff --git a/_includes/post_meta.html b/_includes/post_meta.html index f887c79..ee14b5a 100644 --- a/_includes/post_meta.html +++ b/_includes/post_meta.html @@ -5,26 +5,29 @@ by -{% assign person = post.author %} -{% include people_chip.html %} +{% include people_chip.html person=include.post.author %} on <div class="chip"> - {{ post.date | date_to_string }} + {% if include.post.date %} + {{ include.post.date | date_to_string }} + {% else %} + There is no date + {% endif %} </div> -{% if post.location %} +{% if include.post.location %} at <div class="chip"> - {{post.location}} + {{include.post.location}} </div> {% endif %} in -{% for tag in post.tags %} +{% for tag in include.post.tags %} <div class="chip"> {{tag}} </div> diff --git a/_includes/psitem.html b/_includes/psitem.html index 8958be1..5fd7022 100644 --- a/_includes/psitem.html +++ b/_includes/psitem.html @@ -2,6 +2,8 @@ Renders a link to a single project or system. Expects 'item' as a parameter. {% endcomment %} +{% assign item = include.item %} + <li class="collection-item"> <a href="{{item.url}}" class="title">{{item.title}}</a> {% if item.funding %} ({{item.funding}}) {% endif %} @@ -12,13 +14,11 @@ {% unless item.end_date %} <b>started</b> {% endunless %} - {% assign date = item.start_date %} - {% include date.html %} + {% include date.html date=item.start_date %} {% if item.end_date %} - - {% assign date = item.end_date %} - {% include date.html %} + {% include date.html date=item.end_date %} {% endif %} <br /> {% endif %} diff --git a/_includes/semester.html b/_includes/semester.html index c3095c4..a2cd1c8 100644 --- a/_includes/semester.html +++ b/_includes/semester.html @@ -2,6 +2,8 @@ Renders the name of a single semester. Expects 'semester' as a parameter. {% endcomment %} +{% assign semester = include.semester %} + <!-- check if we are a summer semester --> {% assign nosummer = semester | remove: "SS" %} {% unless nosummer == semester %} diff --git a/_layouts/course.html b/_layouts/course.html index b4de0ab..746c2b9 100644 --- a/_layouts/course.html +++ b/_layouts/course.html @@ -8,7 +8,7 @@ layout: default <div class="card-content"> <span class="card-title">{{page.title}}</span> {% for person in page.instructors %} - {% include people_chip.html %} + {% include people_chip.html person=person %} {% endfor %} <hr /> @@ -17,7 +17,7 @@ layout: default {% endif %} {% for semester in page.semesters %} - {% include semester.html %}<br /> + {% include semester.html semester=semester %}<br /> {% endfor %} </div> </div> diff --git a/_layouts/person.html b/_layouts/person.html index 84290a5..6037979 100644 --- a/_layouts/person.html +++ b/_layouts/person.html @@ -24,13 +24,11 @@ layout: default since {% endunless %} - {% assign date = page.start_date %} - {% include date.html %} + {% include date.html date=page.start_date %} {% if page.end_date %} - - {% assign date = page.end_date %} - {% include date.html %} + {% include date.html date=page.end_date %} {% endif %} {% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index 153ca21..3379a55 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -11,8 +11,7 @@ layout: default </span> {% if post.subtitle %}<h6>{{post.subtitle}}</h6>{% endif %} - {% assign post = page %} - {% include post_meta.html %} + {% include post_meta.html post=page %} </div> </div> diff --git a/_layouts/project.html b/_layouts/project.html index d9dc833..9060979 100644 --- a/_layouts/project.html +++ b/_layouts/project.html @@ -13,14 +13,12 @@ layout: default {% if page.start_date %} <p> <b>From:</b> - {% assign date = page.start_date %} - {% include date.html %} + {% include date.html date=page.start_date %} {% if page.end_date %} - <br /> - <b>To:</b> - {% assign date = page.end_date %} - {% include date.html %} + <br /> + <b>To:</b> + {% include date.html date=page.end_date %} {% endif %} </p> <hr /> @@ -56,7 +54,7 @@ layout: default <!-- list all the people --> {% for person in page.people %} - {% include people_chip.html %} + {% include people_chip.html person=person %} {% assign needs_break = true %} {% endfor %} diff --git a/_layouts/system.html b/_layouts/system.html index d86e34f..9b7aba1 100644 --- a/_layouts/system.html +++ b/_layouts/system.html @@ -13,14 +13,12 @@ layout: default {% if page.start_date %} <p> <b>Start:</b> - {% assign date = page.start_date %} - {% include date.html %} + {% include date.html date=page.start_date %} {% if page.end_date %} - <br /> - <b>End:</b> - {% assign date = page.end_date %} - {% include date.html %} + <br /> + <b>End:</b> + {% include date.html date=page.end_date %} {% endif %} </p> <hr /> @@ -38,7 +36,7 @@ layout: default {% endif %} {% for person in page.people %} - {% include people_chip.html %} + {% include people_chip.html person=person %} {% endfor %} </div> {% assign hasaction = false %} diff --git a/_posts/2015-05-08OpenDreamKit.md b/_posts/2015-05-08-OpenDreamKit.md similarity index 100% rename from _posts/2015-05-08OpenDreamKit.md rename to _posts/2015-05-08-OpenDreamKit.md diff --git a/_posts/2015-07-22-New-Demo-OEIS b/_posts/2015-07-22-New-Demo-OEIS.md similarity index 100% rename from _posts/2015-07-22-New-Demo-OEIS rename to _posts/2015-07-22-New-Demo-OEIS.md diff --git a/_posts/2016-10-01-KWARC-established.md b/_posts/2016-10-01-KWARC-established.md index 6691f12..8d3721c 100644 --- a/_posts/2016-10-01-KWARC-established.md +++ b/_posts/2016-10-01-KWARC-established.md @@ -5,4 +5,4 @@ title: KWARC established at FAU tags: - Announcements --- -With Dennis Müller movint to Erlangen, we have (the beginnings of) a group presence at FAU. The Winter semester begins later this month with an AI course. +With Dennis Müller moving to Erlangen, we have (the beginnings of) a group presence at FAU. The Winter semester begins later this month with an AI course. diff --git a/_posts/2016-10-01.md b/_posts/2016-10-01.md deleted file mode 100644 index 604de9e..0000000 --- a/_posts/2016-10-01.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -layout: post -author: mkohlhase -title: KWARC established at FAU -tags: - - Announcements ---- -With Dennis Müller moving to Erlangen, we have (the beginnings of) a group presence at FAU. diff --git a/courses/meta/former.html b/courses/meta/former.html index bda4e3f..8ab97de 100644 --- a/courses/meta/former.html +++ b/courses/meta/former.html @@ -13,10 +13,10 @@ The courses given by the KWARC group in the last semesters: {% if offers.size > 0%} <ul class="collection with-header"> - <li class="collection-header"><h5>{% include semester.html %}</h5></li> + <li class="collection-header"><h5>{% include semester.html semester=semester %}</h5></li> {% for item in offers %} - {% include course.html %} + {% include course.html item=item %} {% endfor %} </ul> {% endif %} diff --git a/courses/meta/index.html b/courses/meta/index.html index bc2a1b1..89609bb 100644 --- a/courses/meta/index.html +++ b/courses/meta/index.html @@ -9,7 +9,7 @@ permalink: /courses/ <ul class="collection"> {% for item in courses %} {% if item.semesters contains site.semesters.current %} - {% include course.html %} + {% include course.html item=item %} {% endif %} {% endfor %} </ul> diff --git a/courses/meta/upcoming.html b/courses/meta/upcoming.html index 19de1c6..aeb92c2 100644 --- a/courses/meta/upcoming.html +++ b/courses/meta/upcoming.html @@ -10,7 +10,7 @@ The courses in the upcoming semester: {{site.upcoming}} <ul class="collection"> {% for item in courses %} {% if item.semesters contains site.semesters.upcoming %} - {% include course.html %} + {% include course.html item=item %} {% endif %} {% endfor %} </ul> diff --git a/index.md b/index.md index e4a9f34..ac366e1 100644 --- a/index.md +++ b/index.md @@ -15,6 +15,6 @@ This level of markup allows for offering interesting [knowledge management servi <ul class="collection"> {% for post in site.posts limit:5 %} - {% include post_link.html %} + {% include post_link.html post=post %} {% endfor %} </ul> diff --git a/news/index.html b/news/index.html index 62ef549..66240a8 100644 --- a/news/index.html +++ b/news/index.html @@ -7,9 +7,9 @@ source: _posts/ <div class="posts"> <ul class="collection"> {% for post in paginator.posts %} - {% include post_link.html %} + {% include post_link.html post=post %} {% endfor %} </ul> </div> -{% include pagination.html %} \ No newline at end of file +{% include pagination.html paginator=paginator %} \ No newline at end of file diff --git a/people/meta/current.html b/people/meta/current.html index 6a3c519..abdad5d 100644 --- a/people/meta/current.html +++ b/people/meta/current.html @@ -10,4 +10,4 @@ permalink: /people/ <p>This page lists the current members of the KWARC group (<a href="former.html">former members</a>).</p> -{% include people_list.html %} +{% include people_list.html people=people %} diff --git a/people/meta/former.html b/people/meta/former.html index f1202ff..9098385 100644 --- a/people/meta/former.html +++ b/people/meta/former.html @@ -11,4 +11,4 @@ permalink: /people/former/ members</a>). We are very proud of our alumni; if you are one, please keep in touch. </p> -{% include people_list.html %} +{% include people_list.html people=people %} diff --git a/projects/meta/completed.md b/projects/meta/completed.md index 9ec6dab..f251df2 100644 --- a/projects/meta/completed.md +++ b/projects/meta/completed.md @@ -10,7 +10,7 @@ permalink: /projects/completed/ <ul class="collection"> {% for item in projects %} - {% if item.funding %} {% include psitem.html %} {% endif %} + {% if item.funding %} {% include psitem.html item=item %} {% endif %} {% endfor %} </ul> @@ -19,7 +19,7 @@ We also organize some of our research and development into Projects, <ul class="collection"> {% for item in projects %} - {% unless item.funding %} {% include psitem.html %} {% endunless %} + {% unless item.funding %} {% include psitem.html item=item %} {% endunless %} {% endfor %} </ul> diff --git a/projects/meta/index.md b/projects/meta/index.md index 339b5cb..11ec46e 100644 --- a/projects/meta/index.md +++ b/projects/meta/index.md @@ -11,7 +11,7 @@ permalink: /projects/ <ul class="collection"> {% for item in projects %} {% unless item.funding == 'internal' %} - {% include psitem.html %} + {% include psitem.html item=item %} {% endunless %} {% endfor %} </ul> @@ -24,7 +24,7 @@ external researchers: <ul class="collection"> {% for item in projects %} {% if item.funding == 'internal' %} - {% include psitem.html %} + {% include psitem.html item=item %} {% endif %} {% endfor %} </ul> diff --git a/systems/meta/historic.md b/systems/meta/historic.md index 999fded..49b32e1 100644 --- a/systems/meta/historic.md +++ b/systems/meta/historic.md @@ -15,7 +15,7 @@ Interoperability and to establish scientific Communities of Practice. <ul class="collection"> {% for item in systems %} {% if item.end_date %} - {% include psitem.html %} + {% include psitem.html item=item %} {% endif %} {% endfor %} </ul> \ No newline at end of file diff --git a/systems/meta/index.md b/systems/meta/index.md index 344ce75..c0a7aa9 100644 --- a/systems/meta/index.md +++ b/systems/meta/index.md @@ -9,7 +9,7 @@ permalink: /systems/ <ul class="collection"> {% for item in systems %} {% unless item.end_date %} - {% include psitem.html %} + {% include psitem.html item=item %} {% endunless %} {% endfor %} </ul> diff --git a/systems/meta/orphans.md b/systems/meta/orphans.md index 8a8bb8a..4c913f2 100644 --- a/systems/meta/orphans.md +++ b/systems/meta/orphans.md @@ -14,7 +14,7 @@ happy to help you understand the development opportunities and get involved. <ul class="collection"> {% for item in systems %} {% if item.orphan %} - {% include psitem.html %} + {% include psitem.html item=item %} {% endif %} {% endfor %} </ul> \ No newline at end of file -- GitLab