2

I'd like to insert into the README.md file a link to the project's GitLab pages URL without hardcoding it.

Something like:

Visit the project's [pages site]($PROJECT_NAME_PAGES_URL)

instead of

Visit the project's [pages site](https://namespace.gitlab.io/project-name)

Is it possible?

Antonio Pérez
  • 6,702
  • 4
  • 36
  • 61

1 Answers1

3

No, GitLab-flavored markdown does not support any variables/substitutions like this. There are some cases where special gitlab references are allowed, but the GitLab pages URL is not one of them.

The only workaround might be to have a CI job that parses a readme template and updates the README.md on changes, obtaining the pages url from the predefined CI variable $CI_PAGES_URL -- something like what is described in this answer to a similar question.

sytech
  • 29,298
  • 3
  • 45
  • 86