Releases: locomotivemtl/charcoal-contrib-sitemap
Releases · locomotivemtl/charcoal-contrib-sitemap
charcoal-contrib-sitemap 0.4.1
charcoal-contrib-sitemap 0.4.0
Complete commits list: 0.3.1...0.4.0
Breaking Changes:
- Refactor XML generation in
SitemapAction
.- ✨ Add support for children which was documented but only partially implemented.
- 🛠️ Replace
toXml()
method with decoupled builder methods that add to a shared XML element.
- Refactor loading and parsing of objects and children in
Builder
.- ⚡️ The
Builder
now transforms objects during the iteration of objects inbuildObject()
instead of transforming inrenderData()
. This reduces the number of times an object is transformed from 6–8 down to 1. - 🐛 Fix a child object's transformer being applied to the parent object when mutating the child's filters and orders.
- 🛠️ Ensure an empty object collection is excluded from the parent/sitemap collections.
- ⚡️ The
- Refactor the
renderData()
inBuilder
how transformers are resolved inSitemapPresenter
.- 🏗️ The
renderData()
method now accepts only two parameters:data
andcontext
(pre-transformed object). - 🛠️ The
renderData()
method now acceptsTraversable
andStringable
objects. - 🛠️ The
renderData()
method now explicitly returnsnull
instead ofvoid
.
- 🏗️ The
- Refactor and fix merging hierarchy/object options in
Builder
.- 🏗️ Replace method
defaultOptions()
withgetDefaultSitemapOptions()
andgetDefaultObjectOptions()
. - 🐛 Fix inconsistent merging of default hierarchy/object options with a hierarchy, objects and their children.
- 🏗️ Replace method
- Add
view
service toBuilder
instead of using each object'sview
handler.- 🏗️ This grants more control to the
Builder
and, by extension, developers integrating the Sitemap package. - ➕ Require Composer dependency locomotivemtl/charcoal-view.
- 🏗️ This grants more control to the
- Remove model factory from
Builder
.- ⚰️ The collection loader of the
Builder
has its own model factory that can instantiate the object from the class string/object type.
- ⚰️ The collection loader of the
- Replace renderer method
render()
withrenderTemplate()
inBuilder
since most examples of renderable data used template strings.- 🏗️ Given the ambiguity of the method names "render" and "renderTemplate" and with Mustache (the default templating engine of Charcoal) using the same method for both file paths and template strings, this led to widespread misuse which causes trouble with other templating engines such as Twig.
- ℹ️ The
render()
method is for template file paths (path/to/view.mustache
) and therenderTemplate()
method is for template strings ({{> path/to/view.mustache }}
).
Changes:
- Rename method
isValidUriHost
toisExternalHost
inSitemapAction
to cause less confusion about its purpose. - Rename language/locale variables in
Builder
to improve clarity. - Reduce duplicate logic for generating absolute/relative URLs in
Builder
. - Fix issues reported by PHPCS.
charcoal-contrib-sitemap 0.3.1
Complete commits list: 0.3.0...0.3.1
Summary:
- Add
Translator
toSitemapPresenter
to use current locale on the cache key in order to generate l10n sitemap content. - Fix
renderData
method inBuilder
class missing transformer parameter.
charcoal-contrib-sitemap 0.3.0
Complete commits list: 0.2.1...0.3.0
Breaking Changes:
-
Added a layer to transform the models into renderable content. Model transformer is required and can be defined for all objects or for specific objects.
{ "sitemap": { "global_sitemap": { "transformer": "charcoal/sitemap/transformer/routable", "objects": { "app/object/section": { "transformer": "\\App\\Transformer\\Sitemap\\Section", "label": "{{ title }}", "url": "{{ url }}", } } } } }
charcoal-contrib-sitemap 0.2.1
Complete commits list: 0.2.0...0.2.1
Summary:
- Added testing of PHP 7.3 to PHP 7.4.
- Added missing Composer dependencies.
- Updated Composer requirements.
- Updated README with more details about configuring sitemaps.
- Cleaned-up codebase with improved block comments, variable names, and syntax.
- Removed boilerplate unit tests.
- Fixed
xhtml:link
namespace. - Fixed URI to latest build badge.
- Fixed URI to builds on Travis website.
- Fixed links and Markdown in README.
charcoal-contrib-sitemap 0.2.0
Complete commits list: 0.1.5...0.2.0
Summary:
- Add Charcoal module to import service provider and set
sitemap.xml
route. - Fix builder to have its own
withBaseUrl
method in case the library is used from the command line. - Update README to fit the new installation process.
charcoal-contrib-sitemap 0.1.5
Complete commits list: 0.1.4...0.1.5
Summary:
- Remove category / hierarchichal object filtering in basic build mode
charcoal-contrib-sitemap 0.1.4
Complete commits list: 0.1.3...0.1.4
Summary:
- Add
relative_urls
option (false
by default) to control whether URLs are absolute or just the path - Updated documentation
charcoal-contrib-sitemap 0.1.3
Complete commits list: 0.1.2...0.1.3
Summary:
- Add
check_active_routes
option (true
by default) to checkisActiveRoute
on routable objects - Updated documentation
charcoal-contrib-sitemap 0.1.2
Complete commits list: 0.1.1...0.1.2
Summary:
- Add
xlmns:xhtml
attribute to sitemap XML - Fix coding style