diff --git a/plugins/site_pages.rb b/plugins/site_pages.rb new file mode 100644 index 00000000000..517f4571195 --- /dev/null +++ b/plugins/site_pages.rb @@ -0,0 +1,27 @@ +module Jekyll + class SitePagesGenerator < Jekyll::Generator + def generate(site) + all_pages = Array.new + + site.collections.each do |name, collection| + all_pages.concat(collection.docs) + end + + site.data["site_pages"] = all_pages + .concat(site.pages) + .concat(site.documents) + .map { |entry| + [ + entry.url.to_s, + { + "title" => entry["title"], + "description" => entry["description"], + "url" => entry.url, + "relative_path" => entry.relative_path + } + ] + } + .to_h + end + end +end \ No newline at end of file diff --git a/source/_includes/related.html b/source/_includes/related.html index 81fd4ba91d0..65ffe151326 100644 --- a/source/_includes/related.html +++ b/source/_includes/related.html @@ -11,23 +11,19 @@