Skip to content

Commit

Permalink
DOCS-89 Amend configuration to avoid excessive customization (#779)
Browse files Browse the repository at this point in the history
new file:   _resource/overrides/.icons/percona/logo.svg
	modified:   _resource/overrides/main.html
	modified:   docs/css/percona.css
	modified:   mkdocs-base.yml
	new file:   snippets/services-banner.md
  • Loading branch information
nastena1606 authored Oct 16, 2023
1 parent f9720e2 commit 9681493
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 117 deletions.
3 changes: 3 additions & 0 deletions _resource/overrides/.icons/percona/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 33 additions & 59 deletions _resource/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,64 +40,38 @@ <h4>Contact Us </h4>
{% endblock %}


{% block analytics %}
<!-- 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','GTM-WBVF48V');</script>
<!-- End Google Tag Manager -->

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WBVF48V"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}

{% block content %}

<!-- Edit and view button -->
{% if page.edit_url %}
{% set edit = "https://github.com/percona/psmdb-docs/edit/4.4/docs/" %}
{% set view = "https://raw.githubusercontent.com/percona/psmdb-docs/4.4/docs/" %}
<a
href="{{ page.edit_url }}"
title="{{ lang.t('edit.link.title') }}"
class="md-content__button md-icon"
>
{% include ".icons/material/file-edit-outline.svg" %}
</a>
<a
href="{{ page.edit_url | replace(edit, view) }}"
title="View source of this page"
class="md-content__button md-icon"
>
{% include ".icons/material/file-eye-outline.svg" %}
</a>
{% 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.
-->
{% if "\x3ch1" not in page.content %}
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}

<!-- Markdown content -->
{{ page.content }}

{{ relbar2() }}


<!-- Last update of source file -->
{% if page and page.meta %}
{% if page.meta.git_revision_date_localized or
page.meta.revision_date
%}
{% include "partials/source-file.html" %}
{% endif %}
{% endif %}
{% endblock %}
{% block site_nav %}
{% if nav %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "navigation" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" {{ hidden }}>
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
<br>
<label class="md-nav__title" for="__drawer">
<a href="https://learn.percona.com/download-percona-server-mongodb-4-4-manual" onclick="_gaq.push(['b._trackEvent', 'Percona Server for MongoDB 4.0', 'Download', 'Download Manual Server for MongoDB 4.0']);" class="md-nav__link md-nav__link--active" style="font-size: .7rem;">
Download PDF
</a>
</label>
</div>
</div>
</div>
{% endif %}
{% if "toc.integrate" not in features %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "toc" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" {{ hidden }}>
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/toc.html" %}
</div>
</div>
</div>
{% endif %}
{% endblock %}

36 changes: 0 additions & 36 deletions _resource/overrides/partials/nav.html

This file was deleted.

64 changes: 64 additions & 0 deletions docs/css/percona.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,67 @@ section {
/*.git-revision-date-localized-plugin:before {
content: url('https://api.iconify.design/mdi/clock-edit-outline.svg');
}*/

/* Custom Banner */
[data-banner] {
padding: 1.5em;
margin: 2em 0;
border: 0.05rem solid var(--md-default-fg-color--lighter);
/* border: 0.05rem solid var(--md-typeset-table-color); */
border-radius: 0.2rem;
}
[data-banner] .title {
font-weight: normal;
margin: 0;
}
[data-banner] > :last-child {
margin-bottom: 0;
}
[data-banner] a:link {
font-weight: bold;
}
[data-banner] .actions > p {
margin: 0;
}
[data-banner] .actions a {
display: inline-block;
margin: 0.5em 1.5em 0 0;
}
[data-banner] > :only-child,
[data-banner] .actions a:first-of-type {
margin-top: 0;
}
[data-banner] a [class*="moji"] {
height: 1.3333em;
vertical-align: -0.3333em;
}
[data-banner] a [class*="moji"] svg {
width: 1.3333em;
}
[data-grid] {
display: flex;
flex-wrap: wrap;
margin-right: -1rem;
}
[data-grid] [data-banner] {
flex: 1 1 320px;
display: flex;
flex-direction: column;
margin: 0 1rem 1rem 0;
}
[data-grid] .title {
font-size: 0.8rem;
font-weight: bold;
}
[data-grid] [data-banner] > p:last-child {
margin-top: 0;
}
[data-grid] [data-banner] > p:nth-last-child(2) {
flex-grow: 2;
}
[data-grid] + [data-banner] {
margin-top: 0;
}
[data-grid] .md-button {
margin: 0.5em 0.25em 0 0;
}
17 changes: 12 additions & 5 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
site_name: Percona Server for MongoDB 4.4
site_description: Documentation
site_author: Percona LLC
copyright: Percona LLC, &#169; 2023
copyright: >
<a href="https://www.percona.com/about">Percona LLC</a> and/or its affiliates © 2023 — <a href="#__consent">Cookie Consent</a>
repo_name: percona/psmdb-docs
repo_url: https://github.com/percona/psmdb-docs
Expand All @@ -22,7 +23,7 @@ theme:

features:
content.action.view
content.account.edit
content.action.edit
content.code.copy
search.highlight
search.share
Expand Down Expand Up @@ -89,10 +90,16 @@ markdown_extensions:
pymdownx.highlight:
linenums: false
pymdownx.inlinehilite: {}
pymdownx.snippets: {}
pymdownx.snippets:
base_path: ["snippets"]
auto_append:
- services-banner.md
pymdownx.emoji:
# emoji_index: !!python/name:materialx.emoji.twemoji
# emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
options:
custom_icons:
- _resource/overrides/.icons

plugins:
# section-index: {}
Expand Down
2 changes: 2 additions & 0 deletions mkdocs-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

INHERIT: mkdocs-base.yml

copyright: Percona LLC, &#169; 2023

markdown_extensions:
pymdownx.tabbed: {}
admonition: {}
32 changes: 15 additions & 17 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ site_url: "https://docs.percona.com/percona-server-for-mongodb"
extra:
analytics:
provider: google
property: UA-343802-3
property: G-J4J70BNH0G

#Feedback form widget
# feedback:
# title: Was this page helpful?
# ratings:
# - icon: material/heart
# name: This page was helpful
# data: 1
# note: >-
# Thanks for your feedback!
# - icon: material/heart-broken
# name: This page could be improved
# data: 0
# note: >-
# Thanks for your feedback! Help us improve this page by
# using our <a href="https://forms.gle/B5ura1rZEF6P8tdv9" target=_blank>feedback form</a>.


feedback:
title: Was this page helpful?
ratings:
- icon: material/emoticon-happy-outline
name: This page was helpful
data: 1
note: >-
Thanks for your feedback!
- icon: material/emoticon-sad-outline
name: This page could be improved
data: 0
note: >-
Thanks for your feedback! Help us improve this page by
using our <a href="https://docs.google.com/forms/d/1bkWACehjqlwA0AKf-qTJcXvYbOSYgze8iTPXjntqmNo/edit" target="_blank" rel="noopener">feedback form</a>.
13 changes: 13 additions & 0 deletions snippets/services-banner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div data-banner markdown>

## Get expert help { .title }

If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.

<div class="actions" markdown>

[:material-forum-outline: Community Forum](https://forums.percona.com/c/mongodb/percona-server-for-mongodb/43) [:percona-logo: Get a Percona Expert](https://www.percona.com/about/contact)

</div>
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=bc14d3fa-b256-4ea5-bc67-fbd656af149b" />
</div>

0 comments on commit 9681493

Please sign in to comment.