merge with master to fix conflicts

This commit is contained in:
Toti 2016-02-26 15:37:35 -03:00
commit dbd16dba88
15 changed files with 150 additions and 13 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 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
Github, Twitter and Facebook URLs set these properties:
@ -32,6 +42,13 @@ SOCIAL = (('twitter', 'https://twitter.com/myprofile'),
If you have new links add them to SOCIAL. The Name has to be the name of the corresponding FontAwesome icon.
### External feed URL
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
rest of your ``SOCIAL`` accounts. A ``<link>`` tag for the external feed will be
placed in ``<head>`` instead of the default Pelican feeds.
### Code highlights
This theme contains this color schemes:
@ -83,9 +100,16 @@ will not see the desired results.
Accept many analytics:
- Google Analytics: ``GOOGLE_ANALYTICS``;
- Gauges: ``GAUGES``
- Gauges: ``GAUGES``
- Piwik: ``PIWIK_URL`` and ``PIWIK_SITE_ID``.
### Twitter cards
Twitter cards are automatically generated if TWITTER_HANDLE is set:
```python
TWITTER_HANDLE = "myprofile"
```
### Other configuration
- If ``ADDTHIS_PUBID`` is defined sharing buttons from AddThis will appear
@ -94,11 +118,15 @@ Accept many analytics:
- Set ``SHOW_FULL_ARTICLE`` to True to show full article content on index.html
instead of summary;
- 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
To customize header cover to articles, insert the metadata ``header_cover``:
To customize header cover to articles, insert the metadata ``header_cover``.
To customize OpenGraph images, insert the metadata ``og_image``, otherwise
``header_cover``, ``HEADER_COVER`` or a default image is used. You can also
use absolute URLs for ``og_image``. Example:
- To RST
```rst
@ -113,6 +141,7 @@ My super title
:authors: Alexis Metaireau, Conan Doyle
:summary: Short version for index and feeds
:header_cover: /images/posts/super-title/cover.png
:og_image: /images/posts/super-title/facebook_cover.png
```
- To Markdown
@ -126,6 +155,7 @@ Slug: my-super-post
Authors: Alexis Metaireau, Conan Doyle
Summary: Short version for index and feeds
Header_Cover: /images/posts/super-title/cover.png
Og_Image: http://example.com/facebook_cover.png
This is the content of my super blog post.
```

View File

@ -387,6 +387,11 @@ form .row:first-child .floating-label-form-group {
text-shadow: none;
background: #0085a1;
}
img {
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}
img::selection {
color: white;
background: transparent;

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -5,28 +5,86 @@
{{ super() }}
{% for keyword in article.keywords %}
<meta name="keywords" contents="{{keyword}}" />
<meta name="keywords" content="{{keyword}}" >
{% endfor %}
{% for description in article.description %}
<meta name="description" contents="{{description}}" />
{% if description %}
<meta name="description" content="{{ description }}">
{% elif article.headline %}
<meta name="description" content="{{ article.headline }}">
{% elif article.summary %}
<meta name="description" content="{{ article.summary|striptags|truncate(140) }}">
{% endif %}
{% for author in article.authors %}
<meta name="author" content="{{ author }}">
{% endfor %}
{% for tag in article.tags %}
<meta name="tags" contents="{{tag}}" />
<meta name="tags" content="{{tag}}">
{% endfor %}
{% endblock %}
{% block twitter_card %}
{% if TWITTER_HANDLE %}
{% if article.header_cover %}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:image" content="{{ HEADER_COVER }}">
{% else %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
{% endif %}
<meta name="twitter:site" content="@{{ TWITTER_HANDLE }}" />
<meta name="twitter:title" content="{{ article.title }}" />
{% if description %}
<meta name="twitter:description" content="{{ description }}" />
{% elif article.headline %}
<meta name="twitter:description" content="{{ article.headline }}" />
{% else %}
<meta name="twitter:description" content="{{ article.summary }}" />
{% endif %}
{% if article.header_cover %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
{% endif %}
{% endif %}
{% endblock %}
{% block opengraph %}
{{ super() }}
<meta property="og:type" content="article">
<meta property="article:author" content="{{ author }}">
{% for author in article.authors %}
<meta property="article:author" content="{{ author }}" >
{% endfor %}
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}">
<meta property="og:title" content="{{ article.title }}">
<meta property="og:description" content="{{ article.headline }}">
<meta property="og:image" content="{{ SITEURL }}/{{ article.header_cover }}">
<meta property="article:published_time" content="{{ article.date }}">
{% if description %}
<meta property="og:description" content="{{ description }}">
{% elif article.headline %}
<meta property="og:description" content="{{ article.headline }}">
{% elif article.summary %}
<meta property="og:description" content="{{ article.summary|striptags|truncate(140) }}">
{% endif %}
{% if article.og_image %}
{% if article.og_image|lower|truncate(4, True, '') == "http" %}
<meta property="og:image" content="{{ article.og_image }}">
{% else %}
<meta property="og:image" content="{{ SITEURL }}/{{ article.og_image }}">
{% endif %}
{% elif article.header_cover %}
<meta property="og:image" content="{{ SITEURL }}/{{ article.header_cover }}">
{% elif HEADER_COVER %}
<meta property="og:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
<meta property="og:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
{% endif %}
{% endblock %}
{% block header %}
@ -35,6 +93,8 @@
<header class="intro-header" style="background-image: url('{{ article.header_cover }}')">
{% elif 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg')">
{% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -15,6 +15,9 @@
<title>{% block title %}{{ SITENAME }}{% if SITESUBTITLE and SHOW_SITESUBTITLE_IN_HTML %} - {{ SITESUBTITLE }}{% endif %}{% endblock title %}</title>
{% for name,link in SOCIAL if name in ['rss', 'rss-square'] %}
<link href="{{ link }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
{% else %}
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
{% endif %}
@ -39,7 +42,7 @@
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
{% endfor %}
<!-- Bootstrap Core CSS -->
<link href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/bootstrap.min.css" rel="stylesheet">
@ -77,6 +80,23 @@
{% endfor %}
<meta property="og:site_name" content="{{ SITENAME }}">
{% endblock opengraph %}
{% block twitter_card %}
{% if TWITTER_HANDLE %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@{{ TWITTER_HANDLE }}" />
<meta name="twitter:title" content="{{ SITENAME }}" />
{% if SITESUBTITLE %}
<meta name="twitter:description" content="{{ SITESUBTITLE }}" />
{% else %}
<meta name="twitter:description" content="View the blog." />
{% endif %}
{% if HEADER_COVER %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
{% else %}
<meta name="twitter:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
{% endif %}
{% endif %}
{% endblock twitter_card %}
</head>
<body>

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -5,6 +5,8 @@
<!-- Set your background image for this header on the line below. -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}
@ -34,6 +36,8 @@
</a>
{% if SHOW_FULL_ARTICLE %}
{{ article.content }}
{% elif article.has_summary %}
{{ article.summary }}
{% elif article.summary %}
{{ article.summary|truncate(140) }}
{% endif %}

View File

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

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -3,6 +3,8 @@
{% block header %}
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}

View File

@ -6,6 +6,8 @@
<!-- Page Header -->
{% if 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 %}
<header class="intro-header" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/home-bg.jpg')">
{% endif %}