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:
@@ -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)
|
||||
|
||||
@@ -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 %}© {{ author }} - {% endif %}
|
||||
<p>{% if album.author %}© {{ 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 %}
|
||||
|
||||
@@ -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 %}© {{ author }} - {% endif %}
|
||||
<p>{% if album.author %}© {{ album.author }} - {% endif %}
|
||||
Generated by <a href="{{ sigal_link }}">sigal</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
author = 'John Doe'
|
||||
title = u"Sigal test gallery ☺"
|
||||
source = 'pictures'
|
||||
thumb_suffix = '.tn'
|
||||
|
||||
Reference in New Issue
Block a user