Merge pull request #31 from drgarcia1986/flat-header

add `HEADER_COLOR` option to render header with a simple color
This commit is contained in:
Gilson Filho 2016-02-24 16:16:21 -03:00
commit 5e0fb122a1
12 changed files with 37 additions and 5 deletions

View File

@ -18,6 +18,16 @@ To define custom header cover, set the property ``HEADER_COVER`` in ``pelicancon
HEADER_COVER = 'static/my_image.png' HEADER_COVER = 'static/my_image.png'
``` ```
### Header Color
To define a simple header background color, set the property ``HEADER_COLOR`` in ``pelicanconf.py``:
```python
HEADER_COLOR = 'black'
```
you can use any valid css color.
### Social URLs ### Social URLs
Github, Twitter and Facebook URLs set these properties: Github, Twitter and Facebook URLs set these properties:
@ -36,8 +46,8 @@ If you have new links add them to SOCIAL. The Name has to be the name of the cor
You can specify an external feed URL (e.g. FeedBurner) in ``SOCIAL`` using the You can specify an external feed URL (e.g. FeedBurner) in ``SOCIAL`` using the
``rss`` or ``rss-square`` icons. The icon will be shown in the footer with the ``rss`` or ``rss-square`` icons. The icon will be shown in the footer with the
rest of your ``SOCIAL`` accounts. A <link> tag for the external feed will be rest of your ``SOCIAL`` accounts. A ``<link>`` tag for the external feed will be
placed in <head> instead of the default Pelican feeds. placed in ``<head>`` instead of the default Pelican feeds.
### Code highlights ### Code highlights
@ -108,7 +118,7 @@ TWITTER_HANDLE = "myprofile"
- Set ``SHOW_FULL_ARTICLE`` to True to show full article content on index.html - Set ``SHOW_FULL_ARTICLE`` to True to show full article content on index.html
instead of summary; instead of summary;
- Set ``SHOW_SITESUBTITLE_IN_HTML`` to True to make use of the ``SITESUBTITLE`` - Set ``SHOW_SITESUBTITLE_IN_HTML`` to True to make use of the ``SITESUBTITLE``
variable inside the <title> HTML tag; variable inside the ``<title>`` HTML tag;
### Articles ### Articles

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -93,6 +93,8 @@
<header class="intro-header" style="background-image: url('{{ article.header_cover }}')"> <header class="intro-header" style="background-image: url('{{ article.header_cover }}')">
{% elif HEADER_COVER %} {% elif HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -5,6 +5,8 @@
<!-- Set your background image for this header on the line below. --> <!-- Set your background image for this header on the line below. -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -8,6 +8,8 @@
<header class="intro-header" style="background-image: url('{{ page.header_cover }}')"> <header class="intro-header" style="background-image: url('{{ page.header_cover }}')">
{% elif HEADER_COVER %} {% elif HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -3,6 +3,8 @@
{% block header %} {% block header %}
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header --> <!-- Page Header -->
{% if HEADER_COVER %} {% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')"> <header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<header class="intro-header" style="background-color: {{ HEADER_COLOR }}">
{% else %} {% else %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')"> <header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %} {% endif %}