Skip to content
Snippets Groups Projects
Unverified Commit 95baa7dd authored by Tom Wiesing's avatar Tom Wiesing
Browse files

Rework the menu

parent 9df3472c
No related branches found
No related tags found
No related merge requests found
Showing
with 220 additions and 9033 deletions
# Repository holding the sources of the KWARC.info website
<b>
** Building this page can take up to two minutes. This is normal and to be expected. **
Note for authors: When editing some text, please do not hard wrap existing lines.
This plays very bad with diffs, in particular an entire paragraph shows up as changed even though it might just be a single line.
Furthermore, this introduces lots and lots of merge conflicts
Markdown (similar to TeX) only inserts actual line breaks when making to link breaks in the source file.
Thus the most readable and diff-compatible option is to write one sentence per line and use soft-wrapping on top in editors.
This is called [semantic linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/).
</b>
## About
......@@ -53,26 +53,49 @@ Other reasons why GitHub's preview may not correspond to the final results are:
### Editing the menu
The menu of the page is defined in the ``_config.yml`` file.
It contains three kinds of items:
1. **Folder menu**. An expandable sub-menu that contains all pages in a specific folder.
2. **Internal links**. A single link to a specific page.
3. **External links**. A link to an external page that automatically opens in a new tab.
It consists of a set of items, that are defined by the following keys:
* `url` - The (internal or external) url to the page. If internal, must be relative to the root directory.
* `folder` - Instead of using `url`, the `folder` can be used to create a submenu pointing to a specific folder.
* `items` - A list of items for submenus.
* `menu_external` - If set to `true`, assumes that `url` is external to the page.
* `menu_title` and `title` - Title to be used in the menu item.
* `menu_hidden` - If set to `true`, hide the item from the menu.
* `menu_order` - By default, menus are ordered in the order they are listed in the menu. This key can be used to override the order. Values must be non-negative integers between 0 and 10000 (inclusive). The default value is 100.
The items can be defined by inserting them into the appropriate place in the list of menu items.
They look like
**Singular items** can be inserted as following:
```yaml
# A folder menu for the /people/ folder
- title: 'People'
folder: 'people'
# A single link to the /news/ page.
- title: 'News'
- menu_title: 'News'
url: '/news/'
# An external link to the bibliography page
- title: 'Bibliography'
external: true
- menu_title: 'Bibliography'
menu_external: true
url: 'https://kwarc.github.io/bibs/'
```
**Submenus**. The menu allows (up to) one level of submenus. There are three such cases:
1. An item specifies the `folder` key. In this case all pages in the given folder are automatically added. The frontmatter is used for the specification.
2. An item specifies the `items` key. Here the items are used accordingly.
3. An item specifies both the `folder` and `items` keys. The items for both cases are automatically merged.
Because submenus are not clickable, the `url` for subfolders is ignored.
```yaml
# A listing of the folder submenu
- menu_title: 'People'
folder: '/people/'
# A submenu of university links
- menu_title: 'FAU links'
items:
- menu_title: 'Overview'
menu_external: true
url: 'https://fau.de/'
- menu_title: 'CS department'
menu_external: true
url: 'https://cs.fau.de/'
```
### Working locally
......
......@@ -50,9 +50,11 @@ fontawesome: font-awesome-4.7.0
menu:
- title: 'People'
folder: 'people'
- title: 'Bibliography'
external: true
url: 'https://kwarc.github.io/bibs/'
items:
- title: 'Bibliography'
menu_order: 10000
external: true
url: 'https://kwarc.github.io/bibs/'
- title: 'Research'
folder: 'research'
- title: 'Systems'
......@@ -65,14 +67,23 @@ menu:
folder: 'teaching'
- title: 'News'
url: '/news/'
- title: 'Contact'
url: '/contact/'
- title: 'Sub'
items:
- title: 'Contact'
url: '/contact/'
compress_html:
clippings: []
comments: ["<!-- ", " -->"]
# default values -- the one for all **must** be first
defaults:
-
scope:
path: "" # an empty string here means all files in the project
path: ""
values:
hidden: false
menu_hidden: false
menu_external: false
menu_order: 100
......@@ -2,6 +2,9 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="date" content="{{ site.time }}" scheme="YYYY-MM-DD HH:MM:SS TTTT">
<meta name='revision' content='{{ site.github.build_revision }}'>
<title>
{% if page.title == "Home" %}
......
......@@ -22,56 +22,23 @@
<a href="{{ site.baseurl }}/"><img src="{{ site.baseurl }}/public/kwarc_logo.svg" width="180px" height="180px"></a>
</div>
</li>
{% capture page_priors %}
{% for page in site.pages %}
{% assign value = page.menu_order %}
{% include print_number.liquid %},
{% endfor %}
{% endcapture %}
{% assign url_parts = page.url | split: '/' %}
{% assign base_url = url_parts | last %}
{% assign base_folder = url_parts[1] %}
{% assign sorted_pages = site.pages | sort:"menu_order" %}
{% assign page_priors = page_priors | normalize_whitespace | replace: " ", "" | split:"," | uniq | sort | join: "," | append: "," %}
{% for node in site.menu %}
{% if node.folder %}
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold">
<a class="collapsible-header {% if base_folder == node.folder %}active{% endif %}">{{ node.title }}</a>
<div class="collapsible-body">
<ul>
{% for sub in sorted_pages %}
{% assign sub_parts = sub.url | split: '/' %}
{% assign sub_url = sub_parts | last %}
{% assign sub_folder = sub_parts[1] %}
{% if sub_folder == node.folder %}
{% if sub.hidden == false %}
<li {% if sub_url == base_url %}class="active"{% endif %}>
<a href="{{ sub.url }}">
{% if sub.menu_title %}
{{ sub.menu_title }}
{% else %}
{{ sub.title }}
{% endif %}
</a>
</li>
{% endif%}
{% endif %}
{% endfor %}
</ul>
</div>
</li>
</ul>
</li>
{% else if node.url %}
<li
{% if page.url == node.url %}
class="active"
{% endif %}
>
<a href="{% unless node.external %}{{ site.baseurl }}{% endunless %}{{ node.url }}" {% if node.external %}target="_blank"{% endif %}>{{node.title}}</a>
</li>
{% endif %}
{% for item in site.menu | sort:"menu_order %}
{% if item.folder %}
{% include menu_sub.html %}
{% elsif item.items %}
{% include menu_sub.html %}
{% else %}
{% include menu_single.html %}
{% endif %}
{% endfor %}
</li>
</ul>
\ No newline at end of file
{% comment %}
This page creates a single (non-submenu) item. It expects `item` as a variable.
{% endcomment %}
{% unless item.menu_hidden %}
<li
{% if page.url == item.url %}class="active"{% endif %}
>
<a
href="{% unless item.menu_external %}{{ site.baseurl }}{% endunless %}{{ item.url }}"
{% if item.menu_external %}target="_blank"{% endif %}
>
{% if item.menu_title %}
{{ item.menu_title }}
{% else %}
{{ item.title }}
{% endif %}
</a>
</li>
{% endunless %}
\ No newline at end of file
{% comment %}
This page creates a submenu item. It expects an appropriate `item` as argument.
Furthermore, it requires the page_priors global variable
{% endcomment %}
{% unless item.menu_hidden %}
<!-- Figure out our current location -->
{% assign url_parts = page.url | split: '/' %}
{% assign base_url = url_parts | last %}
{% assign base_folder = url_parts[1] %}
<!-- Find out if we are active -->
{% assign menu_active = false %}
<!-- if we are in the right folder, we are active -->
{% if base_folder == item.folder %}
{% assign menu_active = true %}
{% endif %}
<!-- find all our priorities and also check for activity -->
{% capture priors %}
{{ page_priors }}
{% for item in item.items %}
{% unless item.menu_page %}
{% unless item.external_page %}
{% if item.url == page.url %}
{% assign menu_active = true %}
{% endif %}
{% endunless %}
{% endunless %}
{% assign value = item.menu_order %}
{% include print_number.liquid %},
{% endfor %}
{% endcapture %}
{% assign priors = priors | normalize_whitespace | replace: " ", "" | split:"," | uniq | sort %}
<!-- Find the current folder -->
{% assign item_folder = item.folder %}
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold">
<a class="collapsible-header {% if menu_active %}active{% endif %}">
{% if item.menu_title %}
{{ item.menu_title }}
{% else %}
{{ item.title }}
{% endif %}
</a>
<div class="collapsible-body">
<ul>
<!-- Start by iteratig over the priorities -->
{% for p in priors %}
<!-- If we have folders, iterate over them -->
{% if item.folder %}
{% for item in site.pages %}
<!-- read item priority -->
{% assign value = item.menu_order %}
{% capture ip %}{% include print_number.liquid %}{% endcapture %}
{% assign ip = ip | normalize_whitespace | replace: " ", "" %}
<!-- pick all the ones with the current priority -->
{% if ip == p %}
<!-- get the current page -->
{% assign sub_parts = item.url | split: '/' %}
{% assign sub_url = sub_parts | last %}
{% assign sub_folder = sub_parts[1] %}
<!-- if we are in the right folder, include it -->
{% if sub_folder == item_folder %}
{% include menu_single.html %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<!-- if we have items, iterate over them -->
{% if item.items %}
{% for item in item.items %}
<!-- read item priority -->
{% assign value = item.menu_order %}
{% capture ip %}{% include print_number.liquid %}{% endcapture %}
{% assign ip = ip | normalize_whitespace | replace: " ", "" %}
<!-- pick all the ones with the current priority -->
{% if ip == p %}
{% include menu_single.html %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</div>
</li>
</ul>
</li>
{% endunless %}
\ No newline at end of file
......@@ -2,7 +2,7 @@
layout: page
title: Project Activites
alltags: True
menu_order: 1
menu_order: 101
---
{% comment %}
......
{% if value == null %}
{% assign value = site.defaults[0].values["menu_order"] %}
{% endif %}
{% if value < 10 %}0{% endif %}
{% if value < 100 %}0{% endif %}
{% if value < 1000 %}0{% endif %}
{% if value < 10000 %}0{% endif %}
{{value}}
\ No newline at end of file
......@@ -3,7 +3,6 @@ layout: compress
---
<!DOCTYPE html>
<!-- built at {{ site.time }} from commit {{ site.github.build_revision }} -->
<html lang="en-us">
{% include head.html %}
......
......@@ -2,7 +2,7 @@
layout: page
title: Project Activites
alltags: True
menu_order: 1
menu_order: 101
---
{% comment %}
......
---
layout: page
hidden: true
menu_hidden: true
---
## Academic Activities
......
---
layout: page
hidden: true
menu_hidden: true
---
## CV Michael Kohlhase
......
......@@ -2,7 +2,7 @@
layout: person
menu_title: Michael Kohlhase
title: Michael Kohlhase
menu_order: 1
menu_order: 101
fullname: Prof. Dr. Michael Kohlhase
fulltitle: Professur für Wissensrepräsentation und -verarbeitung
affiliation: Computer Science, FAU Erlangen-Nürnberg
......
......@@ -2,7 +2,7 @@
layout: person
menu_title: Tom Wiesing
title: Tom Wiesing
menu_order: 1
menu_order: 102
fullname: B.Sc. Tom Wiesing
affiliation: Data Engineering, Jacobs University
account: twiesing
......
......@@ -2,7 +2,7 @@
layout: default
title: Current Projects
menu_title: Current
menu_order: 1
menu_order: 101
---
## Current Projects ([past projects](/projects/past/))
......
......@@ -2,7 +2,7 @@
layout: default
title: Past Projects
menu_title: Past
menu_order: 2
menu_order: 102
---
## Completed Projects ([current projects](/projects/current/))
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
layout: page
title: Formal Methods
menu_title: Formal Methods
menu_order: 2
menu_order: 102
---
## Formal Methods
......
......@@ -2,6 +2,6 @@
layout: page
title: KM & Interaction
menu_title: Knowledge Management & Interaction
menu_order: 4
menu_order: 104
---
...more to be written ...
......@@ -2,7 +2,7 @@
layout: page
title: KWARC Research
menu_title: Overview
menu_order: 1
menu_order: 101
---
The KWARC research group conducts research in knowledge representation with a view towards applications in knowledge management. We extend techniques from [formal methods](http://kwarc.info/research/formal-methods/) so that they can be used in settings where formalization is either infeasible or too costly. We concentrate on developing techniques for marking up the [structural semantics](http://kwarc.info/structural-semantics) in technical documents. This level of markup allows for offering interesting [knowledge management services](http://kwarc.info/research/kminteract/) without forcing the author to fully formalize the document contents, we are working on methods for [semi-automated semantization](http://kwarc.info/research/semantization/). All in all, the research in the KWARC group is summarized in the schema below, which can be read as a pipeline from foundations (on the bottom) to applications (on the top).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment