Skip to content

Commit

Permalink
added support for the meta description tag (#57)
Browse files Browse the repository at this point in the history
* added support for the meta description tag

* Update meta description logic for single page

Co-authored-by: hossainemruz <emruz@appscode.com>
  • Loading branch information
ay0o and hossainemruz committed Aug 6, 2020
1 parent 629c719 commit 5f48a5b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion exampleSite/config.yaml
Expand Up @@ -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"

Expand Down
11 changes: 6 additions & 5 deletions 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"
Expand Down Expand Up @@ -36,23 +37,23 @@
<!--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">
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}'/>
<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">
Expand All @@ -62,7 +63,7 @@ <h1>{{ .Page.Title }}</h1>
</a>
</div>
{{ end }}

<!---Next and Previous Navigator -->
<hr />
{{ partial "navigators/next-prev-navigator.html" . }}
Expand Down
1 change: 1 addition & 0 deletions layouts/index.html
Expand Up @@ -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" . -}}

Expand Down

0 comments on commit 5f48a5b

Please sign in to comment.