mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-26 13:08:11 +00:00
Fix nav
This commit is contained in:
@@ -1,136 +0,0 @@
|
|||||||
/*!
|
|
||||||
* ml-stack-nav - v1.1.3
|
|
||||||
* Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
|
|
||||||
* https://github.com/damianwajer/ml-stack-nav
|
|
||||||
*
|
|
||||||
* Author: Damian Wajer
|
|
||||||
* License: MIT
|
|
||||||
*
|
|
||||||
* @preserve
|
|
||||||
*/
|
|
||||||
.ml-stack-nav-toggle {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0;
|
|
||||||
width: 26px;
|
|
||||||
height: 22px;
|
|
||||||
border: 0;
|
|
||||||
background: none;
|
|
||||||
color: #525261;
|
|
||||||
cursor: pointer;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-moz-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle__line {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 4px;
|
|
||||||
border-radius: 9px;
|
|
||||||
background: #525261;
|
|
||||||
opacity: 1;
|
|
||||||
-webkit-transition: 0.3s ease-in-out;
|
|
||||||
transition: 0.3s ease-in-out;
|
|
||||||
-webkit-transform: rotate(0deg);
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle__line:nth-child(2) {
|
|
||||||
top: 9px;
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle__line:nth-child(3) {
|
|
||||||
top: 18px;
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle.is-active .ml-stack-nav-toggle__line:nth-child(1) {
|
|
||||||
top: 9px;
|
|
||||||
left: 50%;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle.is-active .ml-stack-nav-toggle__line:nth-child(2) {
|
|
||||||
-webkit-transform: rotate(45deg);
|
|
||||||
transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
.ml-stack-nav-toggle.is-active .ml-stack-nav-toggle__line:nth-child(3) {
|
|
||||||
top: 9px;
|
|
||||||
-webkit-transform: rotate(-45deg);
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ml-stack-nav {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: -1;
|
|
||||||
overflow: hidden;
|
|
||||||
box-sizing: border-box;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.ml-stack-nav *,
|
|
||||||
.ml-stack-nav *:after,
|
|
||||||
.ml-stack-nav *:before {
|
|
||||||
box-sizing: inherit;
|
|
||||||
}
|
|
||||||
.ml-stack-nav__menu {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 20px;
|
|
||||||
z-index: 900;
|
|
||||||
visibility: hidden;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 1px solid #000;
|
|
||||||
background-color: #fff;
|
|
||||||
list-style-position: inside;
|
|
||||||
-webkit-transition: visibility 0.3s, -webkit-transform 0.3s;
|
|
||||||
transition: visibility 0.3s, -webkit-transform 0.3s;
|
|
||||||
transition: transform 0.3s, visibility 0.3s;
|
|
||||||
transition: transform 0.3s, visibility 0.3s, -webkit-transform 0.3s;
|
|
||||||
-webkit-transform: translate3d(100%, 0, 0);
|
|
||||||
transform: translate3d(100%, 0, 0);
|
|
||||||
}
|
|
||||||
.ml-stack-nav > .ml-stack-nav__menu {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.ml-stack-nav--slide-left .ml-stack-nav__menu {
|
|
||||||
right: 20px;
|
|
||||||
left: 0;
|
|
||||||
-webkit-transform: translate3d(-100%, 0, 0);
|
|
||||||
transform: translate3d(-100%, 0, 0);
|
|
||||||
}
|
|
||||||
.ml-stack-nav--slide-left > .ml-stack-nav__menu {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
.no-js .ml-stack-nav:target {
|
|
||||||
position: static;
|
|
||||||
visibility: visible;
|
|
||||||
-webkit-transform: translate3d(0, 0, 0);
|
|
||||||
transform: translate3d(0, 0, 0);
|
|
||||||
}
|
|
||||||
.no-js .ml-stack-nav:target .ml-stack-nav__menu {
|
|
||||||
position: static;
|
|
||||||
visibility: visible;
|
|
||||||
-webkit-transform: translate3d(0, 0, 0);
|
|
||||||
transform: translate3d(0, 0, 0);
|
|
||||||
}
|
|
||||||
.no-js .ml-stack-nav .ml-stack-nav__next,
|
|
||||||
.no-js .ml-stack-nav .ml-stack-nav__back {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.is-open > .ml-stack-nav__menu {
|
|
||||||
visibility: visible;
|
|
||||||
-webkit-transform: translate3d(0, 0, 0);
|
|
||||||
transform: translate3d(0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.is-active > .ml-stack-nav__menu {
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*# sourceMappingURL=ml-stack-nav.css.map */
|
|
||||||
+27
-145
@@ -18,36 +18,35 @@
|
|||||||
|
|
||||||
<div class="row max-sized contents-container background-base-gray-side">
|
<div class="row max-sized contents-container background-base-gray-side">
|
||||||
<div class="
|
<div class="
|
||||||
col-xl-3
|
col-xl-3
|
||||||
col-lg-4
|
col-lg-4
|
||||||
col-md-4
|
col-md-4
|
||||||
col-sm-12
|
col-sm-12
|
||||||
col-xs-12
|
col-xs-12
|
||||||
col-12
|
col-12
|
||||||
side-menus">
|
side-menus">
|
||||||
<div class="search-container">
|
<div class="search-container">
|
||||||
<input class="search input" placeholder="SEARCH" />
|
<input class="search input" placeholder="SEARCH" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="side-menus-wrap jquery-accordion-menu"> -->
|
<!-- <div class="side-menus-wrap jquery-accordion-menu"> -->
|
||||||
{{ partial "docs-side-nav.html" . }}
|
{{ partial "docs-side-nav.html" . }}
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="
|
<div class="
|
||||||
col-xl-9
|
col-xl-9
|
||||||
col-lg-8
|
col-lg-8
|
||||||
col-md-8
|
col-md-8
|
||||||
col-sm-12
|
col-sm-12
|
||||||
col-xs-12
|
col-xs-12
|
||||||
col-12
|
col-12
|
||||||
texts-container">
|
texts-container">
|
||||||
<div class="docs-wrap">
|
<div class="docs-wrap">
|
||||||
{{ with .Params.Title }}
|
{{ with .Params.Title }}
|
||||||
<h1 class="m-t-0">{{ . }}</h1>
|
<h1 class="m-t-0">{{ . }}</h1>
|
||||||
<hr/>
|
<hr/>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ if .Params.ctaBanner }}
|
{{ if .Params.ctaBanner }}
|
||||||
{{ with index .Site.Data.cta .Params.ctaBanner }}
|
{{ with index .Site.Data.cta .Params.ctaBanner }}
|
||||||
<div class="docs-banner">
|
<div class="docs-banner">
|
||||||
@@ -69,23 +68,23 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="main-content docs-body">
|
<div class="main-content docs-body">
|
||||||
<!-- this is a test -->
|
<!-- this is a test -->
|
||||||
<!-- {{ partial "page-nav.html" . }} -->
|
<!-- {{ partial "page-nav.html" . }} -->
|
||||||
<!-- end test -->
|
<!-- end test -->
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
{{ $paginator := .Scratch.Get "paginator" }}
|
{{ $paginator := .Scratch.Get "paginator" }}
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
<div class="box m-b-md">
|
<div class="box m-b-md">
|
||||||
<div class="p-a-sm">
|
<div class="p-a-sm">
|
||||||
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
|
<h3><a href="{{.URL}}">{{.Title}}</a></h3>
|
||||||
|
|
||||||
{{ if .Params.Image }}
|
{{ if .Params.Image }}
|
||||||
<div class="thumbnail"><img src="{{ .Params.Image }}" alt="{{ .Params.Title }}"></div>
|
<div class="thumbnail"><img src="{{ .Params.Image }}" alt="{{ .Params.Title }}"></div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<p>{{ .Summary | safeHTML }}</p>
|
<p>{{ .Summary | safeHTML }}</p>
|
||||||
{{ if .Truncated }}
|
{{ if .Truncated }}
|
||||||
<div>
|
<div>
|
||||||
@@ -95,38 +94,38 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bg-default">
|
<div class="bg-default">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
{{ with .Params.Author }}
|
{{ with .Params.Author }}
|
||||||
<div class="p-h-sm p-v-xs"><i class="material-icons">person_outline</i> By: {{ . }}</div>
|
<div class="p-h-sm p-v-xs"><i class="material-icons">person_outline</i> By: {{ . }}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ if eq .Section "events" }}
|
{{ if eq .Section "events" }}
|
||||||
{{ with .Params.EventDate }}
|
{{ with .Params.EventDate }}
|
||||||
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ . }}</div>
|
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ . }}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
||||||
{{ with .Params.Date }}
|
{{ with .Params.Date }}
|
||||||
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ .Format "January 2, 2006" }}</div>
|
<div class="p-h-sm p-v-xs"><i class="material-icons">event</i> {{ .Format "January 2, 2006" }}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ if eq .Section "blog" }}
|
{{ if eq .Section "blog" }}
|
||||||
<div class="p-h-sm p-v-xs"><i class="material-icons">timer</i> Read Time: {{.ReadingTime}} minutes</div>
|
<div class="p-h-sm p-v-xs"><i class="material-icons">timer</i> Read Time: {{.ReadingTime}} minutes</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{ with .Params.Location }}
|
{{ with .Params.Location }}
|
||||||
<div class="p-h-sm p-v-xs"><i class="material-icons">location_on</i> {{ . }}</div>
|
<div class="p-h-sm p-v-xs"><i class="material-icons">location_on</i> {{ . }}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ template "_internal/pagination.html" . }}
|
{{ template "_internal/pagination.html" . }}
|
||||||
|
|
||||||
<div class="p-v-xs">{{ partial "page-edit.html" . }}</div>
|
<div class="p-v-xs">{{ partial "page-edit.html" . }}</div>
|
||||||
</article>
|
</article>
|
||||||
<!-- {{ with .TableOfContents }}
|
<!-- {{ with .TableOfContents }}
|
||||||
@@ -144,125 +143,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Side menu script
|
|
||||||
;(function ( $, window, document, undefined ) {
|
|
||||||
var pluginName = "jqueryAccordionMenu";
|
|
||||||
var defaults = {
|
|
||||||
speed: 300,
|
|
||||||
showDelay: 0,
|
|
||||||
hideDelay: 0,
|
|
||||||
singleOpen: true,
|
|
||||||
clickEffect: true
|
|
||||||
};
|
|
||||||
|
|
||||||
function Plugin ( element, options ) {
|
|
||||||
this.element = element;
|
|
||||||
this.settings = $.extend( {}, defaults, options );
|
|
||||||
this._defaults = defaults;
|
|
||||||
this._name = pluginName;
|
|
||||||
this.init();
|
|
||||||
};
|
|
||||||
|
|
||||||
$.extend(Plugin.prototype, {
|
|
||||||
|
|
||||||
init: function () {
|
|
||||||
this.submenuIndicators();
|
|
||||||
this.openSubmenu();
|
|
||||||
if(this.settings.clickEffect){
|
|
||||||
this.addClickEffect();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
openSubmenu: function () {
|
|
||||||
var touchmoved;
|
|
||||||
opts = this.settings; //to differ from local variable "this"
|
|
||||||
|
|
||||||
$(this.element).children("ul").find("li").find('.submenu-indicator').bind("click", function(e){
|
|
||||||
var targetElement = $(this).parent().parent()
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if (targetElement.attr('class') === 'back-to-the-top') {
|
|
||||||
$('.side-menus-container').scrollTop(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(targetElement.children(".submenu").length > 0) {
|
|
||||||
if(targetElement.children(".submenu").css("display") == "none") {
|
|
||||||
targetElement.children(".submenu").delay(opts.showDelay).slideDown(opts.speed);
|
|
||||||
targetElement.children(".submenu").siblings("a").addClass("submenu-indicator-minus");
|
|
||||||
targetElement.addClass("activate");
|
|
||||||
if(opts.singleOpen){
|
|
||||||
targetElement.siblings().children(".submenu").slideUp(opts.speed);
|
|
||||||
targetElement.siblings().children(".submenu").siblings("a").removeClass("submenu-indicator-minus");
|
|
||||||
targetElement.removeClass("activate");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
targetElement.children(".submenu").delay(opts.hideDelay).slideUp(opts.speed);
|
|
||||||
targetElement.removeClass("activate");
|
|
||||||
}
|
|
||||||
if(targetElement.children(".submenu").siblings("a").hasClass("submenu-indicator-minus")){
|
|
||||||
targetElement.children(".submenu").siblings("a").removeClass("submenu-indicator-minus");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// .on('touchmove', function(e) {
|
|
||||||
// touchmoved = true;
|
|
||||||
// }).on('touchstart', function(e) {
|
|
||||||
// touchmoved = false;
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
|
|
||||||
submenuIndicators: function () {
|
|
||||||
if($(this.element).find(".submenu").length > 0){
|
|
||||||
$(this.element).find(".submenu").siblings("a").append("<span class='submenu-indicator'><span class='object1'></span><span class='object2'></span><span class='object3'></span></span>");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
addClickEffect: function () {
|
|
||||||
var ink, d, x, y;
|
|
||||||
$(this.element).find("a").bind("click touchstart", function(e){
|
|
||||||
$(".ink").remove();
|
|
||||||
|
|
||||||
if($(this).children(".ink").length === 0){
|
|
||||||
$(this).prepend("<span class='ink'></span>");
|
|
||||||
}
|
|
||||||
|
|
||||||
ink = $(this).find(".ink");
|
|
||||||
ink.removeClass("animate-ink");
|
|
||||||
|
|
||||||
if(!ink.height() && !ink.width()){
|
|
||||||
d = Math.max($(this).outerWidth(), $(this).outerHeight());
|
|
||||||
ink.css({height: d, width: d});
|
|
||||||
}
|
|
||||||
|
|
||||||
x = e.pageX - $(this).offset().left - ink.width()/2;
|
|
||||||
y = e.pageY - $(this).offset().top - ink.height()/2;
|
|
||||||
|
|
||||||
ink.css({top: y+'px', left: x+'px'}).addClass("animate-ink");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.fn[ pluginName ] = function ( options ) {
|
|
||||||
this.each(function() {
|
|
||||||
if ( !$.data( this, "plugin_" + pluginName ) ) {
|
|
||||||
$.data( this, "plugin_" + pluginName, new Plugin( this, options ) );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
})( jQuery, window, document );
|
|
||||||
|
|
||||||
var sideNavMenus = $('.side-menus-container');
|
|
||||||
sideNavMenus.jqueryAccordionMenu();
|
|
||||||
|
|
||||||
var sideNavMenusMobile = $('.docs-container .side-menus');
|
|
||||||
$('.guide-menus-activator').click(function() {
|
$('.guide-menus-activator').click(function() {
|
||||||
if (sideNavMenusMobile.hasClass('show')) {
|
$('.docs-container .side-menus').toggleClass('show');
|
||||||
sideNavMenusMobile.removeClass('show');
|
|
||||||
} else {
|
|
||||||
sideNavMenusMobile.addClass('show');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// anchor click control.
|
// anchor click control.
|
||||||
@@ -280,7 +162,7 @@
|
|||||||
if (scrn < scrn_check) {
|
if (scrn < scrn_check) {
|
||||||
depth = 120;
|
depth = 120;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objt_mt > 0) {
|
if (objt_mt > 0) {
|
||||||
depth = depth + objt_mt
|
depth = depth + objt_mt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,26 +12,29 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<!-- product dropdown -->
|
<!-- product dropdown -->
|
||||||
<div class="side-menus-container product-select jquery-accordion-menu">
|
<div class="side-menus-container product-select tree-nav jquery-accordion-menu">
|
||||||
<ul class="side-menus-wrap">
|
<ul class="side-menus-wrap">
|
||||||
<li class="">
|
<li class="tree-nav-item">
|
||||||
<a href="{{ ($.Scratch.Get "topLevel").Permalink }}" class="">
|
<a>
|
||||||
<span class="">
|
{{ range $product := $.Site.Sections }}
|
||||||
{{ range $product := $.Site.Sections }}
|
{{ range $version := .Sections }}
|
||||||
{{ range $version := .Sections }}
|
{{ range $language := .Sections }}
|
||||||
{{ range $language := .Sections }}
|
{{if $.CurrentSection}}
|
||||||
{{if $.CurrentSection}}
|
{{ if .IsAncestor $.CurrentSection }}
|
||||||
{{ if .IsAncestor $.CurrentSection }}
|
{{ .Params.shortTitle }}
|
||||||
{{ .Params.shortTitle }}
|
|
||||||
{{end}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
<span class="submenu-indicator">
|
||||||
|
<span class="object1"></span>
|
||||||
|
<span class="object2"></span>
|
||||||
|
<span class="object3"></span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<ul class="submenu submenus-wrap">
|
<ul class="tree-nav-sublist submenu submenus-wrap hide">
|
||||||
{{ range $product := $.Site.Sections }}
|
{{ range $product := $.Site.Sections }}
|
||||||
{{ range $version := .Sections }}
|
{{ range $version := .Sections }}
|
||||||
{{ range $language := .Sections }}
|
{{ range $language := .Sections }}
|
||||||
@@ -48,11 +51,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="guide-menus-activator">
|
<div class="guide-menus-activator">
|
||||||
{{ if .Title }}
|
{{ if .Title }}
|
||||||
{{.Title}}
|
{{.Title}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
Quick Start Guide
|
(No Title)
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<span class="indicator">
|
<span class="indicator">
|
||||||
<span class="object1"></span>
|
<span class="object1"></span>
|
||||||
@@ -60,36 +63,72 @@ Quick Start Guide
|
|||||||
<span class="object3"></span>
|
<span class="object3"></span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="side-menus-container guide-menus jquery-accordion-menu">
|
<div class="side-menus-container guide-menus tree-nav jquery-accordion-menu">
|
||||||
<ul class="side-menus-wrap second">
|
<ul class="side-menus-wrap second">
|
||||||
{{ template "section-tree-nav" ($.Scratch.Get "topLevel") }}
|
{{ $activeNode := . }}
|
||||||
|
{{ range ($.Scratch.Get "topLevel").Sections }}
|
||||||
<li class="back-to-the-top">
|
{{ template "menu" dict "node" . "activeNode" $activeNode }}
|
||||||
<a href="#" class="submenu-indicator-close">
|
{{ end }}
|
||||||
Back to the top
|
|
||||||
<svg class="svg-icon" enable-background="new 0 0 34 34" viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g class="svg-linear" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10">
|
|
||||||
<path d="m12 14.5 5-5 5 5"></path><path d="m17 9.5v15"></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<span class="submenu-indicator"><span class="object1"></span><span class="object2"></span><span class="object3"></span></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ define "section-tree-nav" }}
|
{{ define "menu" }}
|
||||||
{{ range .Sections}}
|
{{/* .node and .activeNode come from the caller */}}
|
||||||
<li class="tree-nav-item"><a href="{{ .RelPermalink}}">{{ .Title }}</a>
|
{{- $activeNode := .activeNode -}}
|
||||||
{{if gt (len .Sections) 0}}
|
{{- with .node -}}
|
||||||
<ul class="tree-nav-sublist submenu submenus-wrap">
|
{{- $isActive := "" -}}
|
||||||
{{ range .Pages }}
|
{{- if eq .UniqueID $activeNode.UniqueID -}}
|
||||||
<li class="tree-nav-item-child"><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
{{- $isActive = "active" -}}
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
{{ template "section-tree-nav" . }}
|
|
||||||
</ul>
|
{{- $isOpen := false -}}
|
||||||
{{end}}
|
{{- if (or .Params.alwaysOpen (.IsAncestor $activeNode)) -}}
|
||||||
</li>
|
{{- $isOpen = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .IsSection -}}
|
||||||
|
{{- $children := (add (len .Pages) (len .Sections)) -}}
|
||||||
|
<li class="tree-nav-item {{ $isActive }}">
|
||||||
|
<a href="{{ .URL }}" class="{{if $isOpen}}submenu-indicator-minus{{end}}">
|
||||||
|
{{- if .Params.shortTitle -}}
|
||||||
|
{{ .Params.shortTitle}}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Title }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if gt $children 0 -}}
|
||||||
|
<span class="submenu-indicator">
|
||||||
|
<span class="object1"></span>
|
||||||
|
<span class="object2"></span>
|
||||||
|
<span class="object3"></span>
|
||||||
|
</span>
|
||||||
|
{{- end -}}
|
||||||
|
</a>
|
||||||
|
{{if gt $children 0}}
|
||||||
|
<ul class="tree-nav-sublist submenu submenus-wrap {{ if not $isOpen }}hide{{end}}">
|
||||||
|
{{- $pages := .Pages -}}
|
||||||
|
|
||||||
|
{{- if .Sections -}}
|
||||||
|
{{- $pages = (.Pages | union .Sections) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range $pages.ByWeight -}}
|
||||||
|
{{- if not .Params.hidden -}}
|
||||||
|
{{template "menu" dict "node" . "activeNode" $activeNode}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</ul>
|
||||||
|
{{- end -}}
|
||||||
|
</li>
|
||||||
|
{{- else if not .Params.hidden -}}
|
||||||
|
<li class="{{ $isActive }}">
|
||||||
|
<a href="{{ .URL }}">
|
||||||
|
{{- if .Params.shortTitle -}}
|
||||||
|
{{ .Params.shortTitle}}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Title }}
|
||||||
|
{{- end -}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{- end -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
{{ range .Sections}}
|
{{ range .Sections}}
|
||||||
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a>
|
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a>
|
||||||
{{if gt (len .Sections) 0}}
|
{{if gt (len .Sections) 0}}
|
||||||
<!-- <i class="material-icons expand-toggle">add_box</i> -->
|
|
||||||
<ul class="hide">
|
<ul class="hide">
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
<li class=""><a href="{{ .RelPermalink}}">{{ .Title }}</a></li>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
"jsdom": "^11.11.0",
|
"jsdom": "^11.11.0",
|
||||||
"lory.js": "^2.4.1",
|
"lory.js": "^2.4.1",
|
||||||
"md5": "^2.2.1",
|
"md5": "^2.2.1",
|
||||||
"ml-stack-nav": "^1.1.2",
|
|
||||||
"moment": "^2.20.1",
|
"moment": "^2.20.1",
|
||||||
"rancher-website-theme": "https://github.com/rancherlabs/website-theme.git",
|
"rancher-website-theme": "https://github.com/rancherlabs/website-theme.git",
|
||||||
"request": "^2.87.0",
|
"request": "^2.87.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user