bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.14k stars 114 forks source link

Add built-in initializer plugin for external sources [HOLD for b1] #886

Open jaredcwhite opened 5 months ago

jaredcwhite commented 5 months ago

Initial work towards #819, #884 Fixes #704

This PR expands on the Source Manifest functionality so that multiple per-collection content directories can be specified. So you can load content into pages and/or other collections as you wish.

In addition, a new external_sources initializer plugin is provided so a site owner can easily add their own source manifest in order to load external content. Here's an example config/initializers.rb file:

init :external_sources do
  contents do
    docs File.expand_path("../../test_content/pages", __dir__)
  end
end

collections do
  docs { output true }
end

config.defaults << {
  scope: { collection: "docs" },
  values: { layout: "page" },
}

TODO:

render[bot] commented 5 months ago

Your Render PR Server URL is https://bridgetown-beta-pr-886.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-colvgh21hbls73abjps0.

render[bot] commented 5 months ago

Your Render PR Server URL is https://bridgetown-api-pr-886.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-colvgha1hbls73abjq20.

jaredcwhite commented 2 months ago

I hope to get this into Bridgetown 1.0 but keeping it on ice for the Beta 1 release.