Skip to content

Add localeId of cloned assets at the root instead of injecting it into the fileName#1

Open
Munter wants to merge 1 commit intomasterfrom
major/localeid-at-root
Open

Add localeId of cloned assets at the root instead of injecting it into the fileName#1
Munter wants to merge 1 commit intomasterfrom
major/localeid-at-root

Conversation

@Munter
Copy link
Copy Markdown
Member

@Munter Munter commented Jan 15, 2017

Closes assetgraph/assetgraph-builder#479

With this major version bump localised assets will now be placed at /da/index.html rather than /index.da.html.

This has the effect that anchors pointing at index routes, like /path/to/page instead of path/to/page.html, will keep their referential coherence after running cloneForEachLocale.

IMO keeping referential integrity in the graph is of higher importance than keeping aligned with web server plugin specific file naming conventions, which can just be reconfigured. If we lose referential integrity we block any ability for graph transformations later in a pipeline from following the relations that now have no proper to-asset.

If we can find a way to make the url rewriting configurable, so the build system outputs what a server expects, that might be better. But I didn't want to spend time on it right now.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 79.61% when pulling a2ba3a3 on major/localeid-at-root into 60679c5 on master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 79.61% when pulling a2ba3a3 on major/localeid-at-root into 60679c5 on master.

@papandreou
Copy link
Copy Markdown
Member

I really like this idea. I think we should expose cloneForEachLocale in the main export through some sort of mode switch, and then have another mode switch that turns on this behavior.

IMO keeping referential integrity in the graph is of higher importance than keeping aligned with web server plugin specific file naming conventions

Very much agreed. It's an endless source of pain and hacks whenever we break the references (as evidenced by that ag-b PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants