# Site settings
-title: ralfj.de
url: "https://www.ralfj.de"
blog:
title: "Ralf's Ramblings"
description: "Ralf rambling on things"
-structure:
- - url: "/"
- title: "ralfj.de"
- structure:
- - url: "projects/"
- title: "Projects"
- structure:
- - url: "lilass/"
- title: LiLaSS
- - url: "schsh/"
- title: schsh
- - url: "cs/"
- title: "Research"
-
defaults:
- scope:
path: "" # all files in the project
-<ul>{% for item in include.menu %}<!--
- {% comment %} We compute the full URL of this item, and truncate canonicalurl so that length so we can test whether it starts with it {% endcomment %}
- {% assign cururl = item.url | prepend: include.base %}
- {% assign isparent_search = canonicalurl | truncate: cururl.size, '' %}
- {% capture class %}{% if cururl == canonicalurl %}current{% elsif include.above != true %}child{% elsif isparent_search == cururl %}parent{% else %}sibling{% endif %}{% endcapture %}
- {% comment %} Now we can output the item and it substructure. Try hard not to output unnecessary spaces! {% endcomment %}
- --><li class="{{ class }}"><a href="{{ item.url | prepend: include.base }}">{{ item.title }}</a></li><!--
- {% if item.structure and (class == "current" or class == "parent") %}
- {% if cururl == canonicalurl %}{% assign above = false %}{% else %}{% assign above = true %}{% endif %}
- -->{% include menu-level.html menu=item.structure base=cururl above=above %}<!--
+<ul><!--{% for item in include.menu %}
+ --><li class="{{ item.class }}"><a href="{{ item.url }}">{{ item.url }}: {{ item.title }}</a></li><!--
+ {% if item.sub %}
+ -->{% include menu-level.html menu=item.sub %}<!--
{% endif %}
--->{% endfor %}</ul>
\ No newline at end of file
+{% endfor %}--></ul>
\ No newline at end of file
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
- <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
+ <title>{{ page.title }}</title>
{% if page.excerpt %}<meta name="description" content="{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}">{% endif %}
<link rel="stylesheet" href="/style.css">
{% capture canonicalurl %}{{ page.url | replace:'index.html','' }}{% endcapture %}
<link rel="canonical" href="{{ canonicalurl | prepend: site.url }}">
- {% if page.rss or page.layout == 'post' %}<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.url }}" />{% endif %}
+ {% if page.rss or page.layout == 'post' %}<link rel="alternate" type="application/rss+xml" title="{{ site.blog.title }}" href="/feed.xml" />{% endif %}
</head>
<body><div id="-frame">
<header id="-title">
- <h1>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</h1>
+ <h1>{{ page.title }}</h1>
</header>
<nav id="-navi">
- {% include menu-level.html menu=site.structure base="" above=true %}
+ {% assign menu = site.html_pages | menu: page.url %}
+ {% include menu-level.html menu=menu %}
</nav>
<article id="-content">
- {{ content }}
+ {{ content }}
</article>
</div></body>
--- /dev/null
+module Jekyll
+ module MenuFilter
+ def menu(input, displayurl)
+ def create_menu(pages, base, displayurl)
+ result = Array.new
+ for page in pages
+ cururl = page['url'].sub('/index.html', '')
+ if cururl.start_with?(base) and cururl.count('/') == base.count('/')
+ # figure out CSS class
+ if cururl == displayurl
+ css_class = 'current'
+ elsif cururl.start_with?(displayurl)
+ css_class = 'child'
+ elsif displayurl.start_with?(cururl)
+ css_class = 'parent'
+ else
+ css_class = 'sibling'
+ end
+ # create menu node
+ menu_node = { 'url' => page['url'], 'title' => page['title'], 'class' => css_class }
+ # potentially recurse
+ if (css_class == 'parent' or css_class == 'current')
+ sub_nodes = create_menu(pages, cururl + "/", displayurl)
+ if sub_nodes.size > 0
+ menu_node['sub'] = sub_nodes
+ end
+ end
+ # store menu node
+ result.push(menu_node)
+ end
+ end
+ result
+ end
+
+ create_menu(input, "", displayurl.sub('/index.html', ''))
+ end
+ end
+end
+
+Liquid::Template.register_filter(Jekyll::MenuFilter)
<title>{{ site.blog.title | xml_escape }}</title>
<description>{{ site.blog.description | xml_escape }}</description>
<link>{{ site.url }}/</link>
- <atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
+ <atom:link href="{{ "/feed.xml" | prepend: site.url }}" rel="self" type="application/rss+xml"/>
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
<generator>Jekyll v{{ jekyll.version }}</generator>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.content | xml_escape }}</description>
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
- <link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link>
- <guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid>
+ <link>{{ post.url | prepend: site.url }}</link>
+ <guid isPermaLink="true">{{ post.url | prepend: site.url }}</guid>
{% for tag in post.tags %}
<category>{{ tag | xml_escape }}</category>
{% endfor %}
---
+title: ralfj.de
---
<h2>Willkommen</h2>