Add basic support for variables in README files

Description

As README files are now widely used to display badges we need a way to make these badges reflect the state of the current branch / fork without modifying the content of the README.

Proposal

Introduce the notion of variables in README, these are just tokens which are replaced by their value depending on the context.

For instance we could have:

  • %CURRENT_PROJECT%
  • %CURRENT_NAMESPACE%
  • %CURRENT_SERVER%
  • %CURRENT_BRANCH%

A standard badge link https://gitlab.com/<namespace>/<project>/badges/master/build.svg would then become %CURRENT_SERVER%/%CURRENT_NAMESPACE%/%CURRENT_PROJECT%/badges/%CURRENT_BRANCH%/build.svg

That way the build badge would always reflect the build of the current branch / fork.

I'm sure it can be used fro many other things but I also think we need to keep it minimalistic not to make README indecipherable.

Edited Jun 16, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading