Layout updates

This commit is contained in:
Jesper Hess 2016-04-06 18:15:42 +02:00
parent ebf20641bf
commit bef7dc6c73
7 changed files with 372 additions and 156 deletions

View File

@ -1,18 +1,12 @@
<aside>
<div class="container">
<nav>
<ul>
{% for page in site.pages %} {% if page.title %}
<li><a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a></li>
{% endif %} {% endfor %}
<li><a href="{{ "/blog" | prepend: site.baseurl }}">Blog</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</aside>
<header>
<h1><a href="{{ site.url }}">{{ site.title }}</a></h1>
</header>
<header class="site-header">
<div class="wrapper">
<a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>
</div>
<div class="wrapper"><small>This site is also available as a Tor hidden service here: <a href="http://mjfjbs3547exsy6r.onion">http://mjfjbs3547exsy6r.onion</a> </small></div>
</header>

View File

@ -1,15 +1,10 @@
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<main>
<article>
{% include head.html %}
<body>
{% include header.html %}
<div class="page-content">
{{ content }}
</article>
{% include footer.html %}
</main>
</body>
</html>
</div>
</body>
</html>

View File

@ -1,7 +1,11 @@
---
layout: default
---
<h2>{{ page.title }}</h2>
{{ content }}
<article class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<div class="post-content">
{{ content }}
</div>
</article>

View File

@ -1,8 +1,12 @@
---
layout: default
---
<h2>{{ page.title }}</h2>
<time>{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</time>
{{ content }}
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
</header>
<div class="post-content" itemprop="articleBody">
{{ content }}
</div>
</article>

View File

@ -1,18 +1,193 @@
$content-width: 800px;
$main: #19CCAA;
$font-style: 'Open Sans', sans-serif;
$font-color: #262626;
$link-color: #425469;
$link-hover-color: $main;
$heading-font: 'Muli', sans-serif;
$heading-font-color: #425469;
$light: #E7EDF4;
$header: #1D1425;
/**
* Reset some basic elements
*/
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
margin: 0;
padding: 0;
}
*,
*::before,
*::after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/**
* Basic styling
*/
body {
font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
color: $text-color;
background-color: $background-color;
}
/**
* Set `margin-bottom` to maintain vertical rhythm
*/
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure, table,
%vertical-rhythm {
margin-bottom: $spacing-unit / 2;
}
/**
* Images
*/
img {
max-width: 100%;
vertical-align: middle;
}
/**
* Figures
*/
figure > img {
display: block;
}
figcaption {
font-size: $small-font-size;
}
/**
* Lists
*/
ul, ol {
margin-left: $spacing-unit;
}
li {
> ul,
> ol {
margin-bottom: 0;
}
}
/**
* Headings
*/
h1, h2, h3, h4, h5, h6 {
font-weight: $base-font-weight;
}
/**
* Links
*/
a {
color: $brand-color;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
/**
* Blockquotes
*/
blockquote {
color: $grey-color;
padding-left: $spacing-unit / 2;
border-left: 2px solid $grey-color-light;
font-style: italic;
font-size: $small-font-size;
> :last-child {
margin-bottom: 0;
}
}
/**
* Code formatting
*/
pre,
code {
background-color: #fcfcfc;
}
code {
padding: 1px 5px;
font-family: $code-font-family;
}
pre {
padding: 8px 12px;
overflow-x: auto;
border-left: 2px solid $grey-color-light;
> code {
border: 0;
padding-right: 0;
padding-left: 0;
tab-size: 4;
}
}
/**
* Table
*/
table {
width: 100%;
max-width: 100%;
border-collapse: separate;
border-spacing: 0;
table-layout: fixed;
}
th,
td {
padding: 0.5rem;
line-height: inherit;
}
th {
text-align: left;
vertical-align: bottom;
border-bottom: 2px solid $grey-color-light;
}
td {
vertical-align: top;
border-bottom: 1px solid $grey-color-light;
}
/**
* Horizontal rule
*/
hr {
width: 30%;
border: none;
border-top: 1px solid lighten($brand-color, 30%);;
margin: $spacing-unit auto;
}
/**
* Clearfix
*/
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}

View File

