mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Add extra.repo_type config option to override link parser
This commit is contained in:
parent
eaeba59dd8
commit
a18eb4f982
@ -1,13 +1,14 @@
|
||||
{% if "github." in repo_url %}
|
||||
{% set platform = "md-source--github" %}
|
||||
{% elif "gitlab." in repo_url %}
|
||||
{% set platform = "md-source--gitlab" %}
|
||||
{% elif "bitbucket." in repo_url %}
|
||||
{% set platform = "md-source--bitbucket" %}
|
||||
{% set platform = config.extra.repo_icon or repo_url %}
|
||||
{% if "github" in platform %}
|
||||
{% set repo_icon = "md-source--github" %}
|
||||
{% elif "gitlab" in platform %}
|
||||
{% set repo_icon = "md-source--gitlab" %}
|
||||
{% elif "bitbucket" in platform %}
|
||||
{% set repo_icon = "md-source--bitbucket" %}
|
||||
{% else %}
|
||||
{% set platform = "" %}
|
||||
{% set repo_icon = "" %}
|
||||
{% endif %}
|
||||
<a href="{{ repo_url }}" title="Go to repository" class="md-source {{ platform }}">
|
||||
<a href="{{ repo_url }}" title="Go to repository" class="md-source {{ repo_icon }}">
|
||||
<div class="md-source__repository">
|
||||
{{ repo_name }}
|
||||
<ul class="md-source__facts">
|
||||
|
@ -24,19 +24,20 @@
|
||||
Check whether the repository is hosted on one of the supported code hosting
|
||||
platforms (Github, Gitlab or Bitbucket) to show icon.
|
||||
-->
|
||||
{% if "github." in repo_url %}
|
||||
{% set platform = "md-source--github" %}
|
||||
{% elif "gitlab." in repo_url %}
|
||||
{% set platform = "md-source--gitlab" %}
|
||||
{% elif "bitbucket." in repo_url %}
|
||||
{% set platform = "md-source--bitbucket" %}
|
||||
{% set platform = config.extra.repo_icon or repo_url %}
|
||||
{% if "github" in platform %}
|
||||
{% set repo_icon = "md-source--github" %}
|
||||
{% elif "gitlab" in platform %}
|
||||
{% set repo_icon = "md-source--gitlab" %}
|
||||
{% elif "bitbucket" in platform %}
|
||||
{% set repo_icon = "md-source--bitbucket" %}
|
||||
{% else %}
|
||||
{% set platform = "" %}
|
||||
{% set repo_icon = "" %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Repository containing source -->
|
||||
<a href="{{ repo_url }}" title="Go to repository"
|
||||
class="md-source {{ platform }}">
|
||||
class="md-source {{ repo_icon }}">
|
||||
<div class="md-source__repository">
|
||||
{{ repo_name }}
|
||||
<ul class="md-source__facts">
|
||||
|
Loading…
Reference in New Issue
Block a user