diff options
author | Lutong Chen <ertuil98@foxmail.com> | 2020-05-10 06:15:43 +0300 |
---|---|---|
committer | Lutong Chen <ertuil98@foxmail.com> | 2020-05-10 06:15:43 +0300 |
commit | 99e461ed6c2a4398ec3cbe8b6a0b70e0f7f0324d (patch) | |
tree | 8a22d03d01bebd6994b852b72b093b77ecf69c1c | |
parent | fbb9beba8d43dc9a961a743191b64f2aa54255df (diff) |
now it is able to change the color of badge and quote
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/gallery/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/partials/article.html | 2 | ||||
-rw-r--r-- | layouts/partials/info.html | 7 | ||||
-rw-r--r-- | static/self/css/default.css | 12 |
8 files changed, 23 insertions, 10 deletions
@@ -45,6 +45,8 @@ There are some basic configuration options you may want to use: | Params.bio | A Biography for your Blog | None | | Params.logo | Your Blog's Logo | None | | Params.favicon | The favicon file | /favicon.ico | +| Params.badge | The color for badge ('red', 'cyan', 'orange', 'green', 'blue', 'black' and 'gray' is available) | 'red' | +| Params.quote | The color for quota ('red', 'cyan', 'orange', 'green', 'blue', 'black' and 'gray' is available) | 'green' | Add your own custom menus in the `config.toml` like this: diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 4867189..336d554 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -9,6 +9,8 @@ footnoteReturnLinkContents = "^" [params] author = "Steve Francia" + badge = "red" + quote = "green" # logo = "//blog.ertuil.top/avater.png" bio = """ <p> This is BIO. You can write something here. </p> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 85ac458..cdc9aa1 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,7 +6,7 @@ <div class="{{ if not $related }}layui-col-md12{{else}}layui-col-md8{{end}} layui-col-sm12 layui-col-xs12"> <div class="layui-card single-card"> <br /> - <blockquote class="self-elem-quote markdown-body single-title" > + <blockquote class="self-elem-quote {{if isset $.Site.Params "quote"}}self-elem-quote-bg-{{index $.Site.Params.quote}}{{end}} markdown-body single-title" > <h1>{{ .Title }}</h1> {{partial "info" .}} </blockquote> @@ -24,7 +24,7 @@ {{ with $related }} {{ range . }} <div style="margin-left: 10px;"> - <blockquote class="self-elem-quote" style="background-color:#FFFFFF;margin-top: 10px;"> + <blockquote class="self-elem-quote {{if isset $.Site.Params "quote"}}self-elem-quote-bg-{{index $.Site.Params.quote}}{{end}}" style="background-color:#FFFFFF;margin-top: 10px;"> <a href="{{.RelPermalink}}"> <h2 class="">{{.Title}}</h2> </a> diff --git a/layouts/gallery/single.html b/layouts/gallery/single.html index 0e579ab..bf5aad1 100644 --- a/layouts/gallery/single.html +++ b/layouts/gallery/single.html @@ -5,7 +5,7 @@ <div class="layui-row"> <div class="layui-card single-card"> <br /> - <blockquote class="self-elem-quote markdown-body single-title" > + <blockquote class="self-elem-quote {{if isset $.Site.Params "quote"}}self-elem-quote-bg-{{index $.Site.Params.quote}}{{end}} markdown-body single-title" > <h1>{{ .Title }}</h1> </blockquote> <div class="layui-card-body markdown-gallery single-content"> diff --git a/layouts/index.html b/layouts/index.html index 5fce50e..ef6b77e 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -44,7 +44,7 @@ <h1><a href="{{ "/" | relLangURL}}{{ $taxonomyname | urlize }}">{{ $taxonomyname }}</a> </h1> {{ range $key, $value := $taxonomy }} <a href="{{ $taxonomyname | relLangURL }}/{{ $key | urlize | lower }}/"> - <span class="layui-badge layui-bg-cyan" style="margin: 5px">{{ $key }}</span> + <span class="layui-badge {{with $.Site.Params.badge}}layui-bg-{{.}}{{end}}" style="margin: 5px">{{ $key }}</span> </a> {{end}} {{end}} diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 86d96b8..af648e2 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1,4 +1,4 @@ - <blockquote class="self-elem-quote" style="background-color:#FFFFFF;margin-top: 10px;"> + <blockquote class="self-elem-quote {{if isset $.Site.Params "quote"}}self-elem-quote-bg-{{index $.Site.Params.quote}}{{end}}" style="background-color:#FFFFFF;margin-top: 10px;"> <a href="{{.RelPermalink}}"> <h2 class="">{{.Title}}</h2> </a> diff --git a/layouts/partials/info.html b/layouts/partials/info.html index 6340dfd..af6f00c 100644 --- a/layouts/partials/info.html +++ b/layouts/partials/info.html @@ -7,9 +7,10 @@ <span style="vertical-align: px;">{{ .WordCount }} Words</span> --> <i class="layui-icon layui-icon-tabs" style="font-size: 22px; vertical-align: 0px;"></i> - {{ range .Params.tags }} - <a href="{{ "tags/" | relLangURL }}{{ . | urlize | lower }}/"> - <span class="layui-badge layui-bg-cyan" style="vertical-align: 2px;">{{ . }}</span> + {{ range $tag := .Params.tags }} + <a href="{{ "tags/" | relLangURL }}{{ $tag | urlize | lower }}/"> + <span class="layui-badge {{with $.Site.Params.badge}}layui-bg-{{.}}{{end}}" style="vertical-align: 2px;">{{ $tag }}</span> </a> {{ end }} + </h3>
\ No newline at end of file diff --git a/static/self/css/default.css b/static/self/css/default.css index 92cab1d..6837192 100644 --- a/static/self/css/default.css +++ b/static/self/css/default.css @@ -273,7 +273,15 @@ footer { margin-bottom:10px; padding:15px; line-height:22px; - border-left:4px solid #2F4056; + border-left:4px solid #009688; border-radius:0 2px 2px 0; /* background-color:#f2f2f2 */ -}
\ No newline at end of file +} + +.self-elem-quote-bg-red {border-left-color: #FF5722!important;} +.self-elem-quote-bg-orange {border-left-color: #FFB800!important;} +.self-elem-quote-bg-green {border-left-color: #009688!important;} +.self-elem-quote-bg-cyan {border-left-color: #2F4056!important;} +.self-elem-quote-bg-blue {border-left-color: #1E9FFF!important;} +.self-elem-quote-bg-black {border-left-color: #393D49!important;} +.self-elem-quote-bg-gray {border-left-color: #666!important;} |