Convert single page into hugo template

This commit is contained in:
hossainemruz 2020-04-17 02:40:14 +06:00
parent e7540fe5a9
commit 6106bb0fb3
21 changed files with 400 additions and 2310 deletions

View file

@ -1,11 +1,34 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
<head>
<!------ ADD COMMON HEADERS -------->
{{- partial "header.html" . -}}
<!------ ADD PAGE SPECIFIC HEADERS ------->
{{ block "header" . }} {{ end }}
<!-- ADD GOOGLE ANALYTICS IF ENABLED -->
{{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
</head>
<body>
<div class="container-fluid bg-dimmed wrapper">
<!----- ADD NAVBAR --------------->
{{ block "navbar" . }} {{ end }}
<!----- ADD PAGE CONTENT --------->
{{ block "content" . }} {{ end }}
</div>
<!------- ADD FOOTER ------------>
{{- partial "footer.html" . -}}
<!------- ADD COMMON SCRIPTS ------->
{{ partial "scripts.html" . }}
<!------- ADD PAGE SPECIFIC SCRIPTS ------>
{{ block "scripts" . }} {{ end }}
</body>
</html>

View file

@ -1,11 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>List</title>
</head>
<body>
<h1>This is list page....</h1>
</body>
</html>
{{ define "header" }}
{{ end }}
{{ define "navbar" }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" true) }}
{{ end }}
{{ define "content" }}
<h1>Here is the actual content</h1>
{{ end }}
{{ define "scripts" }}
<script src="/assets/js/list.js"></script>
{{ end }}

View file

@ -1,11 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Single</title>
</head>
<body>
<h1>This is single page</h1>
</body>
</html>
{{ define "header" }}
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
/>
<link rel="stylesheet" href="/assets/css/single.css" />
{{ end }}
{{ define "navbar" }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }}
{{ end }}
{{ define "content" }}
<div class="container p-0 read-area">
<!--Hero Area-->
<div class="hero-area col-sm-12" style="background-image: url({{ .Page.Params.hero }});">
</div>
<!--Content Start-->
<div class="page-content">
<div class="author-profile ml-auto align-self-lg-center">
<img class="rounded-circle" src="{{.Page.Params.author.image }}" alt="" />
<h5>{{ .Page.Params.author.name }}</h5>
<p>{{ .Page.Date.Format "January 2, 2006" }}</p>
</div>
<div class="title">
<h1>{{ .Page.Title }}</h1>
</div>
<div class="post-content">
{{ .Page.Content }}
</div>
<!---Next and Previous Navigator -->
<hr />
<div class="row next-prev-navigator">
{{ if .Prev }}
<div class="col-md-6 previous-article">
<a href="{{.Prev.RelPermalink}}" class="btn btn-outline-info">
<span><i class="fas fa-chevron-circle-left"></i> Prev</span>
<br />
<span>{{ .Prev.Title }}</span>
</a>
</div>
{{ end }}
{{ if .Next }}
<div class="col-md-6 next-article">
<a href="{{ .Next.RelPermalink }}" class="btn btn-outline-info">
<span>Next <i class="fas fa-chevron-circle-right"></i></span>
<br />
<span>{{ .Next.Title }}</span>
</a>
</div>
{{ end }}
</div>
<hr />
<!-- Add Disqus forum -->
{{ if .Site.DisqusShortname }}
{{ partial "disqus.html" . }}
{{ end }}
</div>
{{ end }}
{{ define "scripts" }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
{{ if .Params.math }}
{{ partial "math.html" . }}
{{ end }}
{{ end }}