Skip to content

Commit 1a0a16f

Browse files
committed
Center only mainpage and 404
1 parent a03911c commit 1a0a16f

File tree

7 files changed

+256
-235
lines changed

7 files changed

+256
-235
lines changed

assets/scss/_main.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ ol ol {
334334
text-align: center;
335335
}
336336

337-
.content {
337+
.content-center {
338338
display: flex;
339339
flex-direction: column;
340340
flex: 1 auto;
@@ -347,6 +347,19 @@ ol ol {
347347
}
348348
}
349349

350+
.content {
351+
display: flex;
352+
flex-direction: column;
353+
flex: 1 auto;
354+
align-items: center;
355+
justify-content: start;
356+
margin: 0;
357+
358+
@media #{$media-size-phone} {
359+
margin-top: 0;
360+
}
361+
}
362+
350363
hr {
351364
width: 100%;
352365
border: none;

layouts/404.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{{ define "main" }}
2-
<div id="spotlight" class="error-404 animated fadeIn">
3-
<p class="img-404">
4-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cloud-drizzle"><line x1="8" y1="19" x2="8" y2="21"></line><line x1="8" y1="13" x2="8" y2="15"></line><line x1="16" y1="19" x2="16" y2="21"></line><line x1="16" y1="13" x2="16" y2="15"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="12" y1="15" x2="12" y2="17"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>
5-
</p>
6-
<div class="banner-404">
7-
<h1>404</h1>
8-
<p>{{ i18n "notFound" }}</p>
9-
<p class="btn-404">
10-
<a href="{{.Site.BaseURL}}">
11-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
12-
{{- i18n "home" -}}
13-
</a>
14-
<a href="{{ "posts" | absLangURL }}">
15-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
16-
{{- i18n "archives" -}}
17-
</a>
2+
<div class="content-center">
3+
<div id="spotlight" class="error-404 animated fadeIn">
4+
<p class="img-404">
5+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cloud-drizzle"><line x1="8" y1="19" x2="8" y2="21"></line><line x1="8" y1="13" x2="8" y2="15"></line><line x1="16" y1="19" x2="16" y2="21"></line><line x1="16" y1="13" x2="16" y2="15"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="12" y1="15" x2="12" y2="17"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>
186
</p>
7+
<div class="banner-404">
8+
<h1>404</h1>
9+
<p>{{ i18n "notFound" }}</p>
10+
<p class="btn-404">
11+
<a href="{{.Site.BaseURL}}">
12+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
13+
{{- i18n "home" -}}
14+
</a>
15+
<a href="{{ "posts" | absLangURL }}">
16+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
17+
{{- i18n "archives" -}}
18+
</a>
19+
</p>
20+
</div>
1921
</div>
2022
</div>
2123
{{ end }}

layouts/_default/baseof.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
<div class="container">
1212
{{ partial "header.html" . }}
1313

14-
<div class="content">
15-
{{ block "main" . }}{{ end }}
16-
</div>
14+
{{ block "main" . }}{{ end }}
1715

1816
{{ block "footer" . }}
1917
{{ partial "footer.html" . }}

layouts/_default/list.html

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
{{ define "main" }}
22
{{ $paginator := .Paginate .Data.Pages }}
33

4-
<main class="posts">
5-
<h1>{{ .Title }}</h1>
4+
<div class="content">
5+
<main class="posts">
6+
<h1>{{ .Title }}</h1>
67

7-
{{ if .Content }}
8-
<div class="content">{{ .Content }}</div>
9-
{{ end }}
8+
{{ if .Content }}
9+
<div class="content">{{ .Content }}</div>
10+
{{ end }}
1011

11-
{{ range $paginator.Pages.GroupByDate "2006" }}
12-
<div class="posts-group">
13-
<div class="post-year">{{ .Key }}</div>
12+
{{ range $paginator.Pages.GroupByDate "2006" }}
13+
<div class="posts-group">
14+
<div class="post-year">{{ .Key }}</div>
1415

15-
<ul class="posts-list">
16-
{{ range .Pages }}
17-
<li class="post-item">
18-
<a href="{{.Permalink}}" class="post-item-inner">
19-
<span class="post-title">{{.Title}}</span>
20-
<span class="post-day">
21-
{{ if .Site.Params.dateformShort }}
22-
{{ time.Format .Site.Params.dateformShort .Date }}
23-
{{ else }}
24-
{{ time.Format "Jan 2" .Date }}
25-
{{ end }}
26-
</span>
27-
</a>
28-
</li>
29-
{{ end }}
30-
</ul>
31-
</div>
32-
{{ end }}
33-
{{ partial "pagination-list.html" . }}
34-
</main>
16+
<ul class="posts-list">
17+
{{ range .Pages }}
18+
<li class="post-item">
19+
<a href="{{.Permalink}}" class="post-item-inner">
20+
<span class="post-title">{{.Title}}</span>
21+
<span class="post-day">
22+
{{ if .Site.Params.dateformShort }}
23+
{{ time.Format .Site.Params.dateformShort .Date }}
24+
{{ else }}
25+
{{ time.Format "Jan 2" .Date }}
26+
{{ end }}
27+
</span>
28+
</a>
29+
</li>
30+
{{ end }}
31+
</ul>
32+
</div>
33+
{{ end }}
34+
{{ partial "pagination-list.html" . }}
35+
</main>
36+
</div>
3537
{{ end }}

layouts/_default/single.html

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,54 @@
11
{{ define "main" }}
2-
<main class="post">
2+
<div class="content">
3+
<main class="post">
34

4-
<div class="post-info">
5-
{{ if .IsTranslated }}
6-
{{ i18n "postAvailable" }}
7-
{{ range .Translations }}
8-
<a href="{{ .Permalink }}"><span class="flag fi fi-{{ index $.Site.Data.langFlags (.Lang) }}"></span></a>
9-
{{ end}}
10-
{{ end }}
11-
</p>
12-
</div>
5+
<div class="post-info">
6+
{{ if .IsTranslated }}
7+
{{ i18n "postAvailable" }}
8+
{{ range .Translations }}
9+
<a href="{{ .Permalink }}"><span class="flag fi fi-{{ index $.Site.Data.langFlags (.Lang) }}"></span></a>
10+
{{ end}}
11+
{{ end }}
12+
</p>
13+
</div>
1314

14-
<article>
15-
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
15+
<article>
16+
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
1617

17-
{{ if .Params.Cover }}
18-
<figure class="post-cover">
19-
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />
18+
{{ if .Params.Cover }}
19+
<figure class="post-cover">
20+
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />
21+
22+
{{ if .Params.CoverCaption }}
23+
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
24+
{{ end }}
25+
</figure>
26+
{{ end }}
2027

21-
{{ if .Params.CoverCaption }}
22-
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
23-
{{ end }}
24-
</figure>
25-
{{ end }}
26-
27-
{{ if .Params.toc }}
28-
<hr />
29-
<aside id="toc">
30-
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
31-
{{ .TableOfContents }}
32-
</aside>
33-
<hr />
34-
{{ end }}
28+
{{ if .Params.toc }}
29+
<hr />
30+
<aside id="toc">
31+
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
32+
{{ .TableOfContents }}
33+
</aside>
34+
<hr />
35+
{{ end }}
3536

36-
<div class="post-content">
37-
{{ .Content }}
38-
</div>
39-
</article>
37+
<div class="post-content">
38+
{{ .Content }}
39+
</div>
40+
</article>
4041

41-
<hr />
42+
<hr />
4243

43-
<div class="post-info">
44-
{{ partial "tags.html" .Params.tags }}
45-
{{ partial "categories.html" . }}
44+
<div class="post-info">
45+
{{ partial "tags.html" .Params.tags }}
46+
{{ partial "categories.html" . }}
4647

47-
{{- if .GitInfo }}
48-
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}</p>
49-
{{- end }}
50-
</div>
51-
</main>
48+
{{- if .GitInfo }}
49+
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}</p>
50+
{{- end }}
51+
</div>
52+
</main>
53+
</div>
5254
{{ end }}

