-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Handle resource copying to avoid conversion
- Loading branch information
1 parent
a020700
commit 615f614
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copies resource contents as is to site destination, bypassing Jekyll’s conversion | ||
|
||
Jekyll::Hooks.register :site, :post_write do |site| | ||
if site.config.key?('resource_listings') | ||
site.config['resource_listings'].each do |listing_id, cfg| | ||
copy_resource_contents(cfg, site.config['destination']) | ||
end | ||
end | ||
end | ||
|
||
def copy_resource_contents(resource_cfg, site_dest) | ||
FileUtils.cp_r("#{resource_cfg['resource_root']}/.", "#{site_dest}/#{resource_cfg['index_url']}") | ||
end |