mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 11:29:28 +00:00
Add menu to blog pages
This commit is contained in:
parent
d746c8eec3
commit
4ce973a4e2
@ -26,6 +26,10 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mr-auto {
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.hide {
|
.hide {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -158,6 +158,7 @@ ul.pagination {
|
|||||||
// Responsive styles
|
// Responsive styles
|
||||||
aside nav,
|
aside nav,
|
||||||
.book-page,
|
.book-page,
|
||||||
|
.book-posts,
|
||||||
.markdown {
|
.markdown {
|
||||||
transition: 0.2s ease-in-out;
|
transition: 0.2s ease-in-out;
|
||||||
transition-property: transform, margin-left, opacity;
|
transition-property: transform, margin-left, opacity;
|
||||||
@ -181,7 +182,8 @@ aside nav,
|
|||||||
|
|
||||||
#menu-control:checked + main {
|
#menu-control:checked + main {
|
||||||
.book-menu nav,
|
.book-menu nav,
|
||||||
.book-page {
|
.book-page,
|
||||||
|
.book-posts {
|
||||||
transform: translateX($menu-width);
|
transform: translateX($menu-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
.markdown{line-height:1.7}.markdown>:first-child{margin-top:0;line-height:1em}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace}.markdown p code{padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table tr td{padding:.5rem}.flex{display:flex}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}.hide{display:none}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html,body{min-width:25rem;overflow-x:hidden}body{color:#343a40;background:#fff;font-family:oxygen,sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside nav ul{padding:0;margin:0;list-style:none}aside nav ul li{margin:1em 0}aside nav ul a{display:block}aside nav ul a:hover{opacity:.5}aside nav ul ul{padding-left:1rem}ul.pagination{display:flex;justify-content:center}ul.pagination .page-item a{padding:1rem}.container{min-width:25rem;max-width:80rem;margin:0 auto}.book-brand{margin-top:0}.book-menu{flex:0 0 18rem;font-size:.875rem}.book-menu nav{width:18rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-menu a{color:#343a40}.book-menu a.active{color:#004ed0}.book-page{min-width:25rem;padding:1rem}.book-header{margin-bottom:1rem;display:none}.book-toc{flex:0 0 14rem;font-size:.75rem}.book-toc nav{width:14rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-toc nav>ul>li{margin:0}.book-git-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-git-footer img{width:.875rem;vertical-align:bottom}.book-posts{min-width:25rem;max-width:43rem;padding:1rem}.book-posts article{padding-bottom:1rem}aside nav,.book-page,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}@media screen and (max-width:57rem){.book-toc{display:none}}@media screen and (max-width:43rem){.book-menu{margin-left:-18rem}.book-header{display:flex}#menu-control:checked+main .book-menu nav,#menu-control:checked+main .book-page{transform:translateX(18rem)}#menu-control:checked+main .book-header label{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:80rem){.book-page,.book-menu nav,.book-toc nav{padding:2rem 1rem}}
|
.markdown{line-height:1.7}.markdown>:first-child{margin-top:0;line-height:1em}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5{font-weight:400;line-height:1.25}.markdown b,.markdown optgroup,.markdown strong{font-weight:700}.markdown a{text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{font-family:oxygen mono,monospace}.markdown p code{padding:0 .25rem;background:#f8f9fa;border-radius:.15rem}.markdown pre{padding:1rem;background:#f8f9fa;border-radius:.15rem;font-size:.875rem;overflow-x:auto}.markdown blockquote{border-left:2px solid #dee2e6;margin:0;padding:1px 1rem}.markdown blockquote :first-child{margin-top:0}.markdown blockquote :last-child{margin-bottom:0}.markdown table tr td{padding:.5rem}.flex{display:flex}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}.mr-auto{margin-right:auto}.hide{display:none}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html,body{min-width:25rem;overflow-x:hidden}body{color:#343a40;background:#fff;font-family:oxygen,sans-serif;font-weight:400;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5{font-weight:400}a{text-decoration:none;color:#004ed0}a:visited{color:#8440f1}img{vertical-align:middle}aside nav ul{padding:0;margin:0;list-style:none}aside nav ul li{margin:1em 0}aside nav ul a{display:block}aside nav ul a:hover{opacity:.5}aside nav ul ul{padding-left:1rem}ul.pagination{display:flex;justify-content:center}ul.pagination .page-item a{padding:1rem}.container{min-width:25rem;max-width:80rem;margin:0 auto}.book-brand{margin-top:0}.book-menu{flex:0 0 18rem;font-size:.875rem}.book-menu nav{width:18rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-menu a{color:#343a40}.book-menu a.active{color:#004ed0}.book-page{min-width:25rem;padding:1rem}.book-header{margin-bottom:1rem;display:none}.book-toc{flex:0 0 14rem;font-size:.75rem}.book-toc nav{width:14rem;padding:1rem;position:fixed;top:0;bottom:0;overflow-x:hidden;overflow-y:auto}.book-toc nav>ul>li{margin:0}.book-git-footer{display:flex;margin-top:1rem;font-size:.875rem;align-items:baseline}.book-git-footer img{width:.875rem;vertical-align:bottom}.book-posts{min-width:25rem;max-width:43rem;padding:1rem}.book-posts article{padding-bottom:1rem}aside nav,.book-page,.book-posts,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}@media screen and (max-width:57rem){.book-toc{display:none}}@media screen and (max-width:43rem){.book-menu{margin-left:-18rem}.book-header{display:flex}#menu-control:checked+main .book-menu nav,#menu-control:checked+main .book-page,#menu-control:checked+main .book-posts{transform:translateX(18rem)}#menu-control:checked+main .book-header label{transform:rotate(90deg)}#menu-control:checked+main .markdown{opacity:.25}}@media screen and (min-width:80rem){.book-page,.book-menu nav,.book-toc nav{padding:2rem 1rem}}
|
@ -1 +1 @@
|
|||||||
{"Target":"book.min.9caf26ee2daca225930c0f85fd9eaa9f543aea51e1c0f8096e61e8a6706ae066.css","MediaType":"text/css","Data":{"Integrity":"sha256-nK8m7i2soiWTDA+F/Z6qn1Q66lHhwPgJbmHopnBq4GY="}}
|
{"Target":"book.min.29d743ffb6d61ecbfc9bb21b7eab17d63b577d4bd547c3f095addb1c793ab1b1.css","MediaType":"text/css","Data":{"Integrity":"sha256-KddD/7bWHsv8m7IbfqsX1jtXfUvVR8Pwla3bHHk6sbE="}}
|
@ -12,18 +12,7 @@
|
|||||||
<main class="flex container">
|
<main class="flex container">
|
||||||
|
|
||||||
<aside class="book-menu fixed">
|
<aside class="book-menu fixed">
|
||||||
<nav role="navigation">
|
{{ partial "docs/menu" . }}
|
||||||
{{ partial "docs/brand" . }}
|
|
||||||
{{ partial "docs/inject/menu-before" . }}
|
|
||||||
|
|
||||||
{{ if .Site.Params.BookMenuBundle }}
|
|
||||||
{{ partial "docs/menu-bundle" . }}
|
|
||||||
{{ else }}
|
|
||||||
{{ partial "docs/menu-filetree" . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ partial "docs/inject/menu-after" . }}
|
|
||||||
</nav>
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div class="book-page">
|
<div class="book-page">
|
||||||
|
12
layouts/partials/docs/menu.html
Normal file
12
layouts/partials/docs/menu.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<nav role="navigation">
|
||||||
|
{{ partial "docs/brand" . }}
|
||||||
|
{{ partial "docs/inject/menu-before" . }}
|
||||||
|
|
||||||
|
{{ if .Site.Params.BookMenuBundle }}
|
||||||
|
{{ partial "docs/menu-bundle" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ partial "docs/menu-filetree" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "docs/inject/menu-after" . }}
|
||||||
|
</nav>
|
@ -8,9 +8,18 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<main class="book-posts mx-auto">
|
<input type="checkbox" style="display: none" id="menu-control" />
|
||||||
{{ template "main" . }}
|
<main class="flex container">
|
||||||
|
<aside class="book-menu fixed">
|
||||||
|
{{ partial "docs/menu" . }}
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<div class="book-posts mr-auto">
|
||||||
|
{{ partial "docs/mobile-header" . }}
|
||||||
|
{{ template "main" . }}
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
{{ partial "docs/inject/body" . }}
|
{{ partial "docs/inject/body" . }}
|
||||||
{{ template "_internal/google_analytics_async.html" . }}
|
{{ template "_internal/google_analytics_async.html" . }}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<h5>
|
<h5>
|
||||||
<strong>{{ .Date.Format "January 2, 2006" }}</strong>
|
<strong>{{ .Date.Format "January 2, 2006" }}</strong>
|
||||||
</h5>
|
</h5>
|
||||||
<p>
|
<p class="markdown">
|
||||||
{{- .Summary -}}
|
{{- .Summary -}}
|
||||||
{{ if .Truncated }}
|
{{ if .Truncated }}
|
||||||
<a href="{{ .Permalink }}">...</a>
|
<a href="{{ .Permalink }}">...</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user