Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Language/role/version set in filename, e.g. mypage._role_member.md should replace any mount configuration for that dimension #14756

@bep

Description

@bep

This relates to #14750 -- of solving that issue has made this issue more visible.

If I have this roles and mounts config:

[roles]
    [roles.guest]
        weight = 100
    [roles.member]
        weight = 200

[module]
    [[module.mounts]]
        source = 'content/member'
        target = 'content'
        [module.mounts.sites.matrix]
            roles = "member"
    [[module.mounts]]
        source = 'content/guest'
        target = 'content'
        [module.mounts.sites.matrix]
            # This allows the member role to also see the guest content.
            # But note the order of the mounts here, this will be fallback content for members.
            roles = "*"

And this in content/member:

_index.md           20220330_094321.jpg 20220330_094357.jpg 20220330_095331.jpg

And this in content/guest:

_index.md                        20220330_094115._role_member_.jpg 20221020_114303.jpg

The current behavior for the bundled resource 20220330_094115._role_guest.jpg in content/member is that:

  • It gets assigned all roles from the mount config (roles = "*")
  • It gets assigned the member role from the filename.

The expected and obviously most useful behaviour would be if any dimension value(s) (language, role or version) in the filename would replace any existing file mount config for that dimension. In the example above 20220330_094115._role_member.jpg would be assigned the member role only.

A note mostly to myself re the above: Any sites matrix definition in front matter will work how we want the filename to work above, to the order of precedence after fixing this would be front matter => filename => file mount, which I think makes the most sense.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions