Skip to content

Commit 6358dda

Browse files
committed
Allow skipping social image generation
1 parent 04af8ab commit 6358dda

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
### In cases where you want to specify the cache key, enable the above 2 inputs
5555
### Follows the format here https://github.com/actions/cache
5656
#
57-
custom_opts: '--future --config _config.yml,_only_latest_guides_config.yml'
57+
custom_opts: '--future --config _config.yml,_only_latest_guides_config.yml,_nosocialimages_config.yml'
5858
### If you need to specify any Jekyll build options, enable the above input
5959
### Flags accepted can be found here https://jekyllrb.com/docs/configuration/options/#build-command-options
6060

_nosocialimages_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
skip_social_images: true

_plugins/social_images.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ def social_image(text, page_path)
2222

2323
class GenerateSocialImagesGenerator < Generator
2424
def generate(site)
25+
# Check if skip_social_images is set to true
26+
# If so, skip generating social images
27+
# This is useful when running the site locally
28+
if site.config['skip_social_images']
29+
Jekyll.logger.info('Skipping social image generation')
30+
return
31+
end
2532
guides = Dir.glob(File.join(site.source, '_guides', '*.adoc'))
2633
output_dir = 'assets/images/social'
2734
FileUtils.mkdir_p(File.join(site.source, output_dir))

0 commit comments

Comments
 (0)