# Site settings
url: "https://www.ralfj.de"
+permalink: "/blog/:year/:month/:day/:title.html"
+timezone: "Europe/Berlin"
blog:
title: "Ralf's Ramblings"
path: "" # all files in the project
values:
layout: "default"
+ - scope:
+ path: ""
+ type: "posts"
+ values:
+ layout: "post"
# Build settings
markdown: kramdown
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
- <title>{{ page.title }}</title>
+ <title>{{ page.title }}{% if page.subtitle %} - {{ page.subtitle }}{% endif %}</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.blog.title }}" href="/feed.xml" />{% endif %}
+ {% if page.rss %}<link rel="alternate" type="application/rss+xml" title="{{ site.blog.title }}" href="/blog/feed.xml" />{% endif %}
</head>
</header>
<nav id="-navi">
- {% assign menu = site.html_pages | menu: page.url %}
+ {% assign menu = site.pages | menu: page.url %}
{% include menu-level.html menu=menu %}
</nav>
---
layout: default
+title: "Ralf's Ramblings"
+rss: true
---
-<div class="post">
+<header class="subtitle">
+ <div class="side"><a href="{{ page.url }}">Permalink</a> • {{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</div>
+ <h1>{{ page.subtitle }}</h1>
+</header>
- <header class="post-header">
- <h1 class="post-title">{{ page.title }}</h1>
- <p class="post-meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
- </header>
+{{ content }}
- <article class="post-content">
- {{ content }}
- </article>
-
-</div>
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['slug'] ? page['slug'] : (page['title'] ? page['title'] : page['url']), 'class' => css_class, 'sort' => page['sort'] }
- # 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
- # sort the result before returning it
- result.sort_by { |a| [a['sort'], a['url']] }
+ 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('/') and (not page['hide'])
+ # 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(input, "", displayurl.sub('/index.html', ''))
+ # create menu node
+ menu_node = { 'url' => page['url'], 'title' => page['slug'] ? page['slug'] : (page['title'] ? page['title'] : page['url']), 'class' => css_class, 'sort' => page['sort'] ? page['sort'] : 0 }
+ # 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
+ if css_class == 'parent' and sub_nodes.all? { |page| page['class'] == 'sibling' }
+ # we won't get closer to this URL, it doesn't exist in our page list
+ menu_node['class'] = 'current'
+ sub_nodes.each { |page| page['class'] = 'child' }
+ end
+ end
+ # store menu node
+ result.push(menu_node)
+ end
end
+ # sort the result before returning it
+ result.sort_by { |page| [page['sort'], page['url']] }
+ end
+
+ create_menu(input, "", displayurl.sub('/index.html', ''))
end
+ end
end
Liquid::Template.register_filter(Jekyll::MenuFilter)
--- /dev/null
+---
+title: "Ralf's Ramblings: Archive"
+slug: Archive
+rss: true
+sort: 1
+hide: true
+---
+
+<p>Here you can find all my blog posts.</p>
+
+ <ul class="post-list">
+ {% for post in site.posts %}
+ <li>
+ <span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
+ »
+ <a class="post-link" href="{{ post.url }}">{{ post.title }}</a>
+ </li>
+ {% endfor %}
+ </ul>
---
layout: null
+slug: Subscribe
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
rss: true
---
-
- <ul class="post-list">
- {% for post in site.posts %}
- <li>
- <span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
-
- <h2>
- <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
- </h2>
- </li>
- {% endfor %}
- </ul>
-
- <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
+{% assign num_posts = 5 %}
+{% for post in site.posts %}
+ {% assign num_posts = num_posts | minus: 1 %}
+ {% if num_posts >= 0 %}
+ <header class="subtitle">
+ <div class="side"><a href="{{ post.url }}">Permalink</a> • {{ post.date | date: "%b %-d, %Y" }}{% if post.author %} • {{ post.author }}{% endif %}{% if post.meta %} • {{ post.meta }}{% endif %}</div>
+ <h1>{{ post.subtitle }}</h1>
+ </header>
+ {{ post.content }}
+ {% endif %}
+{% endfor %}
---
-# YAML front matter
+hide: true
---
@charset "utf-8";
$outer-background-color: #505050;
$inner-background-color: #252525;
$text-color: #DDD;
+$light-text-color: #888;
$link-color: #9ed2ff;
$link-color-visited: #bfe1ff;
$link-color-hover: #5089ba;
position: static;
background-color: $inner-background-color;
padding: 0;
+ height: auto;
}
#-navi ul, #-navi ul ul, #-navi li, #-navi li a {
margin: 0;
/* Content styling */
#-content {
+ .subtitle .side {
+ float: right;
+ color: $light-text-color;
+ }
+
code {
padding: 0.1em 0.2em;
background-color: $outer-background-color;