mirror of
https://github.com/its-a-feature/Mythic
synced 2026-06-08 14:55:38 +00:00
better docs pages
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
<html lang="{{ .Page.Language | default "en" }}" class="js csstransforms3d">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script>
|
||||
(function() {
|
||||
var theme = 'dark';
|
||||
try {
|
||||
theme = localStorage.getItem('mythic-docs-theme') || 'dark';
|
||||
} catch (e) {}
|
||||
document.documentElement.setAttribute('data-theme', theme === 'light' ? 'light' : 'dark');
|
||||
})();
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
{{ hugo.Generator }}
|
||||
{{ partial "meta.html" . }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<a id="logo" href="/">
|
||||
<img src="/images/red_shaded_mythic.png" style="width:80px">
|
||||
</a>
|
||||
<a id="logo" href="{{ "/" | relLangURL }}" aria-label="{{ .Site.Title }}">
|
||||
<img src="{{ "images/red_shaded_mythic.png" | relURL }}" alt="Mythic">
|
||||
<span class="logo-title">Mythic Docs</span>
|
||||
</a>
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
<li>
|
||||
<a class="padding" href='{{ (cond (and (ne .Site.Params.landingPageURL nil) (.Site.IsMultiLingual)) .Site.Params.landingPageURL "/") }}'>{{ safeHTML (cond (ne .Site.Params.landingPageName nil) .Site.Params.landingPageName "<i class='fas fa-home'></i> Home") }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" class="padding theme-toggle" data-theme-toggle aria-label="Switch to light mode">
|
||||
<i class="fas fa-moon"></i>
|
||||
<span>Dark Mode</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -108,18 +114,26 @@
|
||||
{{with .sect}}
|
||||
{{if and .IsSection (or (not .Params.hidden) $.showhidden)}}
|
||||
{{safeHTML .Params.head}}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
|
||||
{{if .IsAncestor $currentNode }}parent{{end}}
|
||||
{{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}
|
||||
{{if .Params.alwaysopen}}parent{{end}}
|
||||
">
|
||||
<a href="{{.RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ if $showvisitedlinks}}
|
||||
<i class="fas fa-check read-icon"></i>
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }}
|
||||
{{ $isActive := eq .File.UniqueID $currentFileUniqueID }}
|
||||
{{ $isOpen := or (.IsAncestor $currentNode) $isActive .Params.alwaysopen }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
|
||||
{{if ne $numberOfPages 0}}has-children {{if $isOpen}}parent expanded{{else}}collapsed{{end}}{{else}}leaf{{end}}
|
||||
{{if $isActive}}active{{end}}
|
||||
">
|
||||
<div class="dd-item-header">
|
||||
{{ if ne $numberOfPages 0 }}
|
||||
<button type="button" class="nav-toggle category-icon" aria-label="Toggle {{or .Params.menuTitle .LinkTitle .Title}} navigation" aria-expanded="{{if $isOpen}}true{{else}}false{{end}}">
|
||||
<i class="fas fa-chevron-right"></i>
|
||||
</button>
|
||||
{{ end }}
|
||||
<a class="nav-link" href="{{.RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ if $showvisitedlinks}}
|
||||
<i class="fas fa-check read-icon"></i>
|
||||
{{ end }}
|
||||
</a>
|
||||
</div>
|
||||
{{ if ne $numberOfPages 0 }}
|
||||
<ul>
|
||||
{{ $currentNode.Scratch.Set "pages" .Pages }}
|
||||
@@ -148,8 +162,8 @@
|
||||
</li>
|
||||
{{else}}
|
||||
{{ if not .Params.Hidden }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}">
|
||||
<a href="{{ .RelPermalink}}">
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item leaf {{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}">
|
||||
<a class="nav-link" href="{{ .RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ if $showvisitedlinks}}<i class="fas fa-check read-icon"></i>{{end}}
|
||||
</a>
|
||||
|
||||
@@ -1,111 +1,762 @@
|
||||
|
||||
:root{
|
||||
|
||||
--MAIN-TEXT-color:#323232; /* Color of text by default */
|
||||
--MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */
|
||||
--MAIN-LINK-color:#f31c1c; /* Color of links */
|
||||
--MAIN-LINK-HOVER-color:#d01616; /* Color of hovered links */
|
||||
--MAIN-ANCHOR-color: #f31c1c; /* color of anchors on titles */
|
||||
|
||||
--MENU-HEADER-BG-color:#232438; /* Background color of menu header */
|
||||
--MENU-HEADER-BORDER-color:#e23131; /*Color of menu header border */
|
||||
|
||||
--MENU-SEARCH-BG-color:#b90000; /* Search field background color (by default borders + icons) */
|
||||
--MENU-SEARCH-BOX-color: #ef2020; /* Override search field border color */
|
||||
--MENU-SEARCH-BOX-ICONS-color: #fda1a1; /* Override search field icons color */
|
||||
|
||||
--MENU-SECTIONS-ACTIVE-BG-color:#323437; /* Background color of the active section and its childs */
|
||||
--MENU-SECTIONS-BG-color:#323437; /* Background color of other sections */
|
||||
--MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */
|
||||
--MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */
|
||||
--MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */
|
||||
--MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */
|
||||
|
||||
--MENU-VISITED-color: #ff3333; /* Color of 'page visited' icons in menu */
|
||||
--MENU-SECTION-HR-color: #2b2020; /* Color of <hr> separator in menu */
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--MYTHIC-primary: #8ab4f8;
|
||||
--MYTHIC-primary-soft: #1e3a5f;
|
||||
--MYTHIC-error: #f87171;
|
||||
--MYTHIC-success: #4ade80;
|
||||
--MYTHIC-info: #38bdf8;
|
||||
--MYTHIC-warning: #fbbf24;
|
||||
--MYTHIC-bg: #0f141b;
|
||||
--MYTHIC-paper: #161b22;
|
||||
--MYTHIC-surface-raised: #1b222c;
|
||||
--MYTHIC-surface-muted: #121820;
|
||||
--MYTHIC-text: #e5e7eb;
|
||||
--MYTHIC-text-secondary: #9ca3af;
|
||||
--MYTHIC-text-disabled: #6b7280;
|
||||
--MYTHIC-border: #2f3742;
|
||||
--MYTHIC-border-soft: #2f3742aa;
|
||||
--MYTHIC-table-header: #484848;
|
||||
--MYTHIC-table-hover: #3c3c3c;
|
||||
--MYTHIC-nav-top: #111827;
|
||||
--MYTHIC-nav-bottom: #1f2937;
|
||||
--MYTHIC-nav-hover: rgba(60, 60, 60, 0.66);
|
||||
--MYTHIC-nav-selected: rgba(30, 58, 95, 0.6);
|
||||
--MYTHIC-nav-text: #ffffff;
|
||||
--MYTHIC-nav-muted: rgba(255, 255, 255, 0.7);
|
||||
--MYTHIC-code-bg: #0b1017;
|
||||
--MYTHIC-code-border: #2f3742;
|
||||
--MYTHIC-code-text: #e5e7eb;
|
||||
--MYTHIC-code-inline-bg: #1d2b3f;
|
||||
--MYTHIC-code-inline-border: #374760;
|
||||
--MYTHIC-code-inline-text: #dbeafe;
|
||||
--MYTHIC-page-header-gradient: linear-gradient(90deg, #374760 0%, #253040 48%, #242a31 100%);
|
||||
--MYTHIC-page-header-border: rgba(138, 180, 248, 0.38);
|
||||
--MYTHIC-topbar-bg: rgba(22, 27, 34, 0.96);
|
||||
--MYTHIC-row-stripe: rgba(60, 60, 60, 0.55);
|
||||
--MYTHIC-selection-bg: rgba(138, 180, 248, 0.25);
|
||||
--MYTHIC-link-hover: #aecbfa;
|
||||
--MYTHIC-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
|
||||
--MYTHIC-subtle-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
|
||||
--MYTHIC-notice-info-bg: rgba(56, 189, 248, 0.12);
|
||||
--MYTHIC-notice-warning-bg: rgba(251, 191, 36, 0.13);
|
||||
--MYTHIC-notice-note-bg: rgba(138, 180, 248, 0.12);
|
||||
--MYTHIC-notice-tip-bg: rgba(74, 222, 128, 0.12);
|
||||
--MAIN-TEXT-color: var(--MYTHIC-text);
|
||||
--MAIN-TITLES-TEXT-color: var(--MYTHIC-text);
|
||||
--MAIN-LINK-color: var(--MYTHIC-primary);
|
||||
--MAIN-LINK-HOVER-color: var(--MYTHIC-link-hover);
|
||||
--MAIN-ANCHOR-color: var(--MYTHIC-primary);
|
||||
--MENU-HEADER-BG-color: var(--MYTHIC-nav-top);
|
||||
--MENU-HEADER-BORDER-color: rgba(138, 180, 248, 0.65);
|
||||
--MENU-SECTIONS-ACTIVE-BG-color: transparent;
|
||||
--MENU-SECTIONS-BG-color: var(--MYTHIC-nav-top);
|
||||
--MENU-SECTIONS-LINK-color: var(--MYTHIC-nav-muted);
|
||||
--MENU-SECTIONS-LINK-HOVER-color: var(--MYTHIC-nav-text);
|
||||
--MENU-SECTION-ACTIVE-CATEGORY-color: var(--MYTHIC-nav-text);
|
||||
--MENU-SECTION-ACTIVE-CATEGORY-BG-color: var(--MYTHIC-nav-selected);
|
||||
--MENU-VISITED-color: #4ade80;
|
||||
--MENU-SECTION-HR-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
html[data-theme="light"] {
|
||||
color-scheme: light;
|
||||
--MYTHIC-primary: #2563eb;
|
||||
--MYTHIC-primary-soft: #dbeafe;
|
||||
--MYTHIC-error: #dc2626;
|
||||
--MYTHIC-success: #15803d;
|
||||
--MYTHIC-info: #0284c7;
|
||||
--MYTHIC-warning: #d97706;
|
||||
--MYTHIC-bg: #f4f6f8;
|
||||
--MYTHIC-paper: #ffffff;
|
||||
--MYTHIC-surface-raised: #ffffff;
|
||||
--MYTHIC-surface-muted: #eef2f6;
|
||||
--MYTHIC-text: #111827;
|
||||
--MYTHIC-text-secondary: #475569;
|
||||
--MYTHIC-text-disabled: #94a3b8;
|
||||
--MYTHIC-border: #d9dee7;
|
||||
--MYTHIC-border-soft: #e6eaf0;
|
||||
--MYTHIC-table-header: #c4c4c4;
|
||||
--MYTHIC-table-hover: #e8e8e8;
|
||||
--MYTHIC-nav-hover: rgba(232, 232, 232, 0.16);
|
||||
--MYTHIC-nav-selected: rgba(219, 234, 254, 0.18);
|
||||
--MYTHIC-code-bg: #0b1017;
|
||||
--MYTHIC-code-border: #2f3742;
|
||||
--MYTHIC-code-text: #e5e7eb;
|
||||
--MYTHIC-code-inline-bg: #eef4ff;
|
||||
--MYTHIC-code-inline-border: #cfe0ff;
|
||||
--MYTHIC-code-inline-text: #1f2937;
|
||||
--MYTHIC-page-header-gradient: linear-gradient(90deg, #d8e3fb 0%, #edf3fe 48%, #f5f6f7 100%);
|
||||
--MYTHIC-page-header-border: rgba(37, 99, 235, 0.28);
|
||||
--MYTHIC-topbar-bg: rgba(255, 255, 255, 0.96);
|
||||
--MYTHIC-row-stripe: rgba(232, 232, 232, 0.6);
|
||||
--MYTHIC-selection-bg: rgba(37, 99, 235, 0.24);
|
||||
--MYTHIC-link-hover: #1d4ed8;
|
||||
--MYTHIC-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
|
||||
--MYTHIC-subtle-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
|
||||
--MYTHIC-notice-info-bg: rgba(2, 132, 199, 0.08);
|
||||
--MYTHIC-notice-warning-bg: rgba(217, 119, 6, 0.1);
|
||||
--MYTHIC-notice-note-bg: rgba(37, 99, 235, 0.08);
|
||||
--MYTHIC-notice-tip-bg: rgba(21, 128, 61, 0.08);
|
||||
--MAIN-LINK-HOVER-color: var(--MYTHIC-link-hover);
|
||||
--MENU-HEADER-BORDER-color: rgba(37, 99, 235, 0.65);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
color: var(--MAIN-TEXT-color) !important;
|
||||
background: var(--MYTHIC-bg) !important;
|
||||
color: var(--MYTHIC-text) !important;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
|
||||
font-size: 16px !important;
|
||||
line-height: 1.58;
|
||||
}
|
||||
|
||||
textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
|
||||
border-color: none;
|
||||
box-shadow: none;
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
scrollbar-color: var(--MYTHIC-border) transparent;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
h2, h3, h4, h5 {
|
||||
color: var(--MAIN-TITLES-TEXT-color) !important;
|
||||
*::-webkit-scrollbar {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--MAIN-LINK-color);
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: var(--MYTHIC-border);
|
||||
background-clip: padding-box;
|
||||
border: 3px solid transparent;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.anchor {
|
||||
color: var(--MAIN-ANCHOR-color);
|
||||
*::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--MAIN-LINK-HOVER-color);
|
||||
::selection {
|
||||
background: var(--MYTHIC-selection-bg);
|
||||
}
|
||||
|
||||
#sidebar ul li.visited > a .read-icon {
|
||||
color: var(--MENU-VISITED-color);
|
||||
a,
|
||||
#body a.highlight {
|
||||
color: var(--MYTHIC-primary);
|
||||
}
|
||||
|
||||
a:hover,
|
||||
#body a.highlight:hover {
|
||||
color: var(--MYTHIC-link-hover);
|
||||
}
|
||||
|
||||
#body a.highlight:after {
|
||||
display: block;
|
||||
content: "";
|
||||
height: 1px;
|
||||
width: 0%;
|
||||
-webkit-transition: width 0.5s ease;
|
||||
-moz-transition: width 0.5s ease;
|
||||
-ms-transition: width 0.5s ease;
|
||||
transition: width 0.5s ease;
|
||||
background-color: var(--MAIN-LINK-HOVER-color);
|
||||
background-color: var(--MYTHIC-link-hover);
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
background-color: var(--MENU-SECTIONS-BG-color);
|
||||
}
|
||||
#sidebar #header-wrapper {
|
||||
background: var(--MENU-HEADER-BG-color);
|
||||
color: var(--MENU-SEARCH-BOX-color);
|
||||
border-color: var(--MENU-HEADER-BORDER-color);
|
||||
}
|
||||
#sidebar .searchbox {
|
||||
border-color: var(--MENU-SEARCH-BOX-color);
|
||||
background: var(--MENU-SEARCH-BG-color);
|
||||
}
|
||||
#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {
|
||||
background: var(--MENU-SECTIONS-ACTIVE-BG-color);
|
||||
}
|
||||
#sidebar .searchbox * {
|
||||
color: var(--MENU-SEARCH-BOX-ICONS-color);
|
||||
background: linear-gradient(180deg, var(--MYTHIC-nav-top), var(--MYTHIC-nav-bottom)) !important;
|
||||
box-shadow: none;
|
||||
color: var(--MYTHIC-nav-text);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 13px;
|
||||
font-weight: 500 !important;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#sidebar a {
|
||||
color: var(--MENU-SECTIONS-LINK-color);
|
||||
#sidebar,
|
||||
#sidebar ul,
|
||||
#body,
|
||||
#body .padding,
|
||||
#body .nav {
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
#sidebar a:hover {
|
||||
color: var(--MENU-SECTIONS-LINK-HOVER-color);
|
||||
#header-wrapper {
|
||||
background: transparent !important;
|
||||
border-bottom: 1px solid var(--MENU-SECTION-HR-color) !important;
|
||||
color: var(--MYTHIC-nav-text);
|
||||
flex: 0 0 auto;
|
||||
padding: 16px 14px 14px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#sidebar ul li.active > a {
|
||||
background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
|
||||
color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important;
|
||||
#header a#logo {
|
||||
align-items: center;
|
||||
color: var(--MYTHIC-nav-text);
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: flex-start;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#header a#logo img {
|
||||
display: block;
|
||||
height: 36px;
|
||||
margin: 0;
|
||||
object-fit: contain;
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
#header .logo-title {
|
||||
color: var(--MYTHIC-nav-text);
|
||||
display: block;
|
||||
font-size: 0.92rem;
|
||||
font-weight: 750;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
#homelinks {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border-bottom: 1px solid var(--MENU-SECTION-HR-color);
|
||||
flex: 0 0 auto;
|
||||
margin: 0;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
#homelinks a.padding,
|
||||
#homelinks .theme-toggle,
|
||||
#shortcuts a.padding,
|
||||
#prefooter a.padding {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
display: block;
|
||||
font: inherit;
|
||||
min-height: 30px;
|
||||
padding: 6px 10px;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#homelinks a.padding:hover,
|
||||
#homelinks .theme-toggle:hover,
|
||||
#homelinks .theme-toggle:focus,
|
||||
#shortcuts a.padding:hover,
|
||||
#prefooter a.padding:hover {
|
||||
background: var(--MYTHIC-nav-hover);
|
||||
color: var(--MYTHIC-nav-text);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#homelinks .theme-toggle {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#homelinks .theme-toggle i {
|
||||
width: 1.25rem;
|
||||
}
|
||||
|
||||
#sidebar .highlightable {
|
||||
flex: 1 1 auto;
|
||||
height: auto !important;
|
||||
min-height: 0;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 8px 16px;
|
||||
}
|
||||
|
||||
#sidebar ul.topics {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#sidebar ul,
|
||||
#sidebar ul.topics ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar ul.topics ul {
|
||||
display: none;
|
||||
padding: 2px 0 4px 14px;
|
||||
}
|
||||
|
||||
#sidebar ul.topics li.expanded > ul,
|
||||
#sidebar ul.topics li.parent > ul,
|
||||
#sidebar ul.topics > li.active > ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#sidebar ul.topics li.collapsed > ul {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#sidebar ul.topics li {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar ul.topics li.parent,
|
||||
#sidebar ul.topics li.active {
|
||||
background: transparent !important;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar .dd-item-header {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
#sidebar .nav-toggle {
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
flex: 0 0 28px;
|
||||
height: 28px;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar .nav-toggle:hover,
|
||||
#sidebar .nav-toggle:focus {
|
||||
background: var(--MYTHIC-nav-hover);
|
||||
color: var(--MYTHIC-nav-text);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#sidebar .nav-toggle i {
|
||||
font-size: 0.72rem;
|
||||
transition: transform 120ms ease;
|
||||
}
|
||||
|
||||
#sidebar li.expanded > .dd-item-header > .nav-toggle i,
|
||||
#sidebar li.parent > .dd-item-header > .nav-toggle i {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
#sidebar a.nav-link,
|
||||
#sidebar ul li > a.nav-link {
|
||||
align-items: center;
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 650;
|
||||
gap: 6px;
|
||||
line-height: 1.25;
|
||||
min-height: 30px;
|
||||
min-width: 0;
|
||||
padding: 6px 8px;
|
||||
text-decoration: none;
|
||||
text-indent: 0;
|
||||
}
|
||||
|
||||
#sidebar li.leaf > a.nav-link,
|
||||
#sidebar li.leaf > .dd-item-header > a.nav-link {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
#sidebar ul.topics > li.leaf > a.nav-link,
|
||||
#sidebar ul.topics > li > .dd-item-header > a.nav-link {
|
||||
font-size: 0.86rem;
|
||||
}
|
||||
|
||||
#sidebar ul li li a.nav-link,
|
||||
#sidebar ul li li .dd-item-header a.nav-link {
|
||||
font-size: 0.79rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#sidebar a.nav-link:hover,
|
||||
#sidebar ul li > a.nav-link:hover {
|
||||
background: var(--MYTHIC-nav-hover);
|
||||
color: var(--MYTHIC-nav-text) !important;
|
||||
}
|
||||
|
||||
#sidebar ul li.active > a.nav-link,
|
||||
#sidebar ul li.active > .dd-item-header > a.nav-link {
|
||||
background: var(--MYTHIC-nav-selected) !important;
|
||||
color: var(--MYTHIC-nav-text) !important;
|
||||
margin: 0;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
#sidebar ul li.leaf.active > a.nav-link,
|
||||
#sidebar ul li.leaf.active > .dd-item-header > a.nav-link {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
#sidebar ul li.visited > a .read-icon,
|
||||
#sidebar ul li.visited > .dd-item-header .read-icon {
|
||||
color: var(--MENU-VISITED-color);
|
||||
}
|
||||
|
||||
#sidebar .read-icon {
|
||||
font-size: 0.65rem;
|
||||
margin-left: auto;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
#sidebar b {
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
font-weight: 700;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
#shortcuts,
|
||||
#prefooter,
|
||||
#footer {
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#footer p,
|
||||
#footer a {
|
||||
color: var(--MYTHIC-nav-muted);
|
||||
}
|
||||
|
||||
#shortcuts h3 {
|
||||
color: var(--MYTHIC-nav-muted) !important;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 750;
|
||||
letter-spacing: 0;
|
||||
margin: 8px 10px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#sidebar hr {
|
||||
border-color: var(--MENU-SECTION-HR-color);
|
||||
}
|
||||
|
||||
#body .tags a.tag-link {
|
||||
background-color: var(--MENU-HEADER-BG-color);
|
||||
#body {
|
||||
background: var(--MYTHIC-bg);
|
||||
color: var(--MYTHIC-text);
|
||||
margin-left: 300px;
|
||||
}
|
||||
|
||||
#body .tags a.tag-link:before {
|
||||
border-right-color: var(--MENU-HEADER-BG-color);
|
||||
}
|
||||
#body .padding {
|
||||
margin: 0 auto;
|
||||
max-width: 1120px;
|
||||
padding: 34px 48px 56px;
|
||||
}
|
||||
|
||||
#body-inner {
|
||||
color: var(--MYTHIC-text);
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
|
||||
#body-inner > h1 {
|
||||
align-items: center;
|
||||
background: var(--MYTHIC-page-header-gradient);
|
||||
border: 1px solid var(--MYTHIC-page-header-border);
|
||||
border-left: 5px solid var(--MYTHIC-primary);
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-text);
|
||||
display: flex;
|
||||
font-family: inherit;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 750;
|
||||
justify-content: flex-start;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.25;
|
||||
margin: 0 0 24px;
|
||||
min-height: 48px;
|
||||
padding: 10px 14px;
|
||||
text-align: left;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
#top-bar {
|
||||
background: var(--MYTHIC-topbar-bg);
|
||||
border: 1px solid var(--MYTHIC-border);
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
font-size: 0.82rem;
|
||||
min-height: 40px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
#breadcrumbs {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
}
|
||||
|
||||
#breadcrumbs a {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
#breadcrumbs a:hover {
|
||||
color: var(--MYTHIC-primary);
|
||||
}
|
||||
|
||||
#toc-menu,
|
||||
#sidebar-toggle-span {
|
||||
border-right: 1px solid var(--MYTHIC-border) !important;
|
||||
}
|
||||
|
||||
.progress {
|
||||
background: var(--MYTHIC-paper);
|
||||
border: 1px solid var(--MYTHIC-border);
|
||||
border-radius: 6px;
|
||||
box-shadow: var(--MYTHIC-shadow);
|
||||
}
|
||||
|
||||
#TableOfContents {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
}
|
||||
|
||||
#TableOfContents a {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#TableOfContents a:hover {
|
||||
color: var(--MYTHIC-primary);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
color: var(--MYTHIC-text) !important;
|
||||
font-family: inherit !important;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-bottom: 1px solid var(--MYTHIC-border);
|
||||
font-size: 1.45rem;
|
||||
line-height: 1.25 !important;
|
||||
margin: 2.2rem 0 1rem;
|
||||
padding-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.15rem;
|
||||
line-height: 1.3 !important;
|
||||
margin: 1.7rem 0 0.75rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1rem;
|
||||
line-height: 1.35 !important;
|
||||
margin: 1.3rem 0 0.5rem;
|
||||
}
|
||||
|
||||
h5,
|
||||
h6 {
|
||||
font-size: 0.92rem;
|
||||
line-height: 1.35 !important;
|
||||
}
|
||||
|
||||
p,
|
||||
li {
|
||||
color: var(--MYTHIC-text);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.85rem 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
background: var(--MYTHIC-surface-muted);
|
||||
border: 1px solid var(--MYTHIC-border);
|
||||
border-left: 5px solid var(--MYTHIC-primary);
|
||||
border-radius: 6px;
|
||||
margin: 1.4rem 0;
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
font-size: 0.96rem;
|
||||
}
|
||||
|
||||
table {
|
||||
background: var(--MYTHIC-paper);
|
||||
border: 1px solid var(--MYTHIC-border);
|
||||
border-collapse: separate;
|
||||
border-radius: 6px;
|
||||
border-spacing: 0;
|
||||
display: block;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
background: var(--MYTHIC-table-header);
|
||||
border-bottom: 1px solid var(--MYTHIC-border);
|
||||
color: var(--MYTHIC-text);
|
||||
font-size: 0.76rem;
|
||||
font-weight: 750;
|
||||
letter-spacing: 0;
|
||||
padding: 8px 10px;
|
||||
text-align: left;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--MYTHIC-border-soft);
|
||||
color: var(--MYTHIC-text);
|
||||
font-size: 0.9rem;
|
||||
padding: 8px 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
tr:nth-child(even) td {
|
||||
background: var(--MYTHIC-row-stripe);
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
||||
}
|
||||
|
||||
code {
|
||||
background: var(--MYTHIC-code-inline-bg);
|
||||
border: 1px solid var(--MYTHIC-code-inline-border);
|
||||
border-radius: 5px;
|
||||
color: var(--MYTHIC-code-inline-text);
|
||||
font-size: 0.88em;
|
||||
padding: 1px 4px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: var(--MYTHIC-code-bg);
|
||||
border: 1px solid var(--MYTHIC-code-border);
|
||||
border-radius: 6px;
|
||||
color: var(--MYTHIC-code-text);
|
||||
line-height: 1.45;
|
||||
margin: 1.4rem 0;
|
||||
overflow: auto;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: inherit;
|
||||
font-size: 0.86rem;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
hr {
|
||||
border-bottom: 1px solid var(--MYTHIC-border);
|
||||
}
|
||||
|
||||
.anchor {
|
||||
color: var(--MYTHIC-primary);
|
||||
}
|
||||
|
||||
div.notices {
|
||||
border-radius: 6px;
|
||||
margin: 1.2rem 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.notices p {
|
||||
border: 1px solid var(--MYTHIC-border) !important;
|
||||
border-left-width: 5px !important;
|
||||
color: var(--MYTHIC-text);
|
||||
font-size: 0.92rem;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
div.notices p:first-child:before,
|
||||
div.notices p:first-child:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.notices.info p {
|
||||
background: var(--MYTHIC-notice-info-bg);
|
||||
border-left-color: var(--MYTHIC-info) !important;
|
||||
}
|
||||
|
||||
div.notices.warning p {
|
||||
background: var(--MYTHIC-notice-warning-bg);
|
||||
border-left-color: var(--MYTHIC-warning) !important;
|
||||
}
|
||||
|
||||
div.notices.note p {
|
||||
background: var(--MYTHIC-notice-note-bg);
|
||||
border-left-color: var(--MYTHIC-primary) !important;
|
||||
}
|
||||
|
||||
div.notices.tip p {
|
||||
background: var(--MYTHIC-notice-tip-bg);
|
||||
border-left-color: var(--MYTHIC-success) !important;
|
||||
}
|
||||
|
||||
.children,
|
||||
section.attachments {
|
||||
background: var(--MYTHIC-paper);
|
||||
border: 1px solid var(--MYTHIC-border);
|
||||
border-radius: 6px;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
.children h2,
|
||||
.children h3 {
|
||||
border-bottom: 0;
|
||||
font-size: 1rem;
|
||||
margin: 0.4rem 0 0.15rem;
|
||||
}
|
||||
|
||||
.children p,
|
||||
.children-li p {
|
||||
color: var(--MYTHIC-text-secondary);
|
||||
font-size: 0.86rem;
|
||||
}
|
||||
|
||||
#body img,
|
||||
#body .video-container {
|
||||
background: var(--MYTHIC-paper);
|
||||
border-radius: 6px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#body .nav {
|
||||
color: var(--MYTHIC-text-disabled);
|
||||
width: 3rem;
|
||||
}
|
||||
|
||||
#body .nav:hover {
|
||||
background: var(--MYTHIC-row-stripe);
|
||||
color: var(--MYTHIC-primary);
|
||||
}
|
||||
|
||||
.is-sticky #top-bar {
|
||||
box-shadow: var(--MYTHIC-subtle-shadow);
|
||||
}
|
||||
|
||||
@media only all and (max-width: 59.938em) {
|
||||
#body .padding {
|
||||
padding: 20px 24px 44px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only all and (max-width: 47.938em) {
|
||||
#sidebar {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#body {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
#body .padding {
|
||||
padding: 14px 14px 36px;
|
||||
}
|
||||
|
||||
#body-inner > h1 {
|
||||
font-size: 1.08rem;
|
||||
min-height: 42px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,3 +92,72 @@ jQuery(document).ready(function() {
|
||||
$(element).parent().replaceWith('<div class="mermaid" align="center">' + content + '</div>');
|
||||
});
|
||||
});
|
||||
|
||||
window.mythicDocsEnhanceHugoLearnContent = function() {
|
||||
var images = $("div#body-inner img").not(".inline");
|
||||
|
||||
images.wrap(function(){
|
||||
var image = $(this);
|
||||
var o = getUrlParameter(image[0].src);
|
||||
var f = o['featherlight'];
|
||||
if (f != 'false') {
|
||||
if (!image.parent("a").length) {
|
||||
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
images.each(function(index){
|
||||
var image = $(this)
|
||||
var o = getUrlParameter(image[0].src);
|
||||
if (typeof o !== "undefined") {
|
||||
var h = o["height"];
|
||||
var w = o["width"];
|
||||
var c = o["classes"];
|
||||
image.css("width", function() {
|
||||
if (typeof w !== "undefined") {
|
||||
return w;
|
||||
} else {
|
||||
return "auto";
|
||||
}
|
||||
});
|
||||
image.css("height", function() {
|
||||
if (typeof h !== "undefined") {
|
||||
return h;
|
||||
} else {
|
||||
return "auto";
|
||||
}
|
||||
});
|
||||
if (typeof c !== "undefined") {
|
||||
var classes = c.split(',');
|
||||
for (i = 0; i < classes.length; i++) {
|
||||
image.addClass(classes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var text, clip = new ClipboardJS('.anchor');
|
||||
$("h1~h2,h1~h3,h1~h4,h1~h5,h1~h6").append(function(index, html){
|
||||
var element = $(this);
|
||||
var url = encodeURI(document.location.origin + document.location.pathname);
|
||||
var link = url + "#"+element[0].id;
|
||||
return " <span class='anchor' data-clipboard-text='"+link+"'>" +
|
||||
"<i class='fas fa-link fa-lg'></i>" +
|
||||
"</span>"
|
||||
;
|
||||
});
|
||||
|
||||
$(".anchor").on('mouseleave', function(e) {
|
||||
$(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');
|
||||
});
|
||||
|
||||
clip.on('success', function(e) {
|
||||
e.clearSelection();
|
||||
$(e.trigger).attr('aria-label', 'Link copied to clipboard!').addClass('tooltipped tooltipped-s');
|
||||
});
|
||||
$('code.language-mermaid').each(function(index, element) {
|
||||
var content = $(element).html().replace(/&/g, '&');
|
||||
$(element).parent().replaceWith('<div class="mermaid" align="center">' + content + '</div>');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -26,8 +26,18 @@ function getScrollBarWidth() {
|
||||
};
|
||||
|
||||
function setMenuHeight() {
|
||||
$('#sidebar .highlightable').height($('#sidebar').innerHeight() - $('#header-wrapper').height() - 40);
|
||||
$('#sidebar .highlightable').perfectScrollbar('update');
|
||||
var sidebar = $('#sidebar');
|
||||
var sidebarContent = $('#sidebar .highlightable');
|
||||
|
||||
if (sidebar.css('display') === 'flex') {
|
||||
sidebarContent.css('height', '');
|
||||
} else {
|
||||
sidebarContent.height(sidebar.innerHeight() - $('#header-wrapper').height() - 40);
|
||||
}
|
||||
|
||||
try {
|
||||
sidebarContent.perfectScrollbar('update');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function fallbackMessage(action) {
|
||||
@@ -132,19 +142,352 @@ $(window).resize(function() {
|
||||
|
||||
})(jQuery, 'smartresize');
|
||||
|
||||
var mythicDocsSidebarScrollKey = 'mythic-docs-sidebar-scroll-top';
|
||||
var mythicDocsThemeKey = 'mythic-docs-theme';
|
||||
var mythicDocsSidebarScrollTimer;
|
||||
var mythicDocsPjaxRequest;
|
||||
|
||||
function mythicDocsGetTheme() {
|
||||
if (!window.localStorage) {
|
||||
return 'dark';
|
||||
}
|
||||
|
||||
try {
|
||||
return localStorage.getItem(mythicDocsThemeKey) === 'light' ? 'light' : 'dark';
|
||||
} catch (e) {
|
||||
return 'dark';
|
||||
}
|
||||
}
|
||||
|
||||
function mythicDocsSetTheme(theme) {
|
||||
var nextTheme = theme === 'light' ? 'light' : 'dark';
|
||||
var toggle = $('[data-theme-toggle]');
|
||||
|
||||
document.documentElement.setAttribute('data-theme', nextTheme);
|
||||
|
||||
try {
|
||||
localStorage.setItem(mythicDocsThemeKey, nextTheme);
|
||||
} catch (e) {}
|
||||
|
||||
toggle.attr('aria-label', nextTheme === 'dark' ? 'Switch to light mode' : 'Switch to dark mode');
|
||||
toggle.find('i').toggleClass('fa-moon', nextTheme === 'dark').toggleClass('fa-sun', nextTheme === 'light');
|
||||
toggle.find('span').text(nextTheme === 'dark' ? 'Dark Mode' : 'Light Mode');
|
||||
}
|
||||
|
||||
function mythicDocsInitThemeToggle() {
|
||||
mythicDocsSetTheme(mythicDocsGetTheme());
|
||||
|
||||
$('#sidebar').on('click', '[data-theme-toggle]', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
mythicDocsSetTheme(mythicDocsGetTheme() === 'dark' ? 'light' : 'dark');
|
||||
});
|
||||
}
|
||||
|
||||
function mythicDocsSetSectionState(section, expanded) {
|
||||
section.toggleClass('expanded parent', expanded);
|
||||
section.toggleClass('collapsed', !expanded);
|
||||
section.children('ul').first().toggle(expanded);
|
||||
section.children('.dd-item-header').children('.nav-toggle').attr('aria-expanded', expanded ? 'true' : 'false');
|
||||
|
||||
try {
|
||||
$('#sidebar .highlightable').perfectScrollbar('update');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function mythicDocsInitSidebarNav() {
|
||||
$('#sidebar').on('click', '.nav-toggle', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
var section = $(this).closest('li.has-children');
|
||||
mythicDocsSetSectionState(section, !section.hasClass('expanded'));
|
||||
mythicDocsSaveSidebarScroll();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function mythicDocsSaveSidebarScroll() {
|
||||
var sidebarScroller = $('#sidebar .highlightable');
|
||||
|
||||
if (!window.sessionStorage || !sidebarScroller.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
sessionStorage.setItem(mythicDocsSidebarScrollKey, sidebarScroller.scrollTop());
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function mythicDocsRestoreSidebarScroll() {
|
||||
var sidebarScroller = $('#sidebar .highlightable');
|
||||
|
||||
if (!window.sessionStorage || !sidebarScroller.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var scrollTop = parseInt(sessionStorage.getItem(mythicDocsSidebarScrollKey), 10);
|
||||
if (!isNaN(scrollTop)) {
|
||||
sidebarScroller.scrollTop(scrollTop);
|
||||
sidebarScroller.perfectScrollbar('update');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function mythicDocsInitSidebarScroll() {
|
||||
var sidebarScroller = $('#sidebar .highlightable');
|
||||
|
||||
sidebarScroller.on('scroll', function() {
|
||||
clearTimeout(mythicDocsSidebarScrollTimer);
|
||||
mythicDocsSidebarScrollTimer = setTimeout(mythicDocsSaveSidebarScroll, 120);
|
||||
});
|
||||
|
||||
$('#sidebar').on('click', 'a', mythicDocsSaveSidebarScroll);
|
||||
$(window).on('beforeunload', mythicDocsSaveSidebarScroll);
|
||||
}
|
||||
|
||||
function mythicDocsDocsRootPath() {
|
||||
var docsIndex = window.location.pathname.indexOf('/docs/');
|
||||
if (docsIndex === -1) {
|
||||
return '/';
|
||||
}
|
||||
|
||||
return window.location.pathname.slice(0, docsIndex + 6);
|
||||
}
|
||||
|
||||
function mythicDocsNormalizeSidebarLinks() {
|
||||
$('#sidebar a[href]').each(function() {
|
||||
var href = this.getAttribute('href');
|
||||
|
||||
if (!href || href === '#' || href.indexOf('javascript:') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var url = new URL(href, window.location.href);
|
||||
if (url.origin === window.location.origin) {
|
||||
this.setAttribute('href', url.href);
|
||||
}
|
||||
} catch (e) {}
|
||||
});
|
||||
}
|
||||
|
||||
function mythicDocsCanNavigate(link, event) {
|
||||
if (!link || !link.href || !window.fetch || !window.DOMParser || !window.history || !history.pushState) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event && (event.defaultPrevented || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.which > 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (link.target || link.hasAttribute('download') || link.getAttribute('rel') === 'lightbox' || link.hasAttribute('data-featherlight')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var rawHref = link.getAttribute('href');
|
||||
if (!rawHref || rawHref === '#' || rawHref.indexOf('#') === 0 || rawHref.indexOf('javascript:') === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var url = new URL(link.href, window.location.href);
|
||||
var sameDocument = url.pathname === window.location.pathname && url.search === window.location.search;
|
||||
|
||||
return url.origin === window.location.origin &&
|
||||
url.pathname.indexOf(mythicDocsDocsRootPath()) === 0 &&
|
||||
!(sameDocument && url.hash);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function mythicDocsSyncSidebar(nextDocument) {
|
||||
var nextSidebar = nextDocument.querySelector('#sidebar');
|
||||
|
||||
if (!nextSidebar) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#sidebar [data-nav-id]').removeClass('active');
|
||||
|
||||
$(nextSidebar).find('[data-nav-id]').each(function() {
|
||||
var navId = this.getAttribute('data-nav-id');
|
||||
var nextItem = this;
|
||||
var currentItem = $('#sidebar [data-nav-id]').filter(function() {
|
||||
return this.getAttribute('data-nav-id') === navId;
|
||||
});
|
||||
|
||||
if (!currentItem.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentItem.toggleClass('active', nextItem.classList.contains('active'));
|
||||
|
||||
if (nextItem.classList.contains('parent') || nextItem.classList.contains('expanded')) {
|
||||
currentItem.addClass('parent expanded').removeClass('collapsed');
|
||||
currentItem.children('.dd-item-header').children('.nav-toggle').attr('aria-expanded', 'true');
|
||||
currentItem.children('ul').first().css('display', '');
|
||||
}
|
||||
});
|
||||
|
||||
mythicDocsNormalizeSidebarLinks();
|
||||
mythicDocsRestoreSidebarScroll();
|
||||
|
||||
try {
|
||||
$('#sidebar .highlightable').perfectScrollbar('update');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function mythicDocsMarkVisitedPage() {
|
||||
if (!window.sessionStorage) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentUrl = $('body').data('url');
|
||||
if (currentUrl) {
|
||||
sessionStorage.setItem(currentUrl, 1);
|
||||
}
|
||||
|
||||
for (var url in sessionStorage) {
|
||||
if (sessionStorage.getItem(url) == 1) {
|
||||
jQuery('[data-nav-id="' + url + '"]').addClass('visited');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mythicDocsInitDynamicContent() {
|
||||
restoreTabSelections();
|
||||
|
||||
$('#top-bar a:not(:has(img)):not(.btn)').addClass('highlight');
|
||||
$('#body-inner a:not(:has(img)):not(.btn):not(a[rel="footnote"])').addClass('highlight');
|
||||
|
||||
if ($.fn.sticky) {
|
||||
$('#top-bar').sticky({topSpacing:0, zIndex: 1000});
|
||||
}
|
||||
|
||||
if ($.fn.featherlight) {
|
||||
$('a[rel="lightbox"]').featherlight({
|
||||
root: 'section#body'
|
||||
});
|
||||
}
|
||||
|
||||
if (window.mythicDocsEnhanceHugoLearnContent) {
|
||||
window.mythicDocsEnhanceHugoLearnContent();
|
||||
}
|
||||
|
||||
if (window.mermaid && $('.mermaid').length) {
|
||||
try {
|
||||
mermaid.init(undefined, $('.mermaid'));
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
function mythicDocsScrollToNavigationTarget(targetUrl) {
|
||||
if (targetUrl.hash) {
|
||||
var target = document.getElementById(decodeURIComponent(targetUrl.hash.slice(1)));
|
||||
if (target) {
|
||||
window.scrollTo(window.scrollX, Math.max(0, $(target).offset().top - 50));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
function mythicDocsNavigate(href, replaceState) {
|
||||
var targetUrl = new URL(href, window.location.href);
|
||||
|
||||
if (mythicDocsPjaxRequest && mythicDocsPjaxRequest.abort) {
|
||||
mythicDocsPjaxRequest.abort();
|
||||
}
|
||||
|
||||
mythicDocsSaveSidebarScroll();
|
||||
|
||||
var controller = window.AbortController ? new AbortController() : null;
|
||||
mythicDocsPjaxRequest = controller;
|
||||
|
||||
return fetch(targetUrl.href, {
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
signal: controller ? controller.signal : undefined
|
||||
}).then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error('Unable to load documentation page');
|
||||
}
|
||||
return response.text();
|
||||
}).then(function(markup) {
|
||||
var nextDocument = new DOMParser().parseFromString(markup, 'text/html');
|
||||
var nextBody = nextDocument.querySelector('#body');
|
||||
|
||||
if (!nextBody) {
|
||||
throw new Error('Documentation page is missing #body');
|
||||
}
|
||||
|
||||
if (replaceState) {
|
||||
history.replaceState({mythicDocsPjax: true}, nextDocument.title, targetUrl.href);
|
||||
} else {
|
||||
history.pushState({mythicDocsPjax: true}, nextDocument.title, targetUrl.href);
|
||||
}
|
||||
|
||||
document.title = nextDocument.title;
|
||||
document.body.setAttribute('data-url', nextDocument.body.getAttribute('data-url') || targetUrl.pathname);
|
||||
$('#body').replaceWith($(nextBody).clone(true, true));
|
||||
|
||||
mythicDocsSyncSidebar(nextDocument);
|
||||
mythicDocsInitDynamicContent();
|
||||
mythicDocsMarkVisitedPage();
|
||||
mythicDocsScrollToNavigationTarget(targetUrl);
|
||||
}).catch(function(error) {
|
||||
if (error && error.name === 'AbortError') {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = targetUrl.href;
|
||||
}).then(function() {
|
||||
mythicDocsPjaxRequest = null;
|
||||
});
|
||||
}
|
||||
|
||||
function mythicDocsMaybeNavigate(event, link) {
|
||||
if (!mythicDocsCanNavigate(link, event)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
mythicDocsNavigate(link.href, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
function mythicDocsInitPjax() {
|
||||
mythicDocsNormalizeSidebarLinks();
|
||||
history.replaceState({mythicDocsPjax: true}, document.title, window.location.href);
|
||||
|
||||
$(document).on('click', 'a', function(event) {
|
||||
mythicDocsMaybeNavigate(event, this);
|
||||
});
|
||||
|
||||
$(window).on('popstate', function() {
|
||||
mythicDocsNavigate(window.location.href, true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
restoreTabSelections();
|
||||
|
||||
jQuery('#sidebar .category-icon').on('click', function() {
|
||||
$( this ).toggleClass("fa-angle-down fa-angle-right") ;
|
||||
$( this ).parent().parent().children('ul').toggle() ;
|
||||
return false;
|
||||
});
|
||||
mythicDocsInitThemeToggle();
|
||||
mythicDocsInitSidebarNav();
|
||||
mythicDocsInitPjax();
|
||||
|
||||
var sidebarStatus = searchStatus = 'open';
|
||||
$('#sidebar .highlightable').perfectScrollbar();
|
||||
setMenuHeight();
|
||||
mythicDocsInitSidebarScroll();
|
||||
mythicDocsRestoreSidebarScroll();
|
||||
|
||||
jQuery('#overlay').on('click', function() {
|
||||
jQuery(document.body).toggleClass('sidebar-hidden');
|
||||
@@ -266,16 +609,6 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// allow keyboard control for prev/next links
|
||||
jQuery(function() {
|
||||
jQuery('.nav-prev').click(function(){
|
||||
location.href = jQuery(this).attr('href');
|
||||
});
|
||||
jQuery('.nav-next').click(function() {
|
||||
location.href = jQuery(this).attr('href');
|
||||
});
|
||||
});
|
||||
|
||||
jQuery('input, textarea').keydown(function (e) {
|
||||
// left and right arrow keys
|
||||
if (e.which == '37' || e.which == '39') {
|
||||
@@ -413,6 +746,7 @@ jQuery(window).on('load', function() {
|
||||
|
||||
|
||||
$(".highlightable").highlight(sessionStorage.getItem('search-value'), { element: 'mark' });
|
||||
mythicDocsRestoreSidebarScroll();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
|
||||
Reference in New Issue
Block a user