breadcrumb update

This commit is contained in:
gurusabarish
2020-09-29 18:04:54 +05:30
parent 1d9c819ddb
commit b3f0329bff
6 changed files with 35 additions and 4 deletions
+1 -1
View File
@@ -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">
+6
View File
@@ -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">
+26
View File
@@ -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 }}