# Site settings
+baseurl: ""
url: "https://www.ralfj.de"
permalink: "/blog/:year/:month/:day/:title.html"
timezone: "Europe/Berlin"
- scope:
path: "" # all files in the project
values:
- layout: "page"
+ layout: "default"
- scope:
path: ""
type: "posts"
values:
rss: true
- pretitle: "Ralf's Ramblings"
+ vars: "blog-page.html"
# Build settings
markdown: kramdown
<ul><!--{% for item in include.menu %}
- --><li class="{{ item.class }}"><a class="{{ item.class }}" href="{% if page.absolute_urls %}{{ site.url }}{% endif %}{{ item.url }}">{{ item.title }}</a></li><!--
+ --><li class="{{ item.class }}"><a class="{{ item.class }}" href="{{ site.baseurl }}{{ item.url }}">{{ item.title }}</a></li><!--
{% if item.sub %}
--><li class="sub">{% include menu-level.html menu=item.sub %}</li><!--
{% endif %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
- <title>{% if page.pretitle %}{{ page.pretitle }} • {% endif %}{{ page.title }}</title>
- {% if page.excerpt %}<meta name="description" content="{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}">{% endif %}
+ {% assign title = page.title %}
+ {% assign pretitle = page.pretitle %}
+ {% if page.vars %}{% include {{ page.vars | prepend: "vars/" }} %}{% endif %}
- <link rel="stylesheet" href="{% if page.absolute_urls %}{{ site.url }}{% endif %}/style.css">
- {% capture canonicalurl %}{{ page.url | replace:'index.html','' }}{% endcapture %}
- <link rel="canonical" href="{{ canonicalurl | prepend: site.url }}">
- {% if page.rss %}<link rel="alternate" type="application/rss+xml" title="{{ site.blog.title }}" href="/blog/feed.xml" />{% endif %}
+ <title>{% if pretitle %}{{ pretitle }} • {% endif %}{{ title }}</title>
+ {% if page.excerpt %}<meta name="description" content="{{ page.excerpt | newline_to_br | replace:'<br />',' ' | strip_html | strip_newlines | truncate: 160 }}">{% endif %}
+
+ <link rel="stylesheet" href="{{ site.baseurl }}/style.css">
+ <link rel="canonical" href="{{ site.url }}{{ site.baseurl }}{{ page.url | replace:'index.html','' }}">
+ {% if page.rss %}<link rel="alternate" type="application/rss+xml" title="{{ site.blog.title }}" href="{{ site.baseurl }}/blog/feed.xml" />{% endif %}
</head>
<body><div id="-frame">
</nav>
<article id="-content">
- {{ content }}
+ {% comment %} Unfortunately, the variables we set above are not preserved for sub-layouts. So, we have to have all the layout here. {% endcomment %}
+ {% if pretitle %}
+ <header class="pretitle">
+ {% if page.date %}
+ <div class="side"><a href="{{ site.baseurl }}{{ page.url }}">Permalink</a> • {{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</div>
+ {% endif %}
+ <h1>{{ pretitle }}</h1>
+ </header>
+ {% endif %}
+
+ <header class="title">
+ <h1>{{ title }}</h1>
+ </header>
+
+ {{ content }}
</article>
</div></body>
+++ /dev/null
----
-layout: default
----
-{% if page.pretitle %}
-<header class="pretitle">
- {% if page.date %}
- <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>
- {% endif %}
- <h1>{{ page.pretitle }}</h1>
-</header>
-{% endif %}
-
-<header class="title">
- <h1>{{ page.title }}</h1>
-</header>
-
-{{ content }}
content = File.read(src, self.merged_file_read_opts({})).each_line.to_a
- self.data['layout'] = 'page'
+ self.data['layout'] = 'default'
self.data['title'] = content[0].match(/^#* ?(.*)\n$/)[1]
slug = self.data['title'].match(/^([^:]*):.*$/)
if slug