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

jaredcwhite commented Jul 14, 2024

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

@jaredcwhite jaredcwhite removed this from the 2.0 milestone Nov 9, 2024
@jaredcwhite
Copy link
Member Author

jaredcwhite commented Nov 9, 2024

I'm like super excited to keep working on this, but I think I'll punt on polishing it up until v2.1. We gotten tighten up the focus of the 2.0 release or I'll never get this done and out the door. 😅

I may pull a bit of legwork into a smaller PR though, so we can still fix #704 in 2.0

@jaredcwhite jaredcwhite changed the title Add built-in initializer plugin for external sources [HOLD for b1] Add built-in initializer plugin for external sources Nov 9, 2024
@jaredcwhite jaredcwhite added this to the 2.1 milestone Nov 23, 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