5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-02-24 20:11:51 +00:00

Merge branch 'production.panel.sutty.nl' of 0xacab.org:sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-04-22 17:57:08 +00:00
commit 08fadce324

View file

@ -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