Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaredcwhite
Copy link
Member

@jaredcwhite jaredcwhite commented Apr 26, 2024

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 jaredcwhite added this to the 2.0 milestone Apr 26, 2024
Copy link

render bot commented Apr 26, 2024

Copy link

render bot commented Apr 26, 2024

@jaredcwhite jaredcwhite added enhancement New feature or request resource engine Related to the new Resource content engine labels May 4, 2024
@jaredcwhite jaredcwhite changed the title Add built-in initializer plugin for external sources Add built-in initializer plugin for external sources [HOLD for b1) Jul 14, 2024
@jaredcwhite jaredcwhite changed the title Add built-in initializer plugin for external sources [HOLD for b1) Add built-in initializer plugin for external sources [HOLD for b1] Jul 14, 2024
@jaredcwhite
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resource engine Related to the new Resource content engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for symbolized hashes for frontmatter defaults in the Ruby initializer DSL
1 participant