Update material theme (#573)
update material theme update overrides fix search update date style and remove edit link added copyright notices when required fix site verif code minify all the code Signed-off-by: Nicolas MASSART <nicolas.massart@consensys.net>pull/585/head
parent
c05ea3bcda
commit
0b1643c360
@ -1,106 +1,50 @@ |
||||
{% extends "base.html" %} |
||||
|
||||
{% block extrahead %} |
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/custom_theme.css' | url }}"> |
||||
{% block libs %} |
||||
<script>const latestWarningTrigger = "{{config.extra.latest_version_warning.url_contains}}";</script> |
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous"> |
||||
<script |
||||
src="https://code.jquery.com/jquery-2.2.4.min.js" |
||||
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" |
||||
crossorigin="anonymous"></script> |
||||
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML"></script> |
||||
<script src="{{ 'assets/javascripts/custom_theme.js' | url }}"></script> |
||||
{% if config.extra.google.site_verification %} |
||||
<!-- Google site verification for search console --> |
||||
<meta name="google-site-verification" content="{{config.extra.google.site_verification}}" /> |
||||
{% endif %} |
||||
|
||||
{% if config.extra.google.tag_manager %} |
||||
<!-- Google Tag Manager --> |
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
||||
})(window,document,'script','dataLayer','{{config.extra.google.tag_manager}}');</script> |
||||
<!-- End Google Tag Manager --> |
||||
{% endif %} |
||||
|
||||
<script src="{{ 'assets/javascripts/zoomify.min.js' | url }}"></script> |
||||
<link href="{{ 'assets/stylesheets/zoomify.min.css' | url }}" rel="stylesheet"> |
||||
{% endblock %} |
||||
|
||||
{% block analytics %} |
||||
<!--Empty the footer analytics bloc as we need it the headers --> |
||||
{% endblock %} |
||||
|
||||
{% block hero %} |
||||
{# hero is not used, so use it for warning banner #} |
||||
<script>const latestWarningTrigger = "{{config.extra.latest_version_warning.url_contains}}";</script> |
||||
<div class="latest-warning">{{config.extra.latest_version_warning.text}}</div> |
||||
{% endblock %} |
||||
|
||||
<!-- Content --> |
||||
{% block content %} |
||||
{% block analytics %} |
||||
{% include "partials/integrations/analytics.html" %} |
||||
{% endblock %} |
||||
|
||||
<!-- Edit button, if URL was defined --> |
||||
<!--The button has to point to the doc site and as it's not designed to have doc outside of code |
||||
repos we have to replace the mkdocs generated link based on the code repos with the doc repos--> |
||||
{% if page.edit_url and config.extra.doc_site_edit_url %} |
||||
<a href="{{ page.edit_url | replace(config.repo_url, config.extra.doc_site_edit_url) }}" |
||||
title="{{ lang.t('edit.link.title') }}" |
||||
class="md-icon md-content__icon"><!-- edit --></a> |
||||
{% block config %} |
||||
{% if config.plugins.search %} |
||||
<script> |
||||
// Make the search query replace _-. by spaces to extend the search to all RPC methods |
||||
// see https://github.com/hyperledger/besu-docs/issues/448 |
||||
var search = { |
||||
transform: function(query) { |
||||
var transformedQuery = query |
||||
.replace(/[\_\-\.]/g, " ") |
||||
.trim() |
||||
console.log(transformedQuery) |
||||
return transformedQuery |
||||
} |
||||
} |
||||
</script> |
||||
{% endif %} |
||||
{% endblock %} |
||||
|
||||
{% if page.meta.git_revision_date_localized %} |
||||
<small><br><i>Updated on {{ page.meta.git_revision_date_localized }}</i></small> |
||||
{% endif %} |
||||
|
||||
<!-- |
||||
Hack: check whether the content contains a h1 headline. If it |
||||
doesn't, the page title (or respectively site name) is used |
||||
as the main headline. |
||||
--> |
||||
{% block content %} |
||||
{% if page and page.meta %} |
||||
{% if page.meta.git_revision_date_localized or page.meta.revision_date %} |
||||
{% include "partials/source-date.html" %} |
||||
{% endif %} |
||||
{% endif %} |
||||
{% if not "\x3ch1" in page.content %} |
||||
<h1>{{ page.title | default(config.site_name, true)}}</h1> |
||||
{% endif %} |
||||
|
||||
<!-- Content --> |
||||
{{ page.content }} |
||||
|
||||
<!-- Source files --> |
||||
{% block source %} |
||||
{% if page and page.meta and page.meta.source %} |
||||
<h2 id="__source">{{ lang.t("meta.source") }}</h2> |
||||
{% set repo = config.repo_url %} |
||||
{% if repo | last == "/" %} |
||||
{% set repo = repo[:-1] %} |
||||
{% endif %} |
||||
{% set path = page.meta.path | default([""]) %} |
||||
{% set file = page.meta.source %} |
||||
<a href="{{ [repo, path, file] | join('/') }}" |
||||
title="{{ file }}" class="md-source-file"> |
||||
{{ file }} |
||||
</a> |
||||
{% endif %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
|
||||
{% block fonts %} |
||||
<!-- Load fonts from Google --> |
||||
{% if font != false %} |
||||
<link rel="stylesheet" type="text/css" |
||||
href="https://fonts.googleapis.com/css?family={{ |
||||
font.text | replace(' ', '+') + ':300,400,400i,700|' + |
||||
font.code | replace(' ', '+') |
||||
}}&display=fallback" /> |
||||
<style> |
||||
body, input { |
||||
font-family: "{{ font.text }}", "Helvetica Neue", |
||||
Helvetica, Arial, sans-serif; |
||||
} |
||||
pre, code, kbd { |
||||
font-family: "{{ font.code }}", "Courier New", |
||||
Courier, monospace; |
||||
} |
||||
</style> |
||||
{% endif %} |
||||
{% endblock %} |
||||
|
@ -0,0 +1,14 @@ |
||||
<!-- Google site verification for search console --> |
||||
{% for site_verification in config.extra.google.site_verification %} |
||||
<meta name="google-site-verification" content="{{site_verification}}" /> |
||||
{% endfor %} |
||||
|
||||
{% if config.extra.google.tag_manager %} |
||||
<!-- Google Tag Manager --> |
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
||||
})(window,document,'script','dataLayer','{{config.extra.google.tag_manager}}');</script> |
||||
<!-- End Google Tag Manager --> |
||||
{% endif %} |
@ -0,0 +1,30 @@ |
||||
<!-- |
||||
Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com> |
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to |
||||
deal in the Software without restriction, including without limitation the |
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
||||
sell copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||
IN THE SOFTWARE. |
||||
--> |
||||
|
||||
{% import "partials/language.html" as lang with context %} |
||||
{% set label = lang.t("source.revision.date") %} |
||||
<div class="md-source-date"> |
||||
<small> |
||||
{% if page.meta.git_revision_date_localized %} |
||||
{{ label }}: {{ page.meta.git_revision_date_localized }} |
||||
{% elif page.meta.revision_date %} |
||||
{{ label }}: {{ page.meta.revision_date }} |
||||
{% endif %} |
||||
</small> |
||||
</div> |
Loading…
Reference in new issue