@ -1,111 +1,110 @@
body {
margin: 0;
color: $font-color;
font-family: $font-style;
font-size: 1.1em;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
/**
* Site header
*/
.site-header {
border-bottom: 1px solid $grey-color-light;
text-align: center;
padding: 1rem 0;
}
h1,
h2,
h3 {
font-weight: 600;
color: $heading-font-color;
font-family: $heading-font;
line-height: 1.5;
}
h1 {
color: $main;
font-size: 2.5em;
a,
a:visited {
.site-title {
font-size: 1.5rem;
font-weight: 300;
letter-spacing: -1px;
color: $grey-color-dark;
&,
&:hover {
text-decoration: none;
color: $main;
}
}
h2 {
font-size: 2em;
}
a,
a:visited {
color: $link-color;
text-decoration: underline;
font-weight: bold;
}
a:hover {
color: $link-hover-color;
text-decoration: underline;
}
header {
background: $header;
padding: 0px 15px;
text-align: center;
margin: 50px 0 0;
height: 50vh;
display: flex;
justify-content: center;
align-items: center;
}
main {
padding: 0 15px;
max-width: $content-width;
margin: 0 auto;
}
time {
color: #898989;
}
.container {
max-width: $content-width;
/**
* Page content
*/
.page-content {
position: relative;
max-width: 48rem;
padding: $spacing-unit ($spacing-unit * 0.75);
margin: 0 auto;
box-sizing: border-box;
}
/* Aside */
aside {
position: fixed;
top: 0;
left: 0;
background: #fff;
width: 100%;
z-index: 2;
border-bottom: 1px solid lighten($light, 30%);
box-shadow: 0px 1px 1px RGBA(4, 25, 54, .1);
nav {
float: left;
max-width: 800px;
margin: 0 auto;
ul {
margin: 0;
padding: 0;
list-style: none;
li {
float: left;
position: relative;
a {
text-decoration: none;
display: block;
padding: 15px;
font-family: 'Muli', sans-serif;
line-height: 20px;
margin-bottom: -1px;
box-shadow: 0;
&:hover,
&:active {
background: $header;
text-decoration: none;
color: $main;
}
}
}
}
&:after {
content: '';
display: table;
clear: both;
/**
* Pages
*/
.home {
section + section {
margin-top: $spacing-unit;
}
}
.smallcap {
text-transform: lowercase;
font-variant: small-caps;
&::first-letter {
text-transform: uppercase;
}
}
.post-list > li {
margin-bottom: $spacing-unit / 4;
@include media-query($on-palm) {
span {
display: block;
font-size: $small-font-size;
}
}
}
footer {
text-align: center;
padding: 40px;
}
/**
* Posts
*/
.post-header {
margin-bottom: $spacing-unit;
}
.post-title {
font-size: 2rem;
letter-spacing: -1px;
line-height: 1;
}
.post-meta {
font-size: $small-font-size;
color: $grey-color;
}
.post-content {
margin-bottom: $spacing-unit;
h1, h2, h3,
h4, h5, h6 {
margin-top: 2rem;
}
h1,
h2 {
font-size: 2rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1.25rem;
}
h5,
h6 {
font-size: 1rem;
}
}

View File

@ -1,7 +1,52 @@
---
# Front matter comment to ensure Jekyll properly reads file.
# Only the main Sass file needs front matter (the dashes are enough)
---
@import
"base",
"layout",
"syntax-highlighting"
@charset "utf-8";
// Our variables
$base-font-family: "Cutive Mono", "Courier New", "Helvetica Neue", Helvetica, FangSong, STFangsong, sans-serif;
$code-font-family: "Courier New", Consolas, monopace, FangSong, STFangsong;
$base-font-size: 16px;
$base-font-weight: 400;
$small-font-size: 0.875rem;
$base-line-height: 1.5;
$spacing-unit: 2rem;
$text-color: #111;
$background-color: #fff;
$brand-color: #2a7ae2;
$grey-color: #828282;
$grey-color-light: lighten($grey-color, 40%);
$grey-color-dark: darken($grey-color, 25%);
// Width of the content area
$on-palm: 600px;
$on-laptop: 800px;
// Use media queries like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }
@mixin media-query($device) {
@media screen and (max-width: $device) {
@content;
}
}
// Import partials from `sass_dir` (defaults to `_sass`)
@import
url(https://fonts.googleapis.com/css?family=Cutive+Mono),
"base",
"layout",
"syntax-highlighting"
;