Skip to content

3.0.0 β€” New config files and component nesting

Compare
Choose a tag to compare
@bglw bglw released this 06 Apr 20:28
· 371 commits to main since this release

Features

  • Bookshop has a new component configuration syntax. See the Bookshop 3.0 migration guide for in-depth information

    • The new configuration files allow for your inputs to be configured using CloudCannon's _inputs configuration
  • Your component blueprint can now nest other components and structures (c1dd5f2)

    • By using bookshop:<component> or bookshop:structure:<structure> in your component blueprint, you can nest the blueprint of other components, rather than having to re-specify their fields.
    • See the Jekyll, Eleventy, or Hugo guide for more examples.
  • eleventy: Site data and collections are now available to your templates while live editing (df009c4)

    • For data to be accessible, you will need to expose each data set using data_config in your CloudCannon Global Configuration file.
  • hugo: site.Data is now available to your templates while live editing (cac0fd3)

    • For data to be accessible, you will need to set data_config: true in your CloudCannon Global Configuration file.
  • hugo: Site string functions are now available to your templates while live editing (a71e1ea)

    • This encompasses the common configuration variables site.Title, site.BaseURL, and site.Copyright
  • Embedding the Component Browser is now easier across all SSGs (1226d01)

    • Using the {% bookshop_component_browser %} or {{ partial "bookshop_component_browser" }} is now all that is needed.
    • This will handle both local browsing of the component library, and building a hosted component library.
  • Bookshop will now set a CMS loading state while live editing is initializing (5b65707)

    • This is especially helpful for first loads on Hugo sites, while loading the live editing WebAssembly
  • The bookshop/init command can now create new Bookshop projects (824de51)

    • Running npx @bookshop/init --new <name> will scaffold out a new Bookshop for you
  • The new npx @bookshop/up@latest command can upgrade all Bookshop dependencies. (6ffe599)

    • This will also migrate old config files to the new syntax, and can convert between different file formats.
  • npx @bookshop/init can now generate all supported file formats (4ab5276)

  • eleventy: The url filter is now available to your templates while live editing (bd44ae0)

    • This requires that a pathPrefix is passed to eleventy-bookshop in your .eleventy.js.
  • jekyll: The relative_url filter is now available to your templates while live editing (79304cc)

  • Bookshop will now log a console error when your live editing package versions don't match the Bookshop plugin version your site was built with (798e7ed)

Bug Fixes

  • eleventy: Bookshop live editing no longer crashes when passing recursive data structures to components (98610b4)

  • jekyll/eleventy: Variables using complex filters with arguments now render correctly (d87797c)

  • jekyll/eleventy: Variable assignments that span multiple lines now render correctly (d87797c)

  • browser: The component browser now loads in safari (10eb05f)

  • hugo: Nested component paths (like sections/hero) are now correctly resolved when live editing (5fab912)

  • hugo: Ranging over a map now works correctly when live editing (46a0d51)

  • hugo: Loading a hosted Bookshop Component Library now loads the WebAssembly correctly (0d8cc82)

  • hugo: Live editing in Hugo now loads the WebAssembly from a cdn correctly (e9b9aaf)

BREAKING CHANGES

  • Bookshop config files now have a different structure.
    See the Bookshop 3.0 migration guide for more information.

  • eleventy/jekyll: Eleventy and Jekyll sites will need to change from the
    {% bookshop_browser <PORT> %} tag to the
    {% bookshop_component_browser %} tag. The new tag requires
    no arguments.

  • eleventy: The @bookshop/cloudcannon-eleventy-bookshop plugin is now superseded by
    the bookshop/generate npm package.
    See the Bookshop 3.0 migration guide for more information.

  • jekyll: The cloudcannon-jekyll-bookshop plugin is now superseded by
    the bookshop/generate npm package.
    See the Bookshop 3.0 migration guide for more information.

  • jekyll: For data to be accessible when live editing, you will need to set
    data_config: true in your cloudcannon.config.* file.

  • jekyll: Some collection fields such as page.content
    and page.excerpt are no longer available when live editing.

  • jekyll: Data and collections are no longer accessible
    from the component browser.