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 #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
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