Skip to content

Commit

Permalink
fix(links): fix docs links not using host name correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Umaaz committed Sep 6, 2023
1 parent a73bfea commit 7ea2a8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion mkdocs_gitlinks/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class GitLinksPlugin(BasePlugin):
('show_docs', config_options.Type(bool, default=False)),
('target', config_options.Type(str, default="_blank")),
('github_host', config_options.Type(str, default="github.com")),
('github_docs_host', config_options.Type(str, default="github.io")),
)

def create_link(self, config: MkDocsConfig, repo_name):
Expand Down Expand Up @@ -66,4 +67,4 @@ def docs_link(self, repo_name):
split = repo_name.split("/")

return """ <a target="%s" title="Open Github Pages" href="https://%s.%s/%s"><span class="gitlink-docs-icon">%s</span></a>""" % (
self.config['target'], split[0], split[1], self.config['github_host'], svg_docs())
self.config['target'], split[0], self.config['github_docs_host'], split[1], svg_docs())

0 comments on commit 7ea2a8d

Please sign in to comment.