From c896fcb147ef240283001799f2602764fa5b631f Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Tue, 28 Dec 2021 10:46:29 +0100 Subject: [PATCH] renamed discreteCards to paperCards, discreteTags to buttonTags; got rid of discrete class in favor of pure hugo conditional styling --- README.md | 6 ++--- assets/scss/style.scss | 31 +++++++++++-------------- data/colors.yml | 2 +- layouts/_default/single.html | 8 +++---- layouts/partials/article_card.html | 2 +- layouts/partials/featured_articles.html | 2 +- layouts/partials/js_paginator.html | 2 +- layouts/partials/showcase.html | 2 +- 8 files changed, 25 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index d57a3cc..ecf3217 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,10 @@ summaryLength = 70 # number of words for article summaries contentWidth = "1000px" # maximum width of the site content, css syntax - discreteCards = false # enable discrete card style; default false - discreteTags = false # enable discrete tag style; default false + paperCards = false # enable paper card style; default false + buttonTags = false # enable button tag style; default false tagsInArticlePreview = true # enable tags list in the article preview card - gridView = false # show post list as a grid. goes well with discreteCards + gridView = false # show post list as a grid. goes well with paperCards bigArticleTitle = false # makes the title in the single article view bigger navtype = "standard" # changes the style of the pagination, available styles are: "standard", "circles" enableShadow = false # shows a shadow around some elements diff --git a/assets/scss/style.scss b/assets/scss/style.scss index b944772..31618af 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -372,13 +372,13 @@ h6 {font-size: 0.7 * $base_font_size * $title_font_mult;} display: block; padding-bottom: 25px; - &.discrete { + {{ if (.Site.Params.paperCards | default false) }} background-color: var(--default_hl_bg); border-radius: $border_radius; box-shadow: $shadow; padding: 20px; padding-top: 1px; - } + {{ end }} &.single { {{ if (.Site.Params.bigArticleTitle | default false) }} @@ -396,18 +396,16 @@ h6 {font-size: 0.7 * $base_font_size * $title_font_mult;} grid-template-columns: 1fr; &.gridView { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); - .card { - &.discrete { - } - } } } // only hide hr in cards if they are in the article list // cards in list are divs, cards as in full-blown articles use the article tag -.postlistitem.card.discrete { - hr { display: none; } -} +{{ if (.Site.Params.paperCards | default false) }} + .postlistitem.card { + hr { display: none; } + } +{{ end}} .postlistitem.card div { img { @@ -538,10 +536,10 @@ ul.list { margin: 0; } } - &.discrete { + {{ if (.Site.Params.paperCards | default false) }} border-radius: $border_radius; padding: 0; - } + {{ end }} } } @@ -659,7 +657,7 @@ header { margin: $content_spacing 0; } -a.discreteTag { +a.buttonTag { @include roundButtonLike; } @@ -686,10 +684,7 @@ a.discreteTag { } input, textarea, textarea.cactus-editor-textarea { - {{ if or - (site.Params.discreteCards | default false) - (eq (site.Params.navtype | default "standard") "circles") - }} + {{ if (site.Params.paperCards | default false) }} @include buttonLike; {{ else }} border-radius: 0 !important; @@ -717,7 +712,7 @@ input, textarea, textarea.cactus-editor-textarea { } .cactus-login-form { - {{ if (site.Params.discreteCards | default false) }} + {{ if (.Site.Params.paperCards | default false) }} border-radius: $border_radius; {{ else }} border-radius: 0; @@ -782,7 +777,7 @@ input, textarea, textarea.cactus-editor-textarea { width: 450px; max-width: 100%; padding: 24px; - {{ if site.Params.discreteCards }} + {{ if (.Site.Params.paperCards | default false) }} border-radius: $border_radius; {{ end }} h1, h2, h3, h4 { diff --git a/data/colors.yml b/data/colors.yml index aafbc36..2f144fc 100644 --- a/data/colors.yml +++ b/data/colors.yml @@ -2,7 +2,7 @@ default: dark # light auto_switch: false # set to true to respect the user preference dark: bg: '#242629' # main site background - hl_bg: '#34363b' # card and circle navigation background color for discrete card mode + hl_bg: '#34363b' # card and circle navigation background color for paper card mode fg: 'white' # font color dim_fg: '#bababa' # will be used for secondary information like dates and tags stroke: '#4f4f4f' # stroke/border color used mostly in the icon menu tooltip diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1f08e6d..2b60730 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,6 @@ {{ define "main" }} {{- partial "inject/content-before.html" . -}} -
+

{{ .Title }}

{{ if (.Params.showDate | default true) }}

@@ -20,14 +20,14 @@

{{ .Content }}
{{ if .Params.tags }} - {{ if not .Site.Params.discreteCards }}
{{ end }} + {{ if not .Site.Params.paperCards }}
{{ end }}
+

{{ .Title }} diff --git a/layouts/partials/featured_articles.html b/layouts/partials/featured_articles.html index afe7ab7..4dfdf2d 100644 --- a/layouts/partials/featured_articles.html +++ b/layouts/partials/featured_articles.html @@ -1,7 +1,7 @@