added discreteTags option; fixed hamburger

This commit is contained in:
Gabriele Musco 2021-04-19 11:14:05 +02:00
parent 45a2cae2d1
commit 9491d1f64d
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
4 changed files with 48 additions and 26 deletions

View File

@ -54,6 +54,7 @@ summaryLength = 70 # number of words for article summaries
contentWidth = "1000px" # maximum width of the site content, css syntax contentWidth = "1000px" # maximum width of the site content, css syntax
discreteCards = false # enable discrete card style; default false discreteCards = false # enable discrete card style; default false
discreteTags = false # enable discrete tag style; default false
gridView = false # show post list as a grid. goes well with discreteCards gridView = false # show post list as a grid. goes well with discreteCards
highlightBgColor = "#34363b" # card and circle navigation background color for discrete card mode highlightBgColor = "#34363b" # card and circle navigation background color for discrete card mode

View File

@ -8,6 +8,7 @@ $mono_font: {{ .Site.Params.monospaceFontFamily | default "JetBrains Mono" }};
$highlight_bg_color: {{ .Site.Params.highlightBgColor | default "#34363b" }}; $highlight_bg_color: {{ .Site.Params.highlightBgColor | default "#34363b" }};
$content_width: {{ .Site.Params.contentWidth | default "1000px" }}; $content_width: {{ .Site.Params.contentWidth | default "1000px" }};
$border_radius: 10px; $border_radius: 10px;
$content_spacing: 25px;
::selection, ::-moz-selection { ::selection, ::-moz-selection {
background: $accent_color; background: $accent_color;
@ -51,7 +52,7 @@ footer {
color: $dim_fg_color; color: $dim_fg_color;
} }
hr { hr {
margin-top: 50px; margin-top: (2 * $content_spacing);
} }
.footerColumns { .footerColumns {
font-size: .9rem; font-size: .9rem;
@ -59,7 +60,7 @@ footer {
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
ul { ul {
margin: 12px; margin: ($content_spacing / 2);
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
li > strong { li > strong {
@ -70,7 +71,7 @@ footer {
} }
#links { #links {
padding: 5px 0 40px 0; padding: 5px 0;
} }
article, .articlePreview { article, .articlePreview {
@ -224,7 +225,7 @@ h1, h2, h3, h4, h5, h6 {
.postlist { .postlist {
display: grid; display: grid;
grid-gap: 25px; grid-gap: 25px;
margin-bottom: 25px; margin-bottom: $content_spacing;
grid-template-columns: 1fr; grid-template-columns: 1fr;
&.gridView { &.gridView {
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
@ -374,24 +375,30 @@ ul.list {
} }
} }
@mixin buttonLikeLink {
display: inline-block;
border-radius: $border_radius;
background-color: $highlight_bg_color;
padding: 15px;
border-bottom: none;
&:hover, &:focus {
background-color: $accent_color;
}
}
.loadMoreButton { .loadMoreButton {
text-align: center; text-align: center;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: bold; font-weight: bold;
&.buttonLike { &.buttonLike {
a { a {
border-radius: $border_radius; @include buttonLikeLink;
background-color: $highlight_bg_color;
padding: 15px;
border-bottom: none;
&:hover, &:focus {
background-color: $accent_color;
}
} }
} }
} }
.relatedArticlesContainer { .relatedArticlesContainer {
margin: $content_spacing 0;
#relatedArticles .postlistitem { #relatedArticles .postlistitem {
@extend .featuredCard; @extend .featuredCard;
} }
@ -411,7 +418,7 @@ ul.list {
} }
img { img {
margin-right: 10px; margin-right: ($content_spacing / 2);
margin-top: 7px; margin-top: 7px;
align-self: flex-start; align-self: flex-start;
width: 50px; width: 50px;
@ -432,12 +439,13 @@ nav, #links {
} }
header { header {
margin-bottom: $content_spacing;
.titleAndHamburger { .titleAndHamburger {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: flex-start; align-items: flex-start;
align-self: flex-start justify-content: space-between;
} }
nav { nav {
font-size: .9em; font-size: .9em;
@ -459,6 +467,14 @@ header {
} }
} }
.articleTagsContainer {
margin: $content_spacing 0;
}
a.discreteTag {
@include buttonLikeLink;
}
{{ if .Site.Params.mobileHamburgerNav | default false }} {{ if .Site.Params.mobileHamburgerNav | default false }}
header { header {
#hamburger-menu { #hamburger-menu {
@ -478,8 +494,8 @@ header {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 12px; padding: ($content_spacing / 4);
width: 35px; align-self: center;
} }
nav { nav {
ul#main-nav { ul#main-nav {
@ -491,6 +507,7 @@ header {
text-align: right; text-align: right;
a { a {
padding-left: 0; padding-left: 0;
padding-right: ($content_spacing / 4);
} }
} }
} }

View File

@ -10,17 +10,21 @@
<img src="{{ .Params.Image }}" alt="" /> <img src="{{ .Params.Image }}" alt="" />
{{ end }} {{ end }}
<div>{{ .Content }}</div> <div>{{ .Content }}</div>
{{ if .Params.tags }}
<hr />
<p>
<span></span>
<strong>Tags:</strong>
{{ range .Params.tags }}
<a href="/tags/{{ . | urlize }}">#{{ . }}</a>
{{ end }}
</p>
{{ end }}
</article> </article>
{{ if .Params.tags }}
{{ if not .Site.Params.discreteCards }}<hr />{{ end }}
<p class="articleTagsContainer">
<span></span>
<strong>Tags:</strong>
{{ range .Params.tags }}
<a
{{ if site.Params.discreteTags | default false }}
class="discreteTag"
{{ end }}
href="/tags/{{ . | urlize }}">#{{ . }}</a>
{{ end }}
</p>
{{ end }}
{{- partial "inject/content-after.html" . -}} {{- partial "inject/content-after.html" . -}}
{{ if .Site.Params.commento }} {{ if .Site.Params.commento }}
<script <script

View File

@ -3,7 +3,7 @@
<div class="titleAndSearchContainer"> <div class="titleAndSearchContainer">
<div id="titleContainer"> <div id="titleContainer">
<img src='{{ .Site.Params.Logo | default "/logo.svg" }}' /> <img src='{{ .Site.Params.Logo | default "/logo.svg" }}' />
<div> <div style="width: 100%">
<div class="titleAndHamburger"> <div class="titleAndHamburger">
<h1>{{ .Site.Title | default "Ficurinia" }}</h1> <h1>{{ .Site.Title | default "Ficurinia" }}</h1>
{{ if .Site.Params.mobileHamburgerNav | default false }} {{ if .Site.Params.mobileHamburgerNav | default false }}