Skip to content

Add Origin.Path to transform template#71

Merged
bwplotka merged 1 commit intobwplotka:mainfrom
saswatamcode:transform-path
Aug 10, 2021
Merged

Add Origin.Path to transform template#71
bwplotka merged 1 commit intobwplotka:mainfrom
saswatamcode:transform-path

Conversation

@saswatamcode
Copy link
Copy Markdown
Collaborator

This PR adds Origin.Path to front/backmatter templates. This is useful in case of constructing links that require paths such as GitHub edit links in path matter and makes YAML DRY-er, for example,

    backMatter:
      template: |
        Found a typo, inconsistency or missing information in our docs?
        Help us to improve [Thanos](https://thanos.io) documentation by proposing a fix [on GitHub here](https://github.com/thanos-io/thanos/edit/main/{{ .Origin.Path }}) :heart:

Test case also added.

Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@saswatamcode saswatamcode requested a review from bwplotka August 8, 2021 04:58
@saswatamcode saswatamcode self-assigned this Aug 8, 2021
Copy link
Copy Markdown
Owner

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bwplotka bwplotka merged commit dd2d810 into bwplotka:main Aug 10, 2021
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.

2 participants