code formatting

This commit is contained in:
Somrat 2022-01-30 11:10:45 +06:00
parent fa2d300c90
commit def0a392a5
9 changed files with 320 additions and 267 deletions

View file

@ -4,21 +4,21 @@
<body> <body>
{{ if .IsHome }} {{ if .IsHome }}
{{ "<!-- header -->" | safeHTML }} <!-- header -->
<header class="banner {{if .Site.Params.banner.bg_image}}overlay bg-cover{{else}}bg-primary{{end}}" data-background="{{ .Site.Params.banner.bg_image | absURL }}"> <header
{{ partial "navigation.html" . }} class="banner {{if .Site.Params.banner.bg_image}}overlay bg-cover{{else}}bg-primary{{end}}"
{{ partialCached "banner.html" . }} data-background="{{ .Site.Params.banner.bg_image | absURL }}"
>
{{ partial "navigation.html" . }} {{ partialCached "banner.html" . }}
</header> </header>
{{ "<!-- /header -->" | safeHTML }} <!-- /header -->
{{ else }} {{ else }}
{{ "<!-- header -->" | safeHTML }} <!-- header -->
<header class="shadow-bottom sticky-top bg-white"> <header class="shadow-bottom sticky-top bg-white">
{{ partial "navigation.html" . }} {{ partial "navigation.html" . }}
</header> </header>
{{ "<!-- /header -->" | safeHTML }} <!-- /header -->
{{ end }} {{ end }} {{ block "main" . }}{{ end }}
{{ block "main" . }}{{ end }}
{{ partialCached "footer.html" . }} {{ partialCached "footer.html" . }}
</body> </body>
</html> </html>

View file

@ -1,25 +1,51 @@
{{ define "main" }} {{ define "main" }}
{{ "<!-- contact -->" | safeHTML }} <!-- contact -->
<section class="section"> <section class="section">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h2 class="section-title text-primary">{{ .Title }}</h2> <h2 class="section-title text-primary">{{ .Title }}</h2>
{{ .Content }} {{ .Content }}
<form action="{{ .Site.Params.contact_form_action | safeURL }}" method="POST"> <form
<input type="text" id="name" name="name" placeholder="Name" class="form-control mb-4 shadow rounded-0"> action="{{ .Site.Params.contact_form_action | safeURL }}"
<input type="email" id="mail" name="mail" placeholder="Email" class="form-control mb-4 shadow rounded-0"> method="POST"
<input type="text" id="subject" name="subject" placeholder="Subject" >
class="form-control mb-4 shadow rounded-0"> <input
<textarea name="message" id="message" placeholder="Message" type="text"
class="form-control mb-4 shadow rounded-0"></textarea> id="name"
<button type="submit" value="send" class="btn btn-primary">{{ i18n "send" }}</button> name="name"
placeholder="Name"
class="form-control mb-4 shadow rounded-0"
/>
<input
type="email"
id="mail"
name="mail"
placeholder="Email"
class="form-control mb-4 shadow rounded-0"
/>
<input
type="text"
id="subject"
name="subject"
placeholder="Subject"
class="form-control mb-4 shadow rounded-0"
/>
<textarea
name="message"
id="message"
placeholder="Message"
class="form-control mb-4 shadow rounded-0"
></textarea>
<button type="submit" value="send" class="btn btn-primary">
{{ i18n "send" }}
</button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
{{ "<!-- /contact -->" | safeHTML }} <!-- /contact -->
{{ end }} {{ end }}

View file

@ -1,20 +1,16 @@
{{ define "main" }} {{ define "main" }} {{ $data := index .Site.Data .Site.Language.Lang }}
<!-- faq -->
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ "<!-- faq -->" | safeHTML }}
<section class="section pb-0"> <section class="section pb-0">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h2 class="section-title text-primary">{{ .Title }}</h2> <h2 class="section-title text-primary">{{ .Title }}</h2>
{{ "<!-- accordion -->" | safeHTML }} <!-- accordion -->
<div id="accordion"> <div id="accordion">{{ .Content }}</div>
{{ .Content }}
</div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
{{ "<!-- /faq -->" | safeHTML }} <!-- /faq -->
{{ end }} {{ end }}

