diff --git a/.gitignore b/.gitignore index 6542325c5..47233d1f5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ appdates.csv _config.yml tests/Layout/bin/tmp.* tests/Layout/testresult.bmp -/apps.json diff --git a/_plugins/AppsJsonGenerator.rb b/_plugins/AppsJsonGenerator.rb deleted file mode 100644 index 1a6525cca..000000000 --- a/_plugins/AppsJsonGenerator.rb +++ /dev/null @@ -1,26 +0,0 @@ -class AppsJsonPage < Jekyll::Page - def initialize(site) - @site = site - @base = site.source - @basename = 'apps' - @ext = '.json' - @name = 'apps.json' - @data = {} - end -end - -# Generates the apps.json -# out of all the /apps/*/metadata.json files -class Generator < Jekyll::Generator - safe true - - def generate(site) - metadatas = site.static_files.select { |file| file.name == 'metadata.json' } - json = metadatas.map { |file| JSON.load(open(file.path)) } - appsjson = AppsJsonPage.new(site) - open(appsjson.path, 'wb') do |file| - file << JSON.generate(json) - end - site.pages << appsjson - end -end diff --git a/apps.json b/apps.json new file mode 100644 index 000000000..c62663ee0 --- /dev/null +++ b/apps.json @@ -0,0 +1,14 @@ +--- +layout: none +--- +{%- assign apps = site.static_files | where: "name", "metadata.json" -%} + +[ + +{%- include_relative {{ apps.first.path }} -%} + +{%- for app in apps offset:1 -%} +,{%- include_relative {{ app.path }} -%} +{%- endfor -%} + +]