bridgetown icon indicating copy to clipboard operation
bridgetown copied to clipboard

Add built-in initializer plugin for external sources

Open jaredcwhite opened this issue 2 years ago • 4 comments

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:

  • [ ] Add watcher for live reload note: sorta works with additional_watch_paths << File.expand_path("../../test_content/pages", __dir__) …just gotta make this automatic
  • [ ] Tests
  • [ ] Documentation

jaredcwhite avatar Apr 26 '24 18:04 jaredcwhite

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] avatar Apr 26 '24 18:04 render[bot]

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

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

render[bot] avatar Apr 26 '24 18:04 render[bot]

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

jaredcwhite avatar Jul 14 '24 14:07 jaredcwhite