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?
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.