Created
December 8, 2023 20:07
-
-
Save afomi/f1ebde66d85c5252b51405b8c8aec4b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script.rb | |
require 'yaml' | |
# Load the existing configuration | |
config = YAML.load_file('_config.yml') | |
# Modify the configuration using ENV variables | |
config['some_setting'] = ENV['MY_ENV_VARIABLE'] || 'default_value' | |
# Write the modified configuration to a new file | |
File.open('_config_temp.yml', 'w') { |f| f.write(config.to_yaml) } | |
# Now use this config file to build the Jekyll site | |
system("jekyll build --config _config_temp.yml") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment