From e7a78c4ff7b5e79c57a988b824424577dbc66256 Mon Sep 17 00:00:00 2001 From: Arul Date: Mon, 11 Mar 2019 07:53:39 +0530 Subject: [PATCH] #44 no default cover (#45) support for HOME_COVER and HOME_COLOR --- .gitignore | 1 + README.adoc | 21 ++++++++++++++++----- templates/archives.html | 4 +--- templates/article.html | 4 +--- templates/author.html | 6 ++---- templates/authors.html | 4 +--- templates/categories.html | 4 +--- templates/category.html | 4 +--- templates/index.html | 12 +++++++++--- templates/page.html | 4 +--- templates/period_archives.html | 26 +++++++++++++++++--------- templates/tag.html | 4 +--- templates/tags.html | 4 +--- tests/default_conf.py | 1 + tests/test_coverimages.py | 32 ++++++++++++++++---------------- 15 files changed, 70 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index 3752df0..c53652a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc *.log output +tests/.cache/ \ No newline at end of file diff --git a/README.adoc b/README.adoc index b6f3129..ea2556d 100644 --- a/README.adoc +++ b/README.adoc @@ -81,14 +81,20 @@ You can set cover images for your blog, article, page, tag, category and author. The is the cover image for your site main index.html. -To set blog cover, set the property `HEADER_COVER` in +To set blog cover, set the property `HOME_COVER` in `pelicanconf.py`: [source,python] ---- -HEADER_COVER = '/assets/images/blog_cover.png' +HOME_COVER = '/assets/images/blog_cover.png' ---- +[NOTE] +==== +HEADER_COVER property is deprecated. Work around will be use HOME_COVER and use cover in individual articles. +This property will be used if there is no cover image set to an article, page, tag, category, author. +==== + [[article-cover]] ==== Article Cover @@ -167,17 +173,22 @@ For more refer link:#author-bio[author] . === Header Color To define a simple header background color, set the property -`HEADER_COLOR` in `pelicanconf.py`: +`HOME_COLOR` in `pelicanconf.py`: [source,python] ---- -HEADER_COLOR = 'black' +HOME_COLOR = 'black' ---- you can use any valid css color. This will be used if there is no cover image set in link:#articles[article] level and site level. -This property will be used if there is no cover image set to an article, page, tag, category, author. + +[NOTE] +==== +HEADER_COLOR property is deprecated. Work around will be use HOME_COLOR and use color in individual articles. +This property will be used if there is no HEADER_COVER and cover image set to an article, page, tag, category, author. +==== [[social-urls]] === Social URLs diff --git a/templates/archives.html b/templates/archives.html index 439ef12..5d422b7 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -15,7 +15,7 @@ {% block header %} -
+
diff --git a/templates/article.html b/templates/article.html index d160912..b74ec05 100644 --- a/templates/article.html +++ b/templates/article.html @@ -63,7 +63,7 @@ -
+
diff --git a/templates/author.html b/templates/author.html index d423016..d863d79 100644 --- a/templates/author.html +++ b/templates/author.html @@ -46,7 +46,7 @@ {% block header %} -
+
{% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %} -
+