Added settings to give a different output filename than index.html

This commit is contained in:
Jonas Kaufmann
2014-09-28 15:38:51 +02:00
parent b5b3e83343
commit 0285a0ebab
3 changed files with 10 additions and 4 deletions

View File

@@ -223,13 +223,13 @@ class Album(UnicodeMixin):
"""
description_file = "index.md"
output_file = 'index.html'
def __init__(self, path, settings, dirnames, filenames, gallery):
def __init__(self, path, settings, dirnames, filenames, gallery, output_file='index.html'):
self.path = path
self.name = path.split(os.path.sep)[-1]
self.gallery = gallery
self.settings = settings
self.output_file = output_file
self._thumbnail = None
if path == '.':
@@ -480,6 +480,8 @@ class Gallery(object):
ignore_dirs = settings['ignore_directories']
ignore_files = settings['ignore_files']
output_filename = settings['output_filename']
progressChars = cycle(["/", "-", "\\", "|"])
if self.logger.getEffectiveLevel() >= logging.WARNING:
self.progressbar_target = None
@@ -516,7 +518,7 @@ class Gallery(object):
if path not in albums.keys():
dirs.remove(d)
album = Album(relpath, settings, dirs, files, self)
album = Album(relpath, settings, dirs, files, self, output_filename)
if not album.medias and not album.albums:
self.logger.info('Skip empty album: %r', album)

View File

@@ -50,6 +50,7 @@ _DEFAULT_CONFIG = {
'medias_sort_attr': 'filename',
'medias_sort_reverse': False,
'make_thumbs': True,
'output_filename': 'index.html',
'orig_dir': 'original',
'orig_link': False,
'plugins': [],

View File

@@ -95,7 +95,10 @@ ignore_files = []
# Write HTML files. If False, sigal will only process the images.
# write_html = True
# Add index.html to the URLs
# Name of the generated HTML files
# output_filename = 'index.html'
# Add output filename (see above) to the URLs
# index_in_url = False
# A list of links (tuples (title, URL))