diff options
author | jeffreytse <jeffreytse.mail@gmail.com> | 2021-06-25 14:16:44 +0800 |
---|---|---|
committer | jeffreytse <jeffreytse.mail@gmail.com> | 2021-06-25 14:16:44 +0800 |
commit | 404a26e6a9be6785e45f52367f0068eaaa33b3bd (patch) | |
tree | f394dc0d70ac5aac075aba6859499af712623f26 | |
parent | 245fe2a0479819543e3f71499daada138c43377c (diff) |
feat: support banner heading and subheading styles
-rw-r--r-- | _config.yml | 2 | ||||
-rw-r--r-- | _includes/functions/get_banner.html | 11 | ||||
-rw-r--r-- | _includes/views/banner.html | 14 | ||||
-rw-r--r-- | _includes/views/post-header.html | 2 |
4 files changed, 28 insertions, 1 deletions
diff --git a/_config.yml b/_config.yml index dadaf64..a13bb03 100644 --- a/_config.yml +++ b/_config.yml @@ -152,6 +152,8 @@ yat: # background: "rgba(0, 0, 0, 0.8)" # height: "640px" # min_height: null +# heading_style: null # Custom heading style (e.g. "font-weight: bold; text-decoration: underline") +# subheading_style: null # Custom subheading style (e.g. color: gold) # Excerpt size setting # excerpt_size: 350 diff --git a/_includes/functions/get_banner.html b/_includes/functions/get_banner.html index acfb4f4..6d07f10 100644 --- a/_includes/functions/get_banner.html +++ b/_includes/functions/get_banner.html @@ -31,3 +31,14 @@ {% assign name = 'banner.min_height' %} {%- include functions.html func='get_value' -%} {% assign banner_min_height = return %} + +{%- include functions.html func='log' level='debug' msg='Get banner_heading_style value' -%} +{% assign name = 'banner.heading_style' %} +{%- include functions.html func='get_value' -%} +{% assign banner_heading_style = return %} + +{%- include functions.html func='log' level='debug' msg='Get banner_subheading_style value' -%} +{% assign name = 'banner.subheading_style' %} +{%- include functions.html func='get_value' -%} +{% assign banner_subheading_style = return %} + diff --git a/_includes/views/banner.html b/_includes/views/banner.html index 32bb3cd..f26d06f 100644 --- a/_includes/views/banner.html +++ b/_includes/views/banner.html @@ -49,6 +49,20 @@ } </style> {% endif %} + {%- if banner_heading_style -%} + <style> + html .page-banner .page-banner-inner > *:first-child > *:nth-child(1) { + {{ banner_heading_style }} + } + </style> + {%- endif -%} + {%- if banner_subheading_style -%} + <style> + html .page-banner .page-banner-inner > *:first-child > *:nth-child(2) { + {{ banner_subheading_style }} + } + </style> + {%- endif -%} <section class="page-banner"> <div class="page-banner-img"> <div style="background-image: url({{ banner_image }})"></div> diff --git a/_includes/views/post-header.html b/_includes/views/post-header.html index e59fd91..d5e3db3 100644 --- a/_includes/views/post-header.html +++ b/_includes/views/post-header.html @@ -1,6 +1,6 @@ <header class="post-header"> <h1 class="post-title p-name" itemprop="name headline">{{ heading | default: page.title | escape }}</h1> - <h3 class="post-subtitle">{{ subheading | default: page.subtitle | escape }}</h3> + <h2 class="post-subtitle">{{ subheading | default: page.subtitle | escape }}</h2> <p class="post-meta"> <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished"> |