mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 10:46:22 +00:00
fix: solo permitir los mismos tipos de archivo que jekyll
closes #16117
This commit is contained in:
parent
044b14c355
commit
8de05ccce6
1 changed files with 3 additions and 1 deletions
|
@ -14,6 +14,8 @@ module Jekyll
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
DATA_EXTENSIONS = %w[.yaml .yml .json .csv .tsv].freeze
|
||||||
|
|
||||||
def read_data_to(dir, data)
|
def read_data_to(dir, data)
|
||||||
return unless File.directory?(dir) && !@entry_filter.symlink?(dir)
|
return unless File.directory?(dir) && !@entry_filter.symlink?(dir)
|
||||||
|
|
||||||
|
@ -24,7 +26,7 @@ module Jekyll
|
||||||
|
|
||||||
if File.directory?(path)
|
if File.directory?(path)
|
||||||
read_data_to(path, data[sanitize_filename(entry)] = {})
|
read_data_to(path, data[sanitize_filename(entry)] = {})
|
||||||
else
|
elsif DATA_EXTENSIONS.include?(File.extname(entry))
|
||||||
key = sanitize_filename(File.basename(entry, ".*"))
|
key = sanitize_filename(File.basename(entry, ".*"))
|
||||||
data[key] = read_data_file(path)
|
data[key] = read_data_file(path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue