diff options
Diffstat (limited to 'nikola/plugins/task/galleries.py')
| -rw-r--r-- | nikola/plugins/task/galleries.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nikola/plugins/task/galleries.py b/nikola/plugins/task/galleries.py index c9b1915..a780d76 100644 --- a/nikola/plugins/task/galleries.py +++ b/nikola/plugins/task/galleries.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright © 2012-2021 Roberto Alsina and others. +# Copyright © 2012-2022 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated @@ -85,6 +85,7 @@ class Galleries(Task, ImageProcessor): 'exif_whitelist': site.config['EXIF_WHITELIST'], 'preserve_icc_profiles': site.config['PRESERVE_ICC_PROFILES'], 'index_path': site.config['INDEX_PATH'], + 'index_file': site.config['INDEX_FILE'], 'disable_indexes': site.config['DISABLE_INDEXES'], 'galleries_use_thumbnail': site.config['GALLERIES_USE_THUMBNAIL'], 'galleries_default_thumbnail': site.config['GALLERIES_DEFAULT_THUMBNAIL'], @@ -270,6 +271,10 @@ class Galleries(Task, ImageProcessor): for path, folder in folder_list: fpost = self.parse_index(path, input_folder, output_folder) if fpost: + # do not add galleries to the folders that are either + # of these states (#3598) + if fpost.is_draft or fpost.is_private or fpost.publish_later: + continue ft = fpost.title(lang) or folder else: ft = folder @@ -522,6 +527,9 @@ class Galleries(Task, ImageProcessor): post.meta[lang]['title'] = os.path.split(gallery)[1] # Register the post (via #2417) self.site.post_per_input_file[index_path] = post + # Register post for the sitemap, too (#3598) + index_output = os.path.join(gallery, self.kw['index_file']) + self.site.post_per_file[index_output] = post else: post = None return post |
