Merge pull request #17 from b0ch3nski/feature/metatags

Meta Tags
This commit is contained in:
Inês Almeida 2021-09-24 18:54:17 +01:00 committed by GitHub
commit 0d7f29c2bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 13 deletions

10
.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
# OS
.DS_Store
._*
# IDE
.idea/
.vscode/
.settings/
*.subliime-workspace
*.sublime-project

2
exampleSite/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
public/
resources/

View file

@ -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"

View file

@ -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>
</html>

View file

@ -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 }}

View file

@ -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>