Skip to content

Add .Page.SourceInfo #12998

@bep

Description

@bep

In many template error/warning situations (when we don't have any .Pos info), a common need is to have some way of referring to the source, e.g. where to fix the issue, e.g.

{{ warnf "you need to fix the front matter in %s" .Path }}

The problem with the above is that .Path in many cases is not very precise and not something I can just click on and take you to the source.

It would be practical if I would just do:

{{ warnf "you need to fix the front matter in %s" .SourceInfo }}

And the struct printed itself with enough information to take me to the correct content file/adapter.

It's certainly possible to create such reference using ifs and withs, but it's much harder than it should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions