Browse Source

Some more css and html consolidation (sidebar and post lists)

master
Josef Eberle 9 months ago
parent
commit
4a17f467cc

+ 1
- 1
content/posts/2-some-test-post.md View File

@@ -1,5 +1,5 @@
---
title: "2 Some Test Post"
title: "Some Test Post"
description: "Just there to test some things"
date: 2018-12-31T20:10:37+01:00
lastmod: 2018-12-31T20:10:37+01:00

+ 11
- 0
content/posts/3-the-thrid-one.md View File

@@ -0,0 +1,11 @@
---
title: "The Thrid One"
description: "Another one to test the waters"
date: 2019-01-06T21:23:03+01:00
lastmod: 2019-01-06T21:23:03+01:00
tags: ["test"]
draft: false
toc: false
showpagemeta: true
---


+ 28
- 22
themes/hykumi/assets/scss/hykumi/_list.scss View File

@@ -1,33 +1,39 @@
.list-title {
.list-small {
font-family: $sidebar-font-family;
margin-top: 0;
}
ul {
list-style: none;
padding: 0;
margin: 0 0 1rem 0;
}

.post-list-item {
margin-bottom: 3em;
.list-title {
margin: 0 0 1rem 0;
}
}

.post-list-title {
margin-top: 0em;
display: block;
font-size: $item__title-big-font-size;
line-height: $h1-line-height;
.list-big {
font-family: $sidebar-font-family;
}

.post-list-date {
color: $item__date-color;
display: block;
font-size: $item__date-font-size;
margin-bottom: .2rem;
margin-top: .2rem;
.list-item {
margin-bottom: 1rem;
}
.list-title {
margin: 0;
display: block;
}
.list-date {
color: $content-accent;
display: block;
}
.list-description {
font-family: $content-font-family;
}
}

.pull-right {
float: right;
}

.draft {
color: #999 !important;
}

+ 33
- 28
themes/hykumi/assets/scss/hykumi/_post.scss View File

@@ -38,24 +38,8 @@
padding: 0.5em;
color: $content-background;
background: $content-foreground;
label {
background: $close-icon-content no-repeat right center;
display: block;
cursor: pointer;
}
a {
color: $content-link-i-rev;
&:hover,
&:focus {
color: $content-link-a-rev;
}
}
}
#TableOfContents {
overflow: hidden;
margin-top: 0;
max-height: 100%;
ul {
padding-left: 1rem;
list-style-type: none;
@@ -65,19 +49,39 @@
margin: 0;
}
}
}
input#tocToggle {
display: none;
+ label {

a {
color: $content-link-i-rev;
&:hover,
&:focus {
color: $content-link-a-rev;
}
}
input#tocToggle + label {
display: block;
cursor: pointer;
font-weight: bold;
}
&:checked {
+ label {
background-image: $open-icon-content;
input#tocToggle {
display: none;
&:checked {
+ label {
background: $close-icon-content no-repeat right center;
}
~ #TableOfContents {
max-height: 100%;
}
}
~ #TableOfContents {
max-height: 0;
&:not(:checked) {
+ label {
background: $open-icon-content no-repeat right center;
}
~ #TableOfContents {
max-height: 0;
overflow: hidden;
}
}
}
}
@@ -148,7 +152,8 @@
}
a {
color: $content-link-i-rev;
&:hover {
&:hover,
&:focus {
color: $content-link-a-rev;
}
}

+ 0
- 3
themes/hykumi/assets/scss/hykumi/_responsive.scss View File

@@ -11,7 +11,6 @@
top: 0;
background-image: $sidebar-bg-img-ls;
width: 100%;
margin: 0;
padding: 0;
.sidebar-content {
@@ -29,9 +28,7 @@
input#sidebarMenuToggle + label {
display: block;
cursor: pointer;
color: $sidebar-foreground;
padding: 0.75rem 0 0.75rem 0;
font-weight: bold;
font-size: 1.5rem;
line-height: 1.5rem;
}

+ 2
- 3
themes/hykumi/assets/scss/hykumi/_sidebar.scss View File

@@ -1,5 +1,6 @@
.sidebar {
background-color: $sidebar-background;
background-size: cover;
color: $sidebar-foreground;
padding: 2rem;
text-align: center;
@@ -8,9 +9,7 @@
a {
color: $sidebar-link-i;
&:hover {
color: $sidebar-link-a;
}
&:hover,
&:focus {
color: $sidebar-link-a;
}

+ 8
- 6
themes/hykumi/layouts/_default/list.html View File

@@ -2,10 +2,12 @@
{{ partial "header.html" . }}
{{ end }}
{{ define "content" }}
<h1 class="list-title">{{ .Title }}</h1>
<ul class="posts">
{{ with .Data.Pages }}
{{ partial "posts-list.html" . }}
{{ end }}
</ul>
<div class="list-small">
<h1 class="list-title">{{ .Title }}</h1>
<ul>
{{ with .Data.Pages }}
{{ partial "posts-list.html" . }}
{{ end }}
</ul>
</div>
{{ end }}

+ 1
- 1
themes/hykumi/layouts/_default/single.html View File

@@ -35,7 +35,7 @@
{{ $tableOfContents := .TableOfContents }}
{{ if .Params.toc }}
<div class="post-toc">
<input type="checkbox" id="tocToggle" checked>
<input type="checkbox" id="tocToggle">
<label for="tocToggle"><span class="post-toc-title">Table of Contents</span></label>
{{ $tableOfContents }}
</div>

+ 8
- 14
themes/hykumi/layouts/index.html View File

@@ -2,22 +2,17 @@
{{ partial "header.html" . }}
{{ end }}
{{ define "content" }}
<div class="post-list">
<div class="list-big">
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
{{ range $paginator.Pages }}
{{ if .Draft }}
{{ .Scratch.Set "draftPage" true }}
{{ else }}
{{ .Scratch.Set "draftPage" false }}
{{ end }}
<div class="post-list-item">
<span class="post-list-title">
<a href="{{ .RelPermalink }}" {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>{{ .Title }}</a>
</span>
<span class="post-list-date">
<div class="list-item">
<h1 class="list-title">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h1>
<span class="list-date">
{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
</span>
<span {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>
<span class="list-description">
{{ if .Description }}
{{ .Description }}
{{ else }}
@@ -25,10 +20,9 @@
{{ end }}
</span>
{{ if and (not .Description) .Truncated }}
<a class="post-list-readmore" href="{{ .RelPermalink }}">... -></a>
<a class="list-readmore" href="{{ .RelPermalink }}">... -></a>
{{ end }}
</div>
{{ .Scratch.Delete "draftPage" }}
{{ end }}
</div>
{{ end }}

+ 1
- 1
themes/hykumi/layouts/partials/header.html View File

@@ -2,7 +2,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="public" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">
<meta name="theme-color" content="#1D1F21">
<link rel="icon" sizes="192x192" href="/img/logo.png">
{{ .Hugo.Generator }}

+ 2
- 2
themes/hykumi/layouts/partials/posts-list.html View File

@@ -1,7 +1,7 @@
{{ range . }}
<li>
<span class="list__title--small">
<a href="{{ .RelPermalink }}" {{if .Draft}}class="draft"{{end}}>{{ .Title }}</a>
<span>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{if not .Date.IsZero}}
<time class="pull-right">{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}</time>
{{end}}

Loading…
Cancel
Save