mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for custom repository icons
This commit is contained in:
@@ -396,9 +396,6 @@ hr {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0; }
|
border: 0; }
|
||||||
|
|
||||||
.md-svg {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
.md-grid {
|
.md-grid {
|
||||||
max-width: 61rem;
|
max-width: 61rem;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@@ -1079,13 +1076,13 @@ hr {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 2.4rem;
|
width: 2.4rem;
|
||||||
height: 2.4rem;
|
height: 2.4rem;
|
||||||
content: "";
|
|
||||||
vertical-align: middle; }
|
vertical-align: middle; }
|
||||||
.md-source__icon svg {
|
.md-source__icon svg {
|
||||||
width: 1.2rem;
|
width: 1.2rem;
|
||||||
height: 1.2rem;
|
height: 1.2rem;
|
||||||
margin-top: 0.6rem;
|
margin-top: 0.6rem;
|
||||||
margin-left: 0.6rem; }
|
margin-left: 0.6rem;
|
||||||
|
fill: white; }
|
||||||
[dir="rtl"] .md-source__icon svg {
|
[dir="rtl"] .md-source__icon svg {
|
||||||
margin-right: 0.6rem;
|
margin-right: 0.6rem;
|
||||||
margin-left: initial; }
|
margin-left: initial; }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
material/assets/stylesheets/app.min.css
vendored
2
material/assets/stylesheets/app.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -87,18 +87,6 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<body dir="{{ lang.t('direction') }}">
|
<body dir="{{ lang.t('direction') }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<svg class="md-svg">
|
|
||||||
<defs>
|
|
||||||
{% set platform = config.extra.repo_icon or config.repo_url %}
|
|
||||||
{% if "github" in platform %}
|
|
||||||
{% include "assets/images/icons/github.svg" %}
|
|
||||||
{% elif "gitlab" in platform %}
|
|
||||||
{% include "assets/images/icons/gitlab.svg" %}
|
|
||||||
{% elif "bitbucket" in platform %}
|
|
||||||
{% include "assets/images/icons/bitbucket.svg" %}
|
|
||||||
{% endif %}
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
<label class="md-overlay" for="__drawer"></label>
|
<label class="md-overlay" for="__drawer"></label>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
This file was automatically generated - do not edit
|
This file was automatically generated - do not edit
|
||||||
-#}
|
-#}
|
||||||
{% import "partials/language.html" as lang with context %}
|
{% import "partials/language.html" as lang with context %}
|
||||||
{% set platform = config.extra.repo_icon or config.repo_url %}
|
{% set platform = config.repo_url %}
|
||||||
{% if "github" in platform %}
|
{% if "github" in platform %}
|
||||||
{% set repo_type = "github" %}
|
{% set repo_type = "github" %}
|
||||||
{% elif "gitlab" in platform %}
|
{% elif "gitlab" in platform %}
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}">
|
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}">
|
||||||
{% if repo_type %}
|
{% if repo_type %}
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
{% set repo_icon = config.extra.repo_icon | default("brands/git-alt") %}
|
||||||
<use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
|
{% include "assets/images/icons/fontawesome/" ~ repo_icon ~ ".svg" %}
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="md-source__repository">
|
<div class="md-source__repository">
|
||||||
|
|||||||
@@ -91,11 +91,6 @@ hr {
|
|||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inline SVG container
|
|
||||||
.md-svg {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Template-wide grid
|
// Template-wide grid
|
||||||
.md-grid {
|
.md-grid {
|
||||||
max-width: px2rem(1220px);
|
max-width: px2rem(1220px);
|
||||||
|
|||||||
@@ -89,7 +89,6 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: px2rem(48px);
|
width: px2rem(48px);
|
||||||
height: px2rem(48px);
|
height: px2rem(48px);
|
||||||
content: "";
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
// Align SVG, do not scale, as this will incur strange formatting bugs
|
// Align SVG, do not scale, as this will incur strange formatting bugs
|
||||||
@@ -99,6 +98,7 @@
|
|||||||
height: px2rem(24px);
|
height: px2rem(24px);
|
||||||
margin-top: px2rem(12px);
|
margin-top: px2rem(12px);
|
||||||
margin-left: px2rem(12px);
|
margin-left: px2rem(12px);
|
||||||
|
fill: $md-color-white;
|
||||||
|
|
||||||
// Adjust for RTL languages
|
// Adjust for RTL languages
|
||||||
[dir="rtl"] & {
|
[dir="rtl"] & {
|
||||||
|
|||||||
@@ -190,25 +190,6 @@
|
|||||||
<body dir="{{ lang.t('direction') }}">
|
<body dir="{{ lang.t('direction') }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Hidden container for inline SVGs -->
|
|
||||||
<svg class="md-svg">
|
|
||||||
<defs>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Check whether the repository is hosted on one of the supported code
|
|
||||||
hosting platforms (GitHub, GitLab or Bitbucket) to show icon.
|
|
||||||
-->
|
|
||||||
{% set platform = config.extra.repo_icon or config.repo_url %}
|
|
||||||
{% if "github" in platform %}
|
|
||||||
{% include "assets/images/icons/github.svg" %}
|
|
||||||
{% elif "gitlab" in platform %}
|
|
||||||
{% include "assets/images/icons/gitlab.svg" %}
|
|
||||||
{% elif "bitbucket" in platform %}
|
|
||||||
{% include "assets/images/icons/bitbucket.svg" %}
|
|
||||||
{% endif %}
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
State toggles - we need to set autocomplete="off" in order to reset the
|
State toggles - we need to set autocomplete="off" in order to reset the
|
||||||
drawer on back button invocation in some browsers
|
drawer on back button invocation in some browsers
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
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.
|
||||||
-->
|
-->
|
||||||
{% set platform = config.extra.repo_icon or config.repo_url %}
|
{% set platform = config.repo_url %}
|
||||||
{% if "github" in platform %}
|
{% if "github" in platform %}
|
||||||
{% set repo_type = "github" %}
|
{% set repo_type = "github" %}
|
||||||
{% elif "gitlab" in platform %}
|
{% elif "gitlab" in platform %}
|
||||||
@@ -46,9 +46,8 @@
|
|||||||
>
|
>
|
||||||
{% if repo_type %}
|
{% if repo_type %}
|
||||||
<div class="md-source__icon">
|
<div class="md-source__icon">
|
||||||
<svg viewBox="0 0 24 24" width="24" height="24">
|
{% set repo_icon = config.extra.repo_icon | default("brands/git-alt") %}
|
||||||
<use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
|
{% include "assets/images/icons/fontawesome/" ~ repo_icon ~ ".svg" %}
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="md-source__repository">
|
<div class="md-source__repository">
|
||||||
|
|||||||
Reference in New Issue
Block a user