breadcrumb update
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
{{- partial "head.html" . -}}
|
||||
<meta name="description" content="{{ .Params.description }}" />
|
||||
{{- block "head" . -}}{{- end }}
|
||||
|
||||
<!-- stylesheets -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
{{ define "head"}}
|
||||
<meta name="description" content="blog of {{ .Site.Title}}" />
|
||||
<title>blog</title>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ define "main" }}
|
||||
<section class="bg-light">
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{{ define "head"}}
|
||||
<meta name="description" content="{{ .Params.description }}" />
|
||||
<title>{{ .Title }}</title>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="bg-light">
|
||||
<div class="container">
|
||||
<div class="row justify-content-md-center">
|
||||
@@ -42,6 +49,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||
{{ $.Scratch.Add "path" .Site.BaseURL }}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item" aria-current="page">
|
||||
<a href="/">home</a>
|
||||
</li>
|
||||
{{ range $index, $element := split $url "/" }}
|
||||
{{ $.Scratch.Add "path" $element }}
|
||||
{{ if ne $element "" }}
|
||||
<li class="breadcrumb-item" aria-current="page">
|
||||
<a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a>
|
||||
</li>
|
||||
{{ $.Scratch.Add "path" "/" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<!-- image -->
|
||||
<div class="py-2">
|
||||
{{ with .Params.bg_image }}
|
||||
|
||||
Reference in New Issue
Block a user