modified notice shortcode

This commit is contained in:
somrat 2019-12-30 16:27:38 +06:00
parent 647b278e71
commit 448a3a9c30
3 changed files with 36 additions and 33 deletions

View file

@ -78,34 +78,36 @@ Lorem ipsum dolor sit amet consectetur adipisicing elit. Quam nihil enim maxime
#### Notice #### Notice
{{% notice note %}} {{< notice note >}}
This is a simple note. This is a simple note.
{{% /notice %}} {{< /notice >}}
{{% notice tip %}} {{< notice tip >}}
This is a simple tip. This is a simple tip.
{{% /notice %}} {{< /notice >}}
{{% notice info %}} {{< notice info >}}
This is a simple info. This is a simple info.
{{% /notice %}} {{< /notice >}}
<hr> <hr>
#### Tab #### Tab
{{< tabs >}} {{< tabs >}}
{{% tab "first" %}}
{{< tab "first" >}}
This is first tab This is first tab
{{%/ tab %}} {{< /tab >}}
{{% tab "second" %}} {{< tab "second" >}}
this is second tab this is second tab
{{%/ tab %}} {{< /tab >}}
{{% tab "third" %}} {{< tab "third" >}}
this is third tab this is third tab
{{%/ tab %}} {{< /tab >}}
{{</ tabs >}} {{</ tabs >}}
<hr> <hr>

View file

@ -78,35 +78,37 @@ Lorem ipsum dolor sit amet consectetur adipisicing elit. Quam nihil enim maxime
#### Notice #### Notice
{{% notice note %}} {{< notice note >}}
This is a simple note. This is a simple note.
{{% /notice %}} {{< /notice >}}
{{% notice tip %}} {{< notice tip >}}
This is a simple tip. This is a simple tip.
{{% /notice %}} {{< /notice >}}
{{% notice info %}} {{< notice info >}}
This is a simple info. This is a simple info.
{{% /notice %}} {{< /notice >}}
<hr> <hr>
#### Tab #### Tab
{{% tabs %}} {{< tabs >}}
{{% tab "first" %}}
{{< tab "first" >}}
This is first tab This is first tab
{{% /tab %}} {{< /tab >}}
{{% tab "second" %}} {{< tab "second" >}}
this is second tab this is second tab
{{% /tab %}} {{< /tab >}}
{{% tab "third" %}} {{< tab "third" >}}
this is third tab this is third tab
{{% /tab %}} {{< /tab >}}
{{% tabs %}}
{{</ tabs >}}
<hr> <hr>

View file

@ -7,8 +7,7 @@
<ul class="list-styled"> <ul class="list-styled">
{{ $currentNode := . }} {{ $currentNode := . }}
{{ $showvisitedlinks := .Site.Params.showVisitedLinks }} {{ $showvisitedlinks := .Site.Params.showVisitedLinks }}
<a class="d-block h4 back-btn" <a class="d-block h4 back-btn" href="{{ `/` | absLangURL }}">{{ i18n "Back-home"}}</a>
href="{{ "/" | absLangURL }}">{{ i18n "Back-home"}}</a>
{{range .Site.Home.Sections.ByWeight}} {{range .Site.Home.Sections.ByWeight}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}} {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{end}} {{end}}
@ -35,7 +34,7 @@
{{ define "menu-nextprev" }} {{ define "menu-nextprev" }}
{{$currentNode := .currentnode }} {{$currentNode := .currentnode }}
{{ if ne .menu.Params.hidden true}} {{ if ne .menu.Params.hidden true}}
{{if hasPrefix $currentNode.URL .menu.URL }} {{if hasPrefix $currentNode.Permalink .menu.Permalink }}
{{ $currentNode.Scratch.Set "NextPageOK" "OK" }} {{ $currentNode.Scratch.Set "NextPageOK" "OK" }}
{{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }} {{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }}
{{else}} {{else}}
@ -61,10 +60,10 @@
{{ end }} {{ end }}
{{with ($.Scratch.Get "prevPage")}} {{with ($.Scratch.Get "prevPage")}}
<a class="nav nav-prev" href="{{.URL | absURL}}"><i class="ti-arrow-left mr-2"></i>{{.Title}}</a> <a class="nav nav-prev" href="{{.Permalink }}"><i class="ti-arrow-left mr-2"></i>{{.Title}}</a>
{{end}} {{end}}
{{with ($.Scratch.Get "nextPage")}} {{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.URL | absURL}}">{{.Title}}<i class="ti-arrow-right ml-2"></i></a> <a class="nav nav-next" href="{{.Permalink }}">{{.Title}}<i class="ti-arrow-right ml-2"></i></a>
{{end}} {{end}}
</nav> </nav>
</div> </div>
@ -80,11 +79,11 @@
{{ $currentNode := .currentnode }} {{ $currentNode := .currentnode }}
{{with .sect}} {{with .sect}}
{{safeHTML .Params.head}} {{safeHTML .Params.head}}
<li data-nav-id="{{.URL | absURL}}" title="{{.Title}}" class="sidelist <li data-nav-id="{{.Permalink}}" title="{{.Title}}" class="sidelist
{{if .IsAncestor $currentNode }}parent{{end}} {{if .IsAncestor $currentNode }}parent{{end}}
{{with .File}} {{if eq .UniqueID $currentNode.UniqueID}}active{{end}} {{ end }} {{with .File}} {{if eq .UniqueID $currentNode.UniqueID}}active{{end}} {{ end }}
{{if .Params.alwaysopen}}parent{{end}}"> {{if .Params.alwaysopen}}parent{{end}}">
<a href="{{.RelPermalink}}"> <a href="{{.Permalink}}">
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}} {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
</a> </a>
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }} {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}