From 67215cf9211602893b2aecb0c5cc52a4eab229b7 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Sun, 3 Dec 2023 23:16:18 +0200 Subject: [PATCH] Default title if YAML .meta.title is empty --- data/{resume.yaml => resume.yaml.default} | 10 +++++----- templates/metatag.html | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) rename data/{resume.yaml => resume.yaml.default} (66%) diff --git a/data/resume.yaml b/data/resume.yaml.default similarity index 66% rename from data/resume.yaml rename to data/resume.yaml.default index 6c89897..1137dce 100644 --- a/data/resume.yaml +++ b/data/resume.yaml.default @@ -7,15 +7,15 @@ meta: language: "en-EN" author: "Job Applicant" theme-color: "#bd93f9" - title: "Go-Resume - dynamic resume" - description: "Software Developer" - favicon: "" + ## Set the page title (shown in the browser tab). If empty, "Name - Title" from profile will be used + title: + description: "Professional employee" theme: "dark" profile: name: "Job Applicant" - title: "Software Developer" + title: "Professional employee" city: "Oulu, Finland" phone: "+358 xx xxx xxxx" email: "iwannajob@email.com" - photo: "path-or-url-to-avatar" + photo: "https://url.to/profile/photo" socials: [] \ No newline at end of file diff --git a/templates/metatag.html b/templates/metatag.html index d0802cc..7137bf4 100644 --- a/templates/metatag.html +++ b/templates/metatag.html @@ -10,7 +10,13 @@ -{{ .Profile.Name }} - {{ .Profile.Title }} + + {{ if .Meta.Title }} + {{ .Meta.Title }} + {{ else }} + {{ .Profile.Name }} - {{ .Profile.Title }} + {{ end }} +