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

github.com/ineesalmeida/almeida-cv.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Bocheński <bochenski.piotr@gmail.com>2021-09-12 17:52:55 +0300
committerPiotr Bocheński <bochenski.piotr@gmail.com>2021-09-12 17:52:55 +0300
commit2d21e993a8e6beefe3658b1f9910285cacd3f527 (patch)
tree67fd937d3e2778697a1a3647a9c39d9f5460bad6
parente980e7cb3974874113fad0a349203edfd98b828b (diff)
Add support for Meta Tags
Open Graph support included. Signed-off-by: Piotr Bocheński <bochenski.piotr@gmail.com>
-rw-r--r--exampleSite/config.toml6
-rw-r--r--layouts/index.html10
-rw-r--r--layouts/partials/_profile.html2
-rw-r--r--layouts/partials/head.html22
4 files changed, 27 insertions, 13 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 777bb61..b81c5f8 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -1,15 +1,17 @@
languageCode = "en-us"
defaultContentLanguage = "en"
-enableRobotsTXT = "true"
-enableEmoji = "true"
+enableRobotsTXT = true
+enableEmoji = true
theme = "almeida-cv"
disableKinds = ["page", "section", "taxonomy", "term", "RSS", "sitemap"]
baseURL = "https://example.com/"
title = "Example - CV"
+#googleAnalytics = ""
[params]
+enableMetaTags = true
colorLight = "#fff"
colorDark = "#666"
colorPageBackground = "#ddd"
diff --git a/layouts/index.html b/layouts/index.html
index bbec6a2..88b4b76 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,20 +1,18 @@
+{{ $data := or (index .Site.Data .Site.Language.Lang).content .Site.Data.content }}
+{{ .Scratch.Set "data" $data }}
<!DOCTYPE html>
<html lang="en">
{{ partial "head.html" . }}
<body>
<div class="content">
<div class="content__left">
- {{ $data := or (index .Site.Data .Site.Language.Lang).content .Site.Data.content }}
- <h1 class="mainHeading">{{ $data.BasicInfo.FirstName}} <span>{{ $data.BasicInfo.LastName}}</span></h1>
-
+ <h1 class="mainHeading">{{ $data.BasicInfo.FirstName }} <span>{{ $data.BasicInfo.LastName }}</span></h1>
{{ partial "_profile.html" $data }}
{{ partial "_experience.html" $data }}
{{ partial "_education.html" $data }}
{{ partial "_references.html" $data }}
-
</div>
<div class="content__right">
-
{{ partial "_avatar.html" $data }}
{{ partial "_contacts.html" $data }}
{{ partial "_skills.html" $data }}
@@ -24,4 +22,4 @@
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/layouts/partials/_profile.html b/layouts/partials/_profile.html
index c26a099..d97c902 100644
--- a/layouts/partials/_profile.html
+++ b/layouts/partials/_profile.html
@@ -4,7 +4,7 @@
<h2 class="section__title">{{ i18n "profile" }}</h2>
</div>
<div class="section__content">
- <p>{{ .Profile | safeHTML }}</p>
+ <p>{{ .Profile | safeHTML | emojify }}</p>
</div>
</div>
{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 8bd5dd1..9e2a884 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,18 +1,32 @@
+{{ $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | toCSS | minify | fingerprint }}
+{{ $data := .Scratch.Get "data" }}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }}</title>
+ <link rel="canonical" href="{{ .Permalink }}" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
-
- {{- $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen,print" />
- {{- if .Site.GoogleAnalytics }}
+ {{ if .Site.Params.enableMetaTags }}
+ <meta property="og:title" content="{{ .Site.Title }}" />
+ <meta property="og:url" content="{{ .Permalink }}" />
+ <meta property="og:type" content="website" />
+ {{ with $data.BasicInfo.Photo }}
+ <meta property="og:image" content="{{ . | absURL }}" />
+ {{ end }}
+ {{ with $data.Profile | htmlUnescape | emojify | truncate 200 }}
+ <meta property="og:description" content="{{ . }}" />
+ <meta name="description" content="{{ . }}" />
+ {{ end }}
+ {{ end }}
+
+ {{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
- {{- end -}}
+ {{ end }}
</head>