Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyoze Fernández <ayoze@ayozefernandez.com>2020-08-06 18:50:20 +0300
committerGitHub <noreply@github.com>2020-08-06 18:50:20 +0300
commit5f48a5bacb8a13cecaef5b9d9fa7efe25d860f79 (patch)
treeb01f4f209cd933fc91dc364668d42ec85aafd15e
parent629c7196a32c989b0bd0df731d2812be44c00a10 (diff)
added support for the meta description tag (#57)
* added support for the meta description tag * Update meta description logic for single page Co-authored-by: hossainemruz <emruz@appscode.com>
-rw-r--r--README.md5
-rw-r--r--exampleSite/config.yaml5
-rw-r--r--layouts/_default/single.html11
-rw-r--r--layouts/index.html1
4 files changed, 15 insertions, 7 deletions
diff --git a/README.md b/README.md
index b1bf66c..001956e 100644
--- a/README.md
+++ b/README.md
@@ -75,9 +75,12 @@ enableEmoji: true
# Custom parameters
params:
- # copyright
+ # Copyright Notice
copyright: © 2020 Copyright.
+ # Meta description for your site. This will help the search engines to find your site.
+ description: Portfolio and personal blog of Jane Doe.
+
# background image of the landing page
background: "images/background.jpg"
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index ae42c45..f325cfb 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -24,9 +24,12 @@ enableEmoji: true
# Custom parameters
params:
- # copyright
+ # Copyright Notice
copyright: © 2020 Copyright.
+ # Meta description for your site. This will help the search engines to find your site.
+ description: Portfolio and personal blog of Jane Doe.
+
# background image of the landing page
background: "images/background.jpg"
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index bf1304b..d527b79 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,4 +1,5 @@
{{ define "header" }}
+<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Title }}{{ end }}" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
@@ -36,7 +37,7 @@
<!--Hero Area-->
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" .Site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'>
</div>
-
+
<!--Content Start-->
<div class="page-content">
<div class="author-profile ml-auto align-self-lg-center">
@@ -44,15 +45,15 @@
<h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
<p>{{ .Page.Date.Format "January 2, 2006" }}</p>
</div>
-
+
<div class="title">
<h1>{{ .Page.Title }}</h1>
</div>
-
+
<div class="post-content" id="post-content">
{{ .Page.Content }}
</div>
-
+
<!--- Improve this page button --->
{{ if .Site.Params.GitRepo }}
<div class="btn-improve-page">
@@ -62,7 +63,7 @@
</a>
</div>
{{ end }}
-
+
<!---Next and Previous Navigator -->
<hr />
{{ partial "navigators/next-prev-navigator.html" . }}
diff --git a/layouts/index.html b/layouts/index.html
index dc93e8c..d2de694 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<title>{{- .Site.Title -}}</title>
+ <meta name="description" content="{{ .Site.Params.description }}" />
<!-- import common headers -->
{{- partial "header.html" . -}}