Allow to specify the author of an album (ref #139).

The author can be set in the album's index.md or in the settings.
This commit is contained in:
Simon Conseil
2015-01-19 23:42:47 +01:00
parent 972e8fdc98
commit ff2c79ca6d
4 changed files with 11 additions and 5 deletions

View File

@@ -281,6 +281,11 @@ class Album(UnicodeMixin):
for key, val in meta.items():
setattr(self, key, val)
try:
self.author = self.meta['author'][0]
except KeyError:
self.author = self.settings.get('author')
def create_output_directories(self):
"""Create output directories for thumbnails and original images."""
check_or_create_dir(self.dst_path)

View File

@@ -6,7 +6,7 @@
<title>{{ album.title }}</title>
<meta name="description" content="">
<meta name="author" content="{{ author }}">
<meta name="author" content="{{ album.author }}">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=PT+Sans">
@@ -30,7 +30,7 @@
</nav>
{% endif %}
<footer>
<p>{% if author %}&copy; {{ author }} - {% endif %}
<p>{% if album.author %}&copy; {{ album.author }} - {% endif %}
Generated by <a href="{{ sigal_link }}">sigal</a></p>
</footer>
</div>
@@ -91,7 +91,7 @@
{% if 'sigal.plugins.media_page' in settings.plugins %}
<a href="{{ media.filename}}.html" class="gallery"
title="{{ media.title if media.title else media.filename }}"
data-href="{{ media.filename }}" {{ img_description(media) }}>
data-href="{{ media.filename }}" {{ img_description(media) }}>
{% else %}
<a href="{{ media.filename }}" class="gallery" title="{{ media.filename }}" {{ img_description(media) }}>
{% endif %}

View File

@@ -6,7 +6,7 @@
<title>{{ album.title|striptags }}</title>
<meta name="description" content="">
<meta name="author" content="{{ author }}">
<meta name="author" content="{{ album.author }}">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Molengo">
@@ -113,7 +113,7 @@
</div>
<footer>
<p>{% if author %}&copy; {{ author }} - {% endif %}
<p>{% if album.author %}&copy; {{ album.author }} - {% endif %}
Generated by <a href="{{ sigal_link }}">sigal</a></p>
</footer>
</div>

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
author = 'John Doe'
title = u"Sigal test gallery ☺"
source = 'pictures'
thumb_suffix = '.tn'