mirror of
https://github.com/metagov/govarch-website.git
synced 2025-06-21 18:01:07 +00:00
add titleless posts and a menu in the footer
This commit is contained in:
21
_includes/menu.html
Normal file
21
_includes/menu.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% assign menu = site.data.menu %}
|
||||
|
||||
{% if menu %}
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for item in site.data.menu %}
|
||||
<li>
|
||||
{% if item.url contains 'http' %}
|
||||
<a href="{{ item.url }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ item.url | prepend: site.baseurl }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
26
_includes/post-list-item.html
Normal file
26
_includes/post-list-item.html
Normal file
@ -0,0 +1,26 @@
|
||||
{% capture excerpt %}
|
||||
{{ post.excerpt | replace: "<p>", "" | replace: "</p>", "" }}
|
||||
{% endcapture %}
|
||||
|
||||
{% assign excerpt_length = excerpt | size %}
|
||||
|
||||
<li>
|
||||
<a href="{{ post.url | absolute_url }}" class="post-link">
|
||||
{% unless post.title == "" %}
|
||||
<span class="post-title">
|
||||
{{ post.title }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="post-title">
|
||||
{% if excerpt_length > 140 %}
|
||||
{{ excerpt | truncatewords: 12, '…' }}
|
||||
{% else %}
|
||||
{{ excerpt }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endunless %}
|
||||
<span class="post-date">
|
||||
{{ post.date | date: "%b %-d, '%y" }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
@ -19,6 +19,8 @@
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% include menu.html %}
|
||||
|
||||
{% unless site.hide_credits %}
|
||||
<aside class="site-credits">
|
||||
<p>
|
||||
|
@ -2,8 +2,6 @@
|
||||
layout: default
|
||||
---
|
||||
|
||||
{% assign menu = site.data.menu %}
|
||||
|
||||
{% if site.paginate and site.paginate_path and paginator.page > 1 %}
|
||||
{% include back-link.html %}
|
||||
{% else %}
|
||||
@ -18,31 +16,13 @@ layout: default
|
||||
{{ site.description }}
|
||||
</h2>
|
||||
{% endif %}
|
||||
{% if menu %}
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for item in site.data.menu %}
|
||||
<li>
|
||||
{% if item.url contains 'http' %}
|
||||
<a href="{{ item.url }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ item.url | prepend: site.baseurl }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% include menu.html %}
|
||||
</header>
|
||||
{% endif %}
|
||||
|
||||
<main class="home" aria-label="Content">
|
||||
|
||||
<h1 class="divided">
|
||||
<h1 class="content-title divided">
|
||||
{% if site.paginate and site.paginate_path and paginator.page > 1 %}
|
||||
Page {{ paginator.page }}
|
||||
{% else %}
|
||||
@ -54,16 +34,7 @@ layout: default
|
||||
|
||||
<ul class="post-list">
|
||||
{% for post in paginator.posts %}
|
||||
<li>
|
||||
<a href="{{ post.url | absolute_url }}" class="post-link">
|
||||
<span class="post-title">
|
||||
{{ post.title }}
|
||||
</span>
|
||||
<span class="post-date">
|
||||
{{ post.date | date: "%b %-d, '%y" }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% include post-list-item.html %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@ -89,16 +60,7 @@ layout: default
|
||||
|
||||
<ul class="post-list">
|
||||
{% for post in site.posts %}
|
||||
<li>
|
||||
<a href="{{ post.url | absolute_url }}" class="post-link">
|
||||
<span class="post-title">
|
||||
{{ post.title }}
|
||||
</span>
|
||||
<span class="post-date">
|
||||
{{ post.date | date: "%b %-d, '%y" }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% include post-list-item.html %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
@ -6,9 +6,11 @@ layout: default
|
||||
|
||||
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
|
||||
{% unless page.title == "" %}
|
||||
<h1 class="post-title divided p-name" itemprop="name headline">
|
||||
{{ page.title }}
|
||||
</h1>
|
||||
{% endunless %}
|
||||
|
||||
<div class="post-content e-content" itemprop="articleBody">
|
||||
{{ content }}
|
||||
|
@ -1,9 +1,8 @@
|
||||
---
|
||||
title: ""
|
||||
layout: post
|
||||
title: "The Adventure of the Veiled Lodger"
|
||||
author: "Arthur Conan Doyle"
|
||||
categories: literature
|
||||
author: Arthur Conan Doyle
|
||||
---
|
||||
|
||||
When one considers that Mr. Sherlock Holmes was in active practice for twenty-three years, and that during seventeen of these I was allowed to cooperate with him and to keep notes of his doings, it will be clear that I have a mass of material at my command. The problem has always been not to find but to choose. There is the long row of year-books which fill a shelf, and there are the dispatch-cases filled with documents, a perfect quarry for the student not only of crime but of the social and official scandals of the late Victorian era. Concerning these latter, I may say that the writers of agonized letters, who beg that the honour of their families or the reputation of famous forebears may not be touched, have nothing to fear. The discretion and high sense of professional honour which have always distinguished my friend are still at work in the choice of these memoirs, and no confidence will be abused. I deprecate, however, in the strongest way the attempts which have been made lately to get at and to destroy these papers. The source of these outrages is known, and if they are repeated I have Mr. Holmes's authority for saying that the whole story concerning the politician, the lighthouse, and the trained cormorant will be given to the public. There is at least one reader who will understand.
|
||||
|
8
_posts/2018-07-24-the-adventure-of-the-veiled-lodger.md
Normal file
8
_posts/2018-07-24-the-adventure-of-the-veiled-lodger.md
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: ""
|
||||
layout: post
|
||||
author: "Pat Dryburgh"
|
||||
categories: opinion
|
||||
---
|
||||
|
||||
Not all posts need a title.
|
@ -36,6 +36,10 @@
|
||||
margin-right: 1.5rem;
|
||||
}
|
||||
|
||||
.post-content:first-child {
|
||||
margin-top: 4em;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
margin-bottom: 2em;
|
||||
margin-top: 2em;
|
||||
|
@ -81,7 +81,7 @@ hr {
|
||||
padding: 4em 1em;
|
||||
}
|
||||
|
||||
.home h1 {
|
||||
.content-title {
|
||||
font-size: 2em;
|
||||
margin-bottom: 2em;
|
||||
text-align: center;
|
||||
@ -99,7 +99,7 @@ hr {
|
||||
}
|
||||
|
||||
.site-credits {
|
||||
margin: 2em auto;
|
||||
margin: 0 auto 2em;
|
||||
padding: 0 2em;
|
||||
text-align: center;
|
||||
}
|
@ -27,31 +27,3 @@
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
|
||||
.site-navigation {
|
||||
margin-top: 4rem;
|
||||
}
|
||||
|
||||
.site-navigation ul {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.site-navigation li {
|
||||
list-style: none;
|
||||
font-size: .875em;
|
||||
font-variant: small-caps;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.site-navigation a {
|
||||
display: block;
|
||||
padding: .25em .5em;
|
||||
text-decoration: none;
|
||||
&:hover,
|
||||
&:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
27
_sass/_menu.scss
Normal file
27
_sass/_menu.scss
Normal file
@ -0,0 +1,27 @@
|
||||
.site-navigation {
|
||||
margin-top: 4rem;
|
||||
}
|
||||
|
||||
.site-navigation ul {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.site-navigation li {
|
||||
list-style: none;
|
||||
font-size: .875em;
|
||||
font-variant: small-caps;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.site-navigation a {
|
||||
display: block;
|
||||
padding: .25em .5em;
|
||||
text-decoration: none;
|
||||
&:hover,
|
||||
&:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
@ -24,6 +24,9 @@
|
||||
.post-title {
|
||||
margin-right: 4em;
|
||||
}
|
||||
.post-date {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ $asset_url: '{{ '/assets' | absolute_url }}';
|
||||
"font",
|
||||
"base",
|
||||
"masthead",
|
||||
"menu",
|
||||
"post-list",
|
||||
"article"
|
||||
;
|
Reference in New Issue
Block a user