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 = config.extra.repo_icon or repo_url %}
|
||||||
{% set platform = "md-source--github" %}
|
{% if "github" in platform %}
|
||||||
{% elif "gitlab." in repo_url %}
|
{% set repo_icon = "md-source--github" %}
|
||||||
{% set platform = "md-source--gitlab" %}
|
{% elif "gitlab" in platform %}
|
||||||
{% elif "bitbucket." in repo_url %}
|
{% set repo_icon = "md-source--gitlab" %}
|
||||||
{% set platform = "md-source--bitbucket" %}
|
{% elif "bitbucket" in platform %}
|
||||||
|
{% set repo_icon = "md-source--bitbucket" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set platform = "" %}
|
{% set repo_icon = "" %}
|
||||||
{% endif %}
|
{% 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">
|
<div class="md-source__repository">
|
||||||
{{ repo_name }}
|
{{ repo_name }}
|
||||||
<ul class="md-source__facts">
|
<ul class="md-source__facts">
|
||||||
|
@ -24,19 +24,20 @@
|
|||||||
Check whether the repository is hosted on one of the supported code hosting
|
Check whether the repository is hosted on one of the supported code hosting
|
||||||
platforms (Github, Gitlab or Bitbucket) to show icon.
|
platforms (Github, Gitlab or Bitbucket) to show icon.
|
||||||
-->
|
-->
|
||||||
{% if "github." in repo_url %}
|
{% set platform = config.extra.repo_icon or repo_url %}
|
||||||
{% set platform = "md-source--github" %}
|
{% if "github" in platform %}
|
||||||
{% elif "gitlab." in repo_url %}
|
{% set repo_icon = "md-source--github" %}
|
||||||
{% set platform = "md-source--gitlab" %}
|
{% elif "gitlab" in platform %}
|
||||||
{% elif "bitbucket." in repo_url %}
|
{% set repo_icon = "md-source--gitlab" %}
|
||||||
{% set platform = "md-source--bitbucket" %}
|
{% elif "bitbucket" in platform %}
|
||||||
|
{% set repo_icon = "md-source--bitbucket" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set platform = "" %}
|
{% set repo_icon = "" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Repository containing source -->
|
<!-- Repository containing source -->
|
||||||
<a href="{{ repo_url }}" title="Go to repository"
|
<a href="{{ repo_url }}" title="Go to repository"
|
||||||
class="md-source {{ platform }}">
|
class="md-source {{ repo_icon }}">
|
||||||
<div class="md-source__repository">
|
<div class="md-source__repository">
|
||||||
{{ repo_name }}
|
{{ repo_name }}
|
||||||
<ul class="md-source__facts">
|
<ul class="md-source__facts">
|
||||||
|
Loading…
Reference in New Issue
Block a user