layouts/index.html

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
{{ end }}
44

55
{{ define "main" }}
6-
<main>
7-
<div>
8-
{{ if .Site.Params.Portrait.Path }}
9-
<img src="{{ .Site.Params.Portrait.Path }}" class="circle" alt="{{ .Site.Params.Portrait.Alt }}" style="max-width:{{ .Site.Params.Portrait.MaxWidth }}" />
10-
{{ end }}
6+
<div class="content-center">
7+
<main>
8+
<div>
9+
{{ if .Site.Params.Portrait.Path }}
10+
<img src="{{ .Site.Params.Portrait.Path }}" class="circle" alt="{{ .Site.Params.Portrait.Alt }}" style="max-width:{{ .Site.Params.Portrait.MaxWidth }}" />
11+
{{ end }}
1112

12-
<h1>{{ .Site.Title }}</h1>
13+
<h1>{{ .Site.Title }}</h1>
1314

14-
{{ partial "subtitle.html" . }}
15+
{{ partial "subtitle.html" . }}
1516

16-
{{- with .Site.Params.social }}
17-
<div>
18-
{{ partial "social-icons.html" . }}
19-
</div>
20-
{{- end }}
21-
</div>
22-
</main>
17+
{{- with .Site.Params.social }}
18+
<div>
19+
{{ partial "social-icons.html" . }}
20+
</div>
21+
{{- end }}
22+
</div>
23+
</main>
24+
</div>
2325
{{ end }}

0 commit comments

Comments
 (0)