-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blog improvement: new sidebar template (#148)
* Added sidebar template for the blog * Updated readme * Dark mode * Dark mode improvements
- Loading branch information
Showing
9 changed files
with
170 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.blog { | ||
.has-sidebar { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 2rem; | ||
|
||
@media (min-width: 768px) { | ||
flex-wrap: nowrap; | ||
} | ||
} | ||
|
||
.col-sidebar { | ||
width: 100%; | ||
|
||
@media (min-width: 768px) { | ||
min-width: 250px; | ||
} | ||
} | ||
|
||
.blog-sidebar { | ||
position: sticky; | ||
top: 2rem; | ||
|
||
.sidebar-section { | ||
margin-bottom: 2rem; | ||
padding: 1.5rem; | ||
background: #edf1f4; | ||
border-radius: 0.5rem; | ||
|
||
h3 { | ||
margin-bottom: 1rem; | ||
font-size: 1.2rem; | ||
font-weight: 600; | ||
color: var(--bs-gray-900); | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
|
||
li { | ||
margin-bottom: 0.75rem; | ||
|
||
a { | ||
color: var(--bs-gray-700); | ||
text-decoration: none; | ||
transition: color 0.2s ease; | ||
|
||
&:hover { | ||
color: var(--bs-primary); | ||
} | ||
} | ||
} | ||
} | ||
|
||
&.recent-posts { | ||
.post-date { | ||
display: block; | ||
font-size: 0.875rem; | ||
color: var(--bs-gray-600); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@include color-mode(dark) { | ||
.blog { | ||
.blog-sidebar { | ||
.sidebar-section { | ||
background: var(--bs-gray-800); | ||
|
||
h3 { | ||
color: var(--bs-white); | ||
} | ||
|
||
ul li a { | ||
color: black; | ||
} | ||
|
||
&.recent-posts { | ||
a{ | ||
color: white; | ||
} | ||
.post-date { | ||
color: var(--bs-gray-500); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
<!-- inject:../components/baseHead/baseHeadStart.html --> | ||
<!DOCTYPE html> | ||
<html lang="{{- $.Lang }}"> | ||
|
||
<head> | ||
{{ partial "head.html" . }} {{ partial "head_custom.html" . }} | ||
{{ partial "head.html" . }} | ||
{{ partial "head_custom.html" . }} | ||
</head> | ||
|
||
<body> | ||
{{ partial "header.html" . }} | ||
|
||
<main id="main-content" class="blog flex-grow-1"> | ||
<section class="container section"> | ||
<h1 class="rad-fade-down rad-waiting rad-animate">{{ .Title }}</h1> | ||
<div class="posts-list container"> | ||
<!-- Renders the li.html content view for each content/posts/*.md --> | ||
{{ range .Pages }} | ||
<div class="row row--padded rad-animation-group rad-fade-down rad-waiting rad-animate section--border-bottom"> | ||
{{ .Render "summary" }} | ||
</div> | ||
<main id="main-content" class="blog flex-grow-1"> | ||
<div class="container section"> | ||
<div class="row {{ if eq .Site.Params.blog.layout "sidebar" }}has-sidebar{{ end }}"> | ||
{{ if eq .Site.Params.blog.layout "sidebar" }} | ||
<div class="col-sidebar" style="width: {{ .Site.Params.blog.sidebarWidth }}%"> | ||
{{ partial "blog-sidebar.html" . }} | ||
</div> | ||
{{ end }} | ||
|
||
<div class="col-content" {{ if eq .Site.Params.blog.layout "sidebar" }}style="width: calc(100% - {{ .Site.Params.blog.sidebarWidth }}%)"{{ end }}> | ||
<h1 class="rad-fade-down rad-waiting rad-animate">{{ .Title }}</h1> | ||
<div class="posts-list"> | ||
{{ range .Pages }} | ||
<div class="row row--padded rad-animation-group rad-fade-down rad-waiting rad-animate section--border-bottom"> | ||
{{ .Render "summary" }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</main> | ||
|
||
{{ partial "footer.html" . }} {{ partial "base-foot.html" . }} | ||
{{ partial "footer.html" . }} | ||
{{ partial "base-foot.html" . }} | ||
</body> | ||
|
||
</html> | ||
<!-- endinject --> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<aside class="blog-sidebar"> | ||
{{ if .Site.Params.blog.showCategories }} | ||
<div class="sidebar-section categories"> | ||
<h3>{{ i18n "categories" | default "Categories" }}</h3> | ||
{{ if .Site.Taxonomies.tags }} | ||
<ul class="tags"> | ||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }} | ||
<li> | ||
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}">{{ $name }}</a> | ||
</li> | ||
{{ end }} | ||
</ul> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
|
||
{{ if .Site.Params.blog.showRecentPosts }} | ||
<div class="sidebar-section recent-posts"> | ||
<h3>{{ i18n "recent_posts" | default "Recent Posts" }}</h3> | ||
<ul> | ||
{{ range first .Site.Params.blog.recentPostCount (where .Site.RegularPages "Type" "blog") }} | ||
<li> | ||
<a href="{{ .RelPermalink }}">{{ .Title }}</a> | ||
<span class="post-date">{{ .Date.Format "Jan 2, 2006" }}</span> | ||
</li> | ||
{{ end }} | ||
</ul> | ||
</div> | ||
{{ end }} | ||
</aside> |