aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/task/galleries.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-08-05 01:00:44 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-08-05 01:00:44 -0400
commitc61750def3e047296a3633247aec4637bd216633 (patch)
treecd7175c2f172e20255adb7d0ccf9a5fa405df175 /nikola/plugins/task/galleries.py
parent9132854aa950a4c85c89cf7617d3240bd3fe1cbd (diff)
parent393aa58f2c5afd51f92fd9bd4b6dfd0dc90cea41 (diff)
Update upstream source from tag 'upstream/8.2.3'
Update to upstream version '8.2.3' with Debian dir 572430fed4befec44daff4153d2f83da363024d0
Diffstat (limited to 'nikola/plugins/task/galleries.py')
-rw-r--r--nikola/plugins/task/galleries.py10
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