Fix #9 and other design updates

This commit is contained in:
Dmitry Kolosov 2020-02-02 18:01:10 +03:00
parent 5af22d3c89
commit 0dce9b9431
8 changed files with 88 additions and 51 deletions

View File

@ -4,7 +4,9 @@
<header>
<h1>{{ .Title }}</h1>
</header>
<div class="content">
{{ .Content }}
</div>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
@ -27,8 +29,6 @@
</ul>
{{ end }}
</div>
{{ .Content }}
</article>
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}

View File

@ -8,6 +8,14 @@
</h1>
</header>
<div class="content">
{{ .Summary | safeHTML }}
</div>
<!-- {{ if .Truncated }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }} -->
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
@ -30,15 +38,6 @@
</ul>
{{ end }}
</div>
<div class="content">
{{ .Summary | safeHTML }}
</div>
{{ if .Truncated }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }}
</article>
{{ end }}
{{ partial "pagination.html" . }}

View File

@ -12,7 +12,7 @@
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon-precomposed" href="/favicon.png">
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" />
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}?rnd={{ now.Unix }}" />
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}

View File

@ -1,4 +1,4 @@
<h1>
<h1 class="site-header">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</h1>
<nav>

View File

@ -2,22 +2,18 @@
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
<div class="pagination">
<div class="left">
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
{{ if .Paginator.HasPrev }}
{{ if eq .Paginator.PageNumber 2 }}
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
{{ else }}
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
<a href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
{{ end }}
{{ else }}
<span class="pagination-item disabled">{{ $toNewPostsMessage }}</span>
{{ end }}
</div>
<div class="right">
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
{{ if .Paginator.HasNext }}
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
{{ else }}
<span class="pagination-item disabled">{{ $toOldPostsMessage }}</span>
<a href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
{{ end }}
</div>
</div>

View File

@ -12,19 +12,19 @@
</h1>
</header>
<div class="content">
{{ .Summary }}
</div>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
{{ end }}
</div>
<div class="content">
{{ .Summary }}
</div>
{{ if .Truncated }}
<!-- {{ if .Truncated }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }}
{{ end }} -->
</article>
{{ end }}

View File

@ -11,20 +11,19 @@
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h1>
</header>
<div class="content">
{{ .Summary }}
</div>
<div class="article-info">
{{ if .Params.date }}
<div class="article-date">{{ .Params.date.Format "2006-01-02" }}</div>
{{ end }}
</div>
<div class="content">
{{ .Summary }}
</div>
{{ if .Truncated }}
<!-- {{ if .Truncated }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }}
{{ end }} -->
</article>
{{ end }}

View File

@ -112,15 +112,21 @@ header nav a {
margin-left: 2em;
}
header a {
color: #333;
}
.site-header {
white-space: nowrap;
}
/* Pages */
main h1 {
margin-top: 1em;
margin-bottom: 0 ;
font-weight: normal;
font-size: 1.7em;
line-height: 1.1em;
margin-bottom: 0.5em;
}
.post-short-list:first-of-type {
@ -136,10 +142,9 @@ article:not(:last-of-type) {
}
article header h1 {
font-size: 2.1em;
line-height: 1.3em;
margin-bottom: 0;
font-weight: bold;
font-size: 1.7em;
line-height: 1.1em;
margin-bottom: 0.5em;
}
article header h1 a {
@ -149,14 +154,18 @@ article header h1 a {
}
.article-info {
display: inline-block;
font-size: 0.75em;
color: grey;
margin-bottom: 1em;
margin-top: 1em;
}
.post-short-list .article-info {
margin-top: 0;
margin-bottom: 1.5em;
}
.article-date {
display: inline;
white-space: nowrap;
}
.article-categories {
@ -172,12 +181,15 @@ article header h1 a {
}
.article-tags {
display: inline;
list-style-type: none;
padding: 0;
margin: 0;
}
.article-tags li:first-of-type {
margin-left: 0;
}
.article-tags li {
display: inline;
margin-left: 1em;
@ -222,19 +234,22 @@ article img {
text-align: center;
}
.pagination a, .pagination .disabled {
.pagination-item {
background: #fafafa;
border: thin solid #f3f3f3;
color: #333333;
padding: 0.75em 0.75em;
}
.pagination .disabled {
.disabled {
visibility: hidden;
}
.pagination a:hover, .pagination a:focus {
.pagination-item a {
color: #333333;
}
.pagination-item a:hover, .pagination-item a:focus {
color: #a31d1d;
border-bottom: 0;
}
/* Footer */
@ -260,5 +275,33 @@ footer {
max-width: 90%;
margin: 0 auto;
}
}
.pagination-item {
padding: 0.5em 0.5em;
font-size: 14px;
}
header {
display: block;
}
.site-header {
text-align: center;
}
header nav {
margin-top: 1em;
max-width: 100%;
text-align: center;
background: #fafafa;
padding: 0.5em 0;
}
header nav a:first-of-type {
margin-left: 0;
}
header nav a {
margin-left: 5%;
}
}