You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: userguide/content/en/docs/adding-content/repository-links.md
+257-3
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,265 @@ The Docsy [docs and blog layouts](/docs/adding-content/content/#adding-docs-and-
15
15
16
16
This page shows you how to configure these links.
17
17
18
-
Currently, Docsy supports only GitHubrepository links "out of the box". Since GitLab can handle the same link scheme, it should work as well. If you are using another repository such as Bitbucket and would like generated repository links, feel free to [add a feature request or update our theme](/docs/contribution-guidelines/).
18
+
Currently, Docsy supports GitHub, Azure DevOps, GitLab and Gitea repository links "out of the box". If you are using another repository such as Bitbucket and would like generated repository links, you can add a custom template to render the links. Feel free to [add a feature request or update our theme](/docs/contribution-guidelines/).
19
19
20
20
## Link configuration
21
21
22
-
There are four site variables you can configure in `hugo.toml`/`hugo.yaml`/`hugo.json` to set up links, as well as one in your page metadata.
22
+
There are a few site variables you can configure in `hugo.toml`/`hugo.yaml`/`hugo.json` to set up links, as well as in your page metadata.
Repo Links are created differently for different types of git repositories. Currently Docsy supports [GitHub](https://www.github.com), [Azure DevOps](https://azure.microsoft.com/products/devops), [GitLab](https://about.gitlab.com) and [Gitea](https://about.gitea.com). Specify the type of repository you are using, supported values are `github`, `azure`, `gitlab`, `gitea`.
61
+
62
+
Other repo types:
63
+
64
+
*[Forgejo](https://forgejo.org) is a fork of gitea and uses the same link schema as gitea, so you can use `type: gitea`.
65
+
* To use a **custom repository type**
66
+
* define `type: custom` in your configuration and
67
+
* place a custom template in your project at `layouts/partials/repo-links-custom.html` which will be used to render the links.
68
+
Instead of `custom` you can use any type, you like.
69
+
70
+
### `repo.url`
71
+
72
+
The URL for your site's source repository. This is used to generate the *Edit this page*, *Create child page*, and *Create documentation issue* links.
73
+
74
+
### `repo.subdir` (optional)
75
+
76
+
Specify a value here if your content directory is not in your repo's root directory. For example, this site is in the userguide subdirectory of its repo. Setting this value means that your edit links will go to the right page.
77
+
78
+
### `repo.branch` (optional)
79
+
80
+
Specify a value here if you have would like to reference a different branch than `main` in the links to your repository like *Edit this page*.
81
+
82
+
### `repo.project_url` (optional)
83
+
84
+
Specify a value here if you have a separate project repo and you'd like your users to be able to create issues against your project from the relevant docs. The *Create project issue* link appears only if this is set.
85
+
86
+
It is assumed that the `project_url` points to the same type of git repository as your documentation site.
87
+
88
+
### `path_base_for_subdir` (optional)
89
+
90
+
Suppose that the source files for all of the pages under `content/some-section`
91
+
come from another repo, such as a [git submodule][]. Add settings like these to
92
+
the **section's index page** so that the repository links for all pages in that
Please note that the YAML code fragment makes use of [Yaml anchor](https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/). Use of Yaml anchors is optional, but it helps keep the settings [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself).
194
+
{{% /alert %}}
195
+
196
+
The `path_base_for_subdir` setting is a regular expression, so you can
197
+
use it even if you have a site with [multiple languages][] for example:
0 commit comments