Create theme 3

This commit is contained in:
BBaoVanC 2021-10-01 14:12:39 -05:00
parent 4706208211
commit c961682d04
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
5 changed files with 32 additions and 71 deletions

View File

@ -1,78 +1,42 @@
/* Layout */ /* Layout */
.page { .content, .footer {
display: flex;
}
.side, .content, .footer {
padding: 20px; padding: 20px;
} }
#navbar { .header a, #navbar {
overflow: hidden; padding-left: 20px;
} }
#navbar a { .navbar-item {
float: left; margin-right: 5px;
display: block;
padding: 14px 20px;
}
.navbar-items {
float: right;
} }
body { body {
margin: 0; margin: 0;
display: flex; max-width: 720px;
flex-direction: column;
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@media screen and (max-width: 700px) {
.page {
flex-direction: column;
}
.navbar-items a {
width: 100%;
}
}
/* Styling */ /* Styling */
.side {
background-color: #111;
color: lightgray;
}
.content {
color: lightgray;
max-width: 720px;
}
.footer { .footer {
text-align: center; text-align: center;
background: #ddd; background: #ddd;
} }
#navbar { .header a, #navbar {
background-color: #091a2c; color: inherit;
} text-decoration: inherit;
#navbar a {
color: lightgray;
text-align: center;
text-decoration: none;
}
#navbar a:hover {
background-color: #0e2a46;
color: white;
} }
body { body {
background-color: black; background-color: black;
color: lightgray;
font-family: sans-serif; font-family: sans-serif;
} }
a { a {

View File

@ -4,21 +4,12 @@
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
<body> <body>
{{ partial "navbar.html" . }} {{ partial "header.html" . }}
<div class="page"> <div class="content">
{{ if and .Params.Toc .IsPage }} {{- block "main" . }}
<div class="side"> {{ .Content }}
<h3>Table of Contents</h3> {{- end }}
{{ .TableOfContents }}
</div>
{{ end }}
<div class="content">
{{- block "main" . }}
{{ .Content }}
{{- end }}
</div>
</div> </div>
{{- partial "footer.html" . -}} {{- partial "footer.html" . -}}

View File

@ -23,5 +23,12 @@
{{ end }} {{ end }}
</span> </span>
{{ if .Params.Toc }}
<div id="table-of-contents">
<h3>Table of Contents</h3>
{{ .TableOfContents }}
</div>
{{ end }}
{{ .Content }} {{ .Content }}
{{ end }} {{ end }}

View File

@ -0,0 +1,10 @@
<h2 class="header">
<a href="{{ "/" | relURL }}">{{ .Site.Title | markdownify }}</a>
</h2>
<nav id="navbar">
<a class="navbar-item" href="{{ "/" | relURL }}">Home</a>
{{ range .Site.Menus.main }}
<a class="navbar-item" href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>

View File

@ -1,11 +0,0 @@
<nav id="navbar">
<div class="navbar-title">
<a href="{{ "/" | relURL }}">{{ .Site.Title | markdownify }}</a>
</div>
<div class="navbar-items">
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</div>
</nav>