From 862ff8e546a5b927f7cf21d745f3db8d28bae960 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Sat, 11 Jan 2025 23:08:39 -0600 Subject: [PATCH] Fixed formatting and added description --- content/welcome.md | 1 + lib/markdown.go | 7 ++++--- pages/post.go | 18 ++++++++++-------- pages/templates/home.html | 6 +++++- pages/templates/layouts/base.html | 2 +- pages/templates/layouts/post.html | 4 ++-- pages/templates/papers.html | 6 +++++- pages/templates/partials/header.html | 2 +- pages/templates/post.html | 10 +++++++--- pages/templates/posts.html | 10 +++++++--- pages/templates/projects.html | 6 +++++- pages/templates/talks.html | 6 +++++- pages/templates/tools.html | 6 +++++- pages/templates/tools.resize.html | 8 ++++++-- pages/templates/tools.ssedemo.html | 12 +++++++++--- 15 files changed, 73 insertions(+), 31 deletions(-) diff --git a/content/welcome.md b/content/welcome.md index 6e7d475..f8b46e9 100644 --- a/content/welcome.md +++ b/content/welcome.md @@ -1,5 +1,6 @@ --- name: "Welcome!" +description: "Welcome to my website!" date: "October 20 2024" tags: ["welcome"] --- diff --git a/lib/markdown.go b/lib/markdown.go index afe4f72..a700125 100644 --- a/lib/markdown.go +++ b/lib/markdown.go @@ -13,9 +13,10 @@ import ( ) type FrontMatter struct { - Name string - Date string - Tags []string + Name string + Description string + Date string + Tags []string } func ExtractFrontMatter(file fs.DirEntry, contentFS fs.FS) (CardLink, error) { diff --git a/pages/post.go b/pages/post.go index a8a5047..151804e 100644 --- a/pages/post.go +++ b/pages/post.go @@ -16,10 +16,11 @@ import ( ) type PostProps struct { - Content template.HTML - Name string - Date string - Tags []string + Content template.HTML + Name string + Description string + Date string + Tags []string } func Post(c echo.Context) error { @@ -64,10 +65,11 @@ func Post(c echo.Context) error { } props := PostProps{ - Content: template.HTML(buf.String()), - Name: frontmatter.Name, - Date: frontmatter.Date, - Tags: frontmatter.Tags, + Content: template.HTML(buf.String()), + Name: frontmatter.Name, + Description: frontmatter.Description, + Date: frontmatter.Date, + Tags: frontmatter.Tags, } // Specify the partials used by this page diff --git a/pages/templates/home.html b/pages/templates/home.html index d58cd3d..7f9448f 100644 --- a/pages/templates/home.html +++ b/pages/templates/home.html @@ -2,7 +2,11 @@ Atridad Lahiji // Root {{end}} -{{define "headercontent"}} +{{define "description"}} +Researcher, Full-Stack Developer, and IT Professional. +{{end}} + +{{define "navcontent"}} Atridad Lahiji // Root {{end}} diff --git a/pages/templates/layouts/base.html b/pages/templates/layouts/base.html index d91b021..4d25e6b 100644 --- a/pages/templates/layouts/base.html +++ b/pages/templates/layouts/base.html @@ -6,7 +6,7 @@ {{template "title" .}} - + {{template "head" .}} diff --git a/pages/templates/layouts/post.html b/pages/templates/layouts/post.html index cc8cb78..1601495 100644 --- a/pages/templates/layouts/post.html +++ b/pages/templates/layouts/post.html @@ -5,8 +5,8 @@ - {{.Name}} - + {{template "title" .}} + {{template "head" .}} diff --git a/pages/templates/papers.html b/pages/templates/papers.html index a13e2b1..e8ba780 100644 --- a/pages/templates/papers.html +++ b/pages/templates/papers.html @@ -2,7 +2,11 @@ Atridad Lahiji // Papers {{end}} -{{define "headercontent"}} +{{define "description"}} +Papers I've Written +{{end}} + +{{define "navcontent"}} Atridad Lahiji // Papers {{end}} diff --git a/pages/templates/partials/header.html b/pages/templates/partials/header.html index a037feb..5c4717a 100644 --- a/pages/templates/partials/header.html +++ b/pages/templates/partials/header.html @@ -1,7 +1,7 @@ {{define "header"}}