mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-06-07 16:02:10 -04:00
Added support for fetching latest release from GitLab (#7418)
* Fetch version for GitLab repositories * Update documentation about repositories * Fix code formatting
This commit is contained in:
@@ -22,20 +22,25 @@ repo_url: https://github.com/squidfunk/mkdocs-material
|
||||
|
||||
The link to the repository will be rendered next to the search bar on big
|
||||
screens and as part of the main navigation drawer on smaller screen sizes.
|
||||
Additionally, for public repositories hosted on [GitHub] or [GitLab], the
|
||||
number of stars and forks is automatically requested and rendered.
|
||||
|
||||
GitHub repositories also include the tag of the latest release.[^1]
|
||||
Additionally, for public repositories hosted on [GitHub] or [GitLab], the
|
||||
latest release tag[^1], as well as the number of stars and forks, are
|
||||
automatically requested and rendered.
|
||||
|
||||
[^1]:
|
||||
Unfortunately, GitHub only provides an API endpoint to obtain the [latest
|
||||
release] - not the latest tag. Thus, make sure to [create a release] (not
|
||||
pre-release) for the latest tag you want to display next to the number of
|
||||
stars and forks.
|
||||
stars and forks. For GitLab, although it is possible to get a [list of tags
|
||||
sorted by update time], the [equivalent API endpoint] is used. So, make sure
|
||||
you also [create a release for GitLab repositories].
|
||||
|
||||
[repo_url]: https://www.mkdocs.org/user-guide/configuration/#repo_url
|
||||
[latest release]: https://docs.github.com/en/rest/reference/releases#get-the-latest-release
|
||||
[create a release]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
|
||||
[list of tags sorted by update time]: https://docs.gitlab.com/ee/api/tags.html#list-project-repository-tags
|
||||
[equivalent API endpoint]: https://docs.gitlab.com/ee/api/releases/#get-the-latest-release
|
||||
[create a release for GitLab repositories]: https://docs.gitlab.com/ee/user/project/releases/#create-a-release
|
||||
|
||||
#### Repository name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user