When my package is hosted on GitLab, I found that the icon on the generated web page was GitHub, but the connection was normal and I need to make some adjustments manually in docs/index.html.
<span class="fab fa fab fa-gitlab fa-lg"></span>
I just ran into this issue too. Is there a way to get the right icon without having to manually modify the html?
You can configure this in your _pkgdown.yml. Here's a quick example modifying the navbar configuration demonstrated in the package documentation at YAML config - navbar.
Instead of github, you can create a gitlab component that uses the GitLab Font Awesome icon and points to your GitLab URL.
navbar:
structure:
left: [home, intro, reference, articles, tutorials, news]
right: [gitlab]
components:
gitlab:
icon: fab fa-gitlab fa-lg
href: https://gitlab.com/username/project
You can configure this in your
_pkgdown.yml. Here's a quick example modifying the navbar configuration demonstrated in the package documentation at YAML config - navbar.Instead of
github, you can create agitlabcomponent that uses the GitLab Font Awesome icon and points to your GitLab URL.navbar: structure: left: [home, intro, reference, articles, tutorials, news] right: [gitlab] components: gitlab: icon: fab fa-gitlab fa-lg href: https://gitlab.com/username/project
That's a good idea, but I still think it's complicated.
Thanks, @gadenbuie! This solution works, but if one has URL set in the DESCRIPTION file (or repo: url: ... in _pkgdown.yml), the Github icon is still displayed, now on the left side. Is there a way to get rid of it without removing the URL definition (which is useful to have for other parts of the webpage generated by pkgdown).
I can reproduce this, too. Essentially, if repo$url$home is set in the _pkgdown.yml, then a github navbar component is added (here in navbar_component()).
With the following _pkgdown.yml a GitHub icon will appear on the left navbar linking to repo$url$home.
repo:
url:
home: https://gitlab.com/username/project
navbar:
structure:
left: [home, intro, reference, articles, tutorials, news]
right: [gitlab]
components:
gitlab:
icon: fab fa-gitlab fa-lg
href: https://gitlab.com/username/project
You can actually suppress the extra icon by changing the name of the gitlab component to github, although I don't think this is documented and maybe the maintainers will want to change this.
repo:
url:
home: https://gitlab.com/username/project
navbar:
structure:
left: [home, intro, reference, articles, tutorials, news]
right: [github]
components:
github:
icon: fab fa-gitlab fa-lg
href: https://gitlab.com/username/project
I don't use GitLab, so if folks want this in pkgdown, someone is going to have to propose a PR.
Most helpful comment
You can configure this in your
_pkgdown.yml. Here's a quick example modifying the navbar configuration demonstrated in the package documentation at YAML config - navbar.Instead of
github, you can create agitlabcomponent that uses the GitLab Font Awesome icon and points to your GitLab URL.