Browse Source

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.
pull/143/head
Simon Conseil 11 years ago
parent
commit
ff2c79ca6d
  1. 5
      sigal/gallery.py
  2. 6
      sigal/themes/colorbox/templates/index.html
  3. 4
      sigal/themes/galleria/templates/index.html
  4. 1
      tests/sample/sigal.conf.py

5
sigal/gallery.py

@ -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
sigal/themes/colorbox/templates/index.html

@ -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 %}

4
sigal/themes/galleria/templates/index.html

@ -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>

1
tests/sample/sigal.conf.py

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

Loading…
Cancel
Save