View file

@ -7,31 +7,36 @@
</div> </div>
</section> </section>
{{ end }} {{ end }}
{{ "<!-- topics -->" | safeHTML }}
<!-- topics -->
<section class="section"> <section class="section">
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12 text-center"> <div class="col-12 text-center">
<h2 class="section-title">{{ i18n "topics_title" | safeHTML }}</h2> <h2 class="section-title">{{ i18n "topics_title" | markdownify }}</h2>
</div> </div>
{{ "<!-- topic-item -->" | safeHTML }} <!-- topic-item -->
{{ range (where .Site.Pages "Type" "docs") }} {{ range (where .Site.Pages "Type" "docs") }}
<div class="col-lg-4 col-sm-6 mb-4"> <div class="col-lg-4 col-sm-6 mb-4">
<a href="{{ .Permalink }}" class="px-4 py-5 bg-white shadow text-center d-block match-height"> <a href="{{ .Permalink }}" class="px-4 py-5 bg-white shadow text-center d-block match-height">
{{ with .Params.icon}}<i class="{{.}} icon text-primary d-block mb-4"></i>{{end}} {{ with .Params.icon}}
<i class="{{.}} icon text-primary d-block mb-4"></i>
{{end}}
<h3 class="mb-3 mt-0">{{ .Title }}</h3> <h3 class="mb-3 mt-0">{{ .Title }}</h3>
{{with .Params.description}}<p class="mb-0">{{. | markdownify}}</p>{{end}} {{with .Params.description}}
<p class="mb-0">{{. | markdownify}}</p>
{{end}}
</a> </a>
</div> </div>
{{ end }} {{ end }}
</div> </div>
</div> </div>
</section> </section>
{{ "<!-- /topics -->" | safeHTML }} <!-- /topics -->
{{ if .Site.Params.cta.enable }} {{ if .Site.Params.cta.enable }}
{{ with .Site.Params.cta }} {{ with .Site.Params.cta }}
{{ "<!-- call to action -->" | safeHTML }} <!-- call to action -->
<section> <section>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
@ -49,7 +54,7 @@
</div> </div>
</div> </div>
</section> </section>
{{ "<!-- /call to action -->" | safeHTML }} <!-- /call to action -->
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -1,16 +1,23 @@
{{ "<!-- banner -->" | safeHTML }} <!-- banner -->
<div class="container section"> <div class="container section">
<div class="row"> <div class="row">
<div class="col-lg-8 text-center mx-auto"> <div class="col-lg-8 text-center mx-auto">
<h1 class="text-white mb-3">{{ .Site.Params.banner.title | markdownify }}</h1> <h1 class="text-white mb-3">
<p class="text-white mb-4">{{ .Site.Params.banner.subtitle | markdownify }}</p> {{ .Site.Params.banner.title | markdownify }}
</h1>
<p class="text-white mb-4">
{{ .Site.Params.banner.subtitle | markdownify }}
</p>
<div class="position-relative"> <div class="position-relative">
<input id="search" class="form-control" placeholder="{{ .Site.Params.banner.placeholder }}"> <input
id="search"
class="form-control"
placeholder="{{ .Site.Params.banner.placeholder }}"
/>
<i class="ti-search search-icon"></i> <i class="ti-search search-icon"></i>
<!-- Javascript --> <!-- Javascript -->
{{ $currentNode := . }} {{ $currentNode := . }} {{ $currentNode.Scratch.Set "pages" .Site.Pages
{{ $currentNode.Scratch.Set "pages" .Site.Pages }} }} {{ $pages := ($currentNode.Scratch.Get "pages") }}
{{ $pages := ($currentNode.Scratch.Get "pages") }}
<script> <script>
$(function() { $(function() {
var projects = [ var projects = [
@ -36,4 +43,4 @@
</div> </div>
</div> </div>
</div> </div>
{{ "<!-- /banner -->" | safeHTML }} <!-- /banner -->

View file

@ -1,24 +1,26 @@
{{ "<!-- details page -->" | safeHTML }} <!-- details page -->
<section class="single section-sm pb-0"> <section class="single section-sm pb-0">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<div class="sidebar"> <div class="sidebar">
<a class="back-btn" href="{{ .Site.BaseURL | relLangURL }}" aria-label="back"></a> <a
class="back-btn"
href="{{ .Site.BaseURL | relLangURL }}"
aria-label="back"
></a>
<ul class="list-styled"> <ul class="list-styled">
{{ $currentNode := . }} {{ $currentNode := . }} {{range .Site.Home.Sections.ByWeight}} {{ if
{{range .Site.Home.Sections.ByWeight}} eq .FirstSection $currentNode.FirstSection }} {{ template
{{ if eq .FirstSection $currentNode.FirstSection }} "section-tree-nav" dict "sect" . "currentnode" $currentNode}} {{ end
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode}} }} {{ end }} {{ if .Content }} {{ if eq .Params.downloadBtn "true"
{{ end }} }}
{{ end }}
{{ if .Content }}
{{ if eq .Params.downloadBtn "true" }}
<div> <div>
<button class="btn btn-primary btn-block" id="generatePDF" > Get Pdf </button> <button class="btn btn-primary btn-block" id="generatePDF">
Get Pdf
</button>
</div> </div>
{{ end }} {{ end }} {{ end }}
{{ end }}
</ul> </ul>
</div> </div>
</div> </div>
@ -30,48 +32,49 @@
{{ else }} {{ else }}
<div class="bg-light p-4"> <div class="bg-light p-4">
<ul class="page-list"> <ul class="page-list">
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }} {{ template "section-tree-nav" dict "sect" . "currentnode"
$currentNode }}
</ul> </ul>
</div> </div>
{{ end }} {{ end }}
<p class="post-meta border-bottom pb-3 mb-0 mt-3">Updated on {{ .Lastmod.Format "02 Jan 2006" }}</p> <p class="post-meta border-bottom pb-3 mb-0 mt-3">
Updated on {{ .Lastmod.Format "02 Jan 2006" }}
</p>
<nav class="pagination mt-3"> <nav class="pagination mt-3">
<!-- Next prev page --> <!-- Next prev page -->
{{ $currentNode := . }} {{ $currentNode := . }} {{ template "menu-nextprev" dict "menu"
{{ template "menu-nextprev" dict "menu" .Site.Home "currentnode" $currentNode }} .Site.Home "currentnode" $currentNode }} {{ define "menu-nextprev"
{{ define "menu-nextprev" }} }} {{$currentNode := .currentnode }} {{ if ne .menu.Params.hidden
{{$currentNode := .currentnode }} true}} {{if hasPrefix $currentNode.Permalink .menu.Permalink }} {{
{{ if ne .menu.Params.hidden true}} $currentNode.Scratch.Set "NextPageOK" "OK" }} {{
{{if hasPrefix $currentNode.Permalink .menu.Permalink }} $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get
{{ $currentNode.Scratch.Set "NextPageOK" "OK" }} "prevPageTmp") }} {{else}} {{if eq ($currentNode.Scratch.Get
{{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }} "NextPageOK") "OK"}} {{ $currentNode.Scratch.Set "NextPageOK" nil }}
{{else}} {{ $currentNode.Scratch.Set "nextPage" .menu }} {{end}} {{end}} {{
{{if eq ($currentNode.Scratch.Get "NextPageOK") "OK"}} $currentNode.Scratch.Set "prevPageTmp" .menu }} {{
{{ $currentNode.Scratch.Set "NextPageOK" nil }} $currentNode.Scratch.Set "pages" .menu.Pages }} {{ if .menu.IsHome}}
{{ $currentNode.Scratch.Set "nextPage" .menu }} {{ $currentNode.Scratch.Set "pages" .menu.Sections }} {{ else if
{{end}} .menu.Sections}} {{ $currentNode.Scratch.Set "pages" (.menu.Pages |
{{end}} union .menu.Sections) }} {{end}} {{ $pages :=
{{ $currentNode.Scratch.Set "prevPageTmp" .menu }} ($currentNode.Scratch.Get "pages") }} {{ range $pages.ByWeight }} {{
template "menu-nextprev" dict "menu" . "currentnode" $currentNode }}
{{ $currentNode.Scratch.Set "pages" .menu.Pages }} {{end}} {{ end }} {{ end }} {{with ($.Scratch.Get "prevPage")}}
{{ if .menu.IsHome}} <a
{{ $currentNode.Scratch.Set "pages" .menu.Sections }} class="nav nav-prev"
{{ else if .menu.Sections}} href="{{.Permalink }}"
{{ $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) }} aria-label="Previous page"
{{end}} ><i class="ti-arrow-left mr-2"></i>
{{ $pages := ($currentNode.Scratch.Get "pages") }} <span class="d-none d-md-block">{{.Title}}</span></a
>
{{ range $pages.ByWeight }} {{end}} {{with ($.Scratch.Get "nextPage")}}
{{ template "menu-nextprev" dict "menu" . "currentnode" $currentNode }} <a
{{end}} class="nav nav-next"
{{ end }} href="{{.Permalink }}"
{{ end }} aria-label="Previous page"
>
{{with ($.Scratch.Get "prevPage")}} <span class="d-none d-md-block">{{.Title}}</span
<a class="nav nav-prev" href="{{.Permalink }}" aria-label="Previous page" ><i class="ti-arrow-left mr-2"></i> <span class="d-none d-md-block">{{.Title}}</span></a> ><i class="ti-arrow-right ml-2"></i
{{end}} ></a>
{{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.Permalink }}" aria-label="Previous page" > <span class="d-none d-md-block">{{.Title}}</span><i class="ti-arrow-right ml-2"></i></a>
{{end}} {{end}}
</nav> </nav>
</div> </div>
@ -79,34 +82,31 @@
</div> </div>
</div> </div>
</section> </section>
{{ "<!-- /details page -->" | safeHTML }} <!-- /details page -->
<!-- templates --> <!-- templates -->
{{ define "section-tree-nav" }} {{ define "section-tree-nav" }} {{ $showvisitedlinks := .showvisitedlinks }} {{
{{ $showvisitedlinks := .showvisitedlinks }} $currentNode := .currentnode }} {{with .sect}} {{safeHTML .Params.head}} {{
{{ $currentNode := .currentnode }} $fileUniqueID := "" }} {{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }}
{{with .sect}} {{ $currentNodeFileUniqueID := "" }} {{ with $currentNode.File }}{{
{{safeHTML .Params.head}} $currentNodeFileUniqueID = .UniqueID }}{{ end }}
{{ $fileUniqueID := "" }} <li
{{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }} data-nav-id="{{.Permalink}}"
{{ $currentNodeFileUniqueID := "" }} title="{{.Title}}"
{{ with $currentNode.File }}{{ $currentNodeFileUniqueID = .UniqueID }}{{ end }} class="sidelist
<li data-nav-id="{{.Permalink}}" title="{{.Title}}" class="sidelist {{if eq $fileUniqueID $currentNodeFileUniqueID}}active{{end}}"
{{if eq $fileUniqueID $currentNodeFileUniqueID}}active{{end}}"> >
<a href="{{.Permalink}}"> <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)) }} {{ if ne
{{ if ne $numberOfPages 0 }} $numberOfPages 0 }}
<ul> <ul>
{{ range .Pages.ByWeight }} {{ range .Pages.ByWeight }} {{ if and .Params.hidden (not $.showhidden) }}
{{ if and .Params.hidden (not $.showhidden) }} {{else}} {{ template "section-tree-nav" dict "sect" . "currentnode"
{{else}} $currentNode }} {{end}} {{end}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
{{end}}
{{end}}
</ul> </ul>
{{ end }} {{ end }}
</li> </li>
{{ end }} {{ end }} {{ end }}
{{ end }}

View file

@ -1,4 +1,4 @@
{{ "<!-- footer -->" | safeHTML }} <!-- footer -->
<footer class="section pb-4"> <footer class="section pb-4">
<div class="container"> <div class="container">
<div class="row align-items-center"> <div class="row align-items-center">
@ -8,15 +8,22 @@
<div class="col-md-4 text-md-right text-center"> <div class="col-md-4 text-md-right text-center">
<ul class="list-inline"> <ul class="list-inline">
{{ range .Site.Params.social }} {{ range .Site.Params.social }}
<li class="list-inline-item"><a class="text-color d-inline-block p-2" href="{{ .link | safeURL }}" aria-label="{{ .name }}"><i class="{{ .icon }}"></i></a></li> <li class="list-inline-item">
<a
class="text-color d-inline-block p-2"
href="{{ .link | safeURL }}"
aria-label="{{ .name }}"
><i class="{{ .icon }}"></i
></a>
</li>
{{ end }} {{ end }}
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
{{ "<!-- /footer -->" | safeHTML }} <!-- /footer -->
{{ "<!-- Main Script -->" | safeHTML }} <!-- Main Script -->
{{ $script := resources.Get "js/script.js" | minify}} {{ $script := resources.Get "js/script.js" | minify}}
<script src="{{ $script.Permalink }}"></script> <script src="{{ $script.Permalink }}"></script>

View file

@ -1,25 +1,37 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
{{ hugo.Generator }} {{ hugo.Generator }}
<meta name="description" content="{{ .Title }} - {{ .Site.Title }} "> <meta name="description" content="{{ .Title }} - {{ .Site.Title }} " />
{{ "<!-- ** CSS Plugins Needed for the Project ** -->" | safeHTML }} <!-- ** CSS Plugins Needed for the Project ** -->
<!-- Bootstrap -->
<link
rel="stylesheet"
href="{{ `plugins/bootstrap/bootstrap.min.css` | absURL }}"
/>
{{ "<!-- Bootstrap -->" | safeHTML }} <!-- themefy-icon -->
<link rel="stylesheet" href="{{ `plugins/bootstrap/bootstrap.min.css` | absURL }}"> <link
rel="stylesheet"
href="{{ `plugins/themify-icons/themify-icons.css` | absURL }}"
/>
{{ "<!-- themefy-icon -->" | safeHTML }} <!--Favicon-->
<link rel="stylesheet" href="{{ `plugins/themify-icons/themify-icons.css` | absURL }}"> <link
rel="icon"
href="{{ `images/favicon.png` | absURL }}"
type="image/x-icon"
/>
{{ "<!--Favicon-->" | safeHTML }} <!-- fonts -->
<link rel="icon" href="{{ `images/favicon.png` | absURL }}" type="image/x-icon"> <link
href="https://fonts.googleapis.com/css?family={{replace .Site.Params.font_family ' ' '+' | title}}:300,400,700&display=swap"
rel="stylesheet"
/>
{{ "<!-- fonts -->" | safeHTML }} <!-- PDF.js -->
<link href="https://fonts.googleapis.com/css?family={{replace .Site.Params.font_family ' ' '+' | title}}:300,400,700&display=swap" rel="stylesheet">
{{ "<!-- PDF.js -->" | safeHTML }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.js"></script>
@ -35,59 +47,59 @@
} }
</style> </style>
{{ "<!-- Main Stylesheet -->" | safeHTML }} <!-- Main Stylesheet -->
{{ $css := resources.Get "css/style.css" | minify }} {{ $css := resources.Get "css/style.css" | minify }}
<link href="{{ $css.Permalink }}" rel="stylesheet" media="screen" /> <link href="{{ $css.Permalink }}" rel="stylesheet" media="screen" />
{{ "<!-- ** JS Plugins Needed for the Project ** -->" | safeHTML }} <!-- ** JS Plugins Needed for the Project ** -->
<!-- jquiry -->
{{ "<!-- jquiry -->" | safeHTML }}
<script src="{{ `plugins/jquery/jquery-1.12.4.js` | absURL }}"></script> <script src="{{ `plugins/jquery/jquery-1.12.4.js` | absURL }}"></script>
{{ "<!-- jquary ui -->" | safeHTML }} <!-- jquary ui -->
<script src="{{ `plugins/jquery/jquery-ui.js`| absURL }}"></script> <script src="{{ `plugins/jquery/jquery-ui.js`| absURL }}"></script>
{{ "<!-- Bootstrap JS -->" | safeHTML }} <!-- Bootstrap JS -->
<script src="{{ `plugins/bootstrap/bootstrap.min.js` | absURL }}"></script> <script src="{{ `plugins/bootstrap/bootstrap.min.js` | absURL }}"></script>
{{ "<!-- match-height JS -->" | safeHTML }} <!-- match-height JS -->
<script src="{{ `plugins/match-height/jquery.matchHeight-min.js` | absURL }}"></script> <script src="{{ `plugins/match-height/jquery.matchHeight-min.js` | absURL }}"></script>
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }} {{ if templates.Exists (
printf "partials/overrides/header.html" ) }} {{ partial
{{ if templates.Exists ( printf "partials/overrides/header.html" ) }} "partials/overrides/header.html" . }} {{ else }}
{{ partial "partials/overrides/header.html" . }} <!-- create /layouts/partials/overrides/header.html in your own theme or root directory to add your custom content here -->
{{ else }}
{{ "<!-- create /layouts/partials/overrides/header.html in your own theme or root directory to add your custom content here -->" | safeHTML }}
{{ end }} {{ end }}
<!-- Open Graph image and Twitter Card metadata --> <!-- Open Graph image and Twitter Card metadata -->
{{ $image_path := .Params.image | default site.Params.image }} {{ $image_path := .Params.image | default site.Params.image }} {{
{{ $image_path_local := printf "static/%s" $image_path }} $image_path_local := printf "static/%s" $image_path }} {{ $image_ext := trim
{{ $image_ext := trim (path.Ext $image_path | lower) "." }} (path.Ext $image_path | lower) "." }} {{ if fileExists $image_path_local }}
{{ if fileExists $image_path_local }}
<meta property="og:image" content="{{ $image_path | absURL }}" /> <meta property="og:image" content="{{ $image_path | absURL }}" />
{{ if ne $image_ext "svg" }} {{ if ne $image_ext "svg" }} {{ with (imageConfig $image_path_local) }} {{ if
{{ with (imageConfig $image_path_local) }} (and (gt .Width 144) (gt .Height 144)) }}
{{ if (and (gt .Width 144) (gt .Height 144)) }}
<meta name="twitter:image" content="{{ $image_path | absURL }}" /> <meta name="twitter:image" content="{{ $image_path | absURL }}" />
<meta name="twitter:card" content="summary{{ if (and (gt .Width 300) (gt .Height 157) (not (eq .Width .Height))) }}_large_image{{ end }}"> <meta
name="twitter:card"
content="summary{{ if (and (gt .Width 300) (gt .Height 157) (not (eq .Width .Height))) }}_large_image{{ end }}"
/>
{{ end }} {{ end }}
<meta property="og:image:width" content="{{ .Width }}"> <meta property="og:image:width" content="{{ .Width }}" />
<meta property="og:image:height" content="{{ .Height }}"> <meta property="og:image:height" content="{{ .Height }}" />
{{ end }} {{ end }} {{ end }}
{{ end }} <meta
<meta property="og:image:type" content="image/{{ if eq $image_ext `svg` }}svg+xml{{ else }}{{ replaceRE `^jpg$` `jpeg` $image_ext }}{{ end }}"> property="og:image:type"
content="image/{{ if eq $image_ext `svg` }}svg+xml{{ else }}{{ replaceRE `^jpg$` `jpeg` $image_ext }}{{ end }}"
/>
{{ end }} {{ end }}
<meta name="twitter:title" content="{{ .Title }}" /> <meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/> <meta
{{ with site.Social.twitter }}<meta name="twitter:site" content="@{{ . }}"/>{{ end }} name="twitter:description"
{{ range site.Authors }} content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"
{{ with .twitter }}<meta name="twitter:creator" content="@{{ . }}"/>{{ end }} />
{{ end }} {{ with site.Social.twitter }}
<meta name="twitter:site" content="@{{ . }}" />
{{ template "_internal/opengraph.html" . }} {{ end }} {{ range site.Authors }} {{ with .twitter }}
{{ template "_internal/twitter_cards.html" . }} <meta name="twitter:creator" content="@{{ . }}" />
{{ end }} {{ end }} {{ template "_internal/opengraph.html" . }} {{ template
"_internal/twitter_cards.html" . }}
</head> </head>