Skip to content

Commit 4edd2af

Browse files
committed
config + html base changes
- move favicon and description to parameters in config - simplify generation of page title and opengraph titles based on page
1 parent c3c7514 commit 4edd2af

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ baseURL = "https://ethicalsource.dev"
22
languageCode = "en-us"
33
title = "Organization for Ethical Source"
44

5+
[params]
6+
description = "The Organization for Ethical Source is a global, multidisciplinary community devoted to centering justice, equity, and human rights in the practice of open source."
7+
favicon = "/images/favicon.ico"
8+
59
DefaultContentLanguage = "en"
610
hasCJKLanguage = true
711
EnableMissingTranslationPlaceholders = true

layouts/_default/baseof.html

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,31 @@
99
<!doctype html>
1010
<html lang="{{ .Site.LanguageCode }}">
1111
<head>
12-
<meta charset="utf-8">
13-
<title>{{ .Site.Title }} | {{ .Title }}</title>
14-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12+
<title>
13+
{{/* If not home page, add use site title + page title */}}
14+
{{ if ne page.IsHome true }}
15+
{{ .Site.Title }} | {{ .Page.Title }}{{ else }}
16+
{{ .Page.Title }}
17+
{{ end }}
18+
</title>
1519

16-
{{ if .Params.title }}
17-
<meta property="og:title" content="{{ .Params.Title }}">
18-
{{ else }}
19-
<meta property="og:title" content="{{ .Site.Title }}">
20-
{{ end }}
20+
{{/* setup base meta tags */}}
21+
<meta charset="utf-8" />
22+
<meta name="description" content="{{ if .Params.Summary }}{{ .Params.Summary }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
23+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
24+
{{/* setup opengraph meta tags - https://ogp.me/ */}}
25+
<meta property="og:type" content="website">
26+
<meta property="og:site_name" content="Organization for Ethical Source">
27+
<meta property="og:locale" content="en_US">
2128
<meta property="og:image" content="https://ethicalsource.dev/images/oes-logo-color.jpg">
29+
<meta property-="og:title" content="{{ if ne page.IsHome true }}{{ .Site.Title }} | {{ .Page.Title }}{{ else }}{{ .Page.Title }}{{ end }}">
2230
<meta property="og:url" content="{{ .Permalink }}">
23-
{{ if .Params.Summary }}
24-
<meta property="og:description" content="{{ .Params.Summary }}">
25-
{{ else }}
26-
<meta property="og:description" content="The Organization for Ethical Source is a global, multidisciplinary community devoted to centering justice, equity, and human rights in the practice of open source.">
27-
{{ end }}
31+
<meta property="og:description" content="{{ if .Params.Summary }}{{ .Params.Summary }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
2832

33+
{{/* setup link tags for stylesheets and icons */}}
2934
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
30-
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
35+
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon }}" />
36+
<link rel="icon" hreg="{{ .Site.Params.favicon }}">
3137
</head>
3238

3339
<body{{ with .Section }} id="{{ . }}"{{ end }}>

0 commit comments

Comments
 (0)