From c152bf8cd409cfc04cd4e8b67b07ba35f52fe3d7 Mon Sep 17 00:00:00 2001 From: Anirudh Sudhir Date: Wed, 3 Apr 2024 01:03:21 +0530 Subject: [PATCH] fix: fix paths of robots.txt and sitemap.xml --- cmd/anna/anna.go | 4 +- site/layout/partials/head.html | 48 +++++++++---------- site/static/index.json | 1 - .../engine/render_user_defined/rendered/.html | 1 - test/engine/sitemap/got_sitemap.xml | 6 +-- 5 files changed, 27 insertions(+), 33 deletions(-) delete mode 100644 site/static/index.json diff --git a/cmd/anna/anna.go b/cmd/anna/anna.go index ff768bb..dc943dd 100644 --- a/cmd/anna/anna.go +++ b/cmd/anna/anna.go @@ -44,7 +44,7 @@ func (cmd *Cmd) VanillaRender() { fileSystem := os.DirFS(helpers.SiteDataPath + "content/") p.ParseMDDir(helpers.SiteDataPath+"content/", fileSystem) - p.ParseRobots(helpers.SiteDataPath+"layout/robots.txt", helpers.SiteDataPath+"rendered/layout/robots.txt") + p.ParseRobots(helpers.SiteDataPath+"layout/robots.txt", helpers.SiteDataPath+"rendered/robots.txt") p.ParseLayoutFiles() e.Templates = p.Templates @@ -52,7 +52,7 @@ func (cmd *Cmd) VanillaRender() { e.LayoutConfig = p.LayoutConfig e.Posts = p.Posts - e.GenerateSitemap(helpers.SiteDataPath + "rendered/layout/sitemap.xml") + e.GenerateSitemap(helpers.SiteDataPath + "rendered/sitemap.xml") e.GenerateFeed() e.GenerateJSONIndex(helpers.SiteDataPath) helper.CopyDirectoryContents(helpers.SiteDataPath+"static/", helpers.SiteDataPath+"rendered/static/") diff --git a/site/layout/partials/head.html b/site/layout/partials/head.html index dd174da..62a51ba 100644 --- a/site/layout/partials/head.html +++ b/site/layout/partials/head.html @@ -1,33 +1,29 @@ {{define "head"}} - - - - {{.Frontmatter.Title}} - - - + + + + {{.Frontmatter.Title}} - {{range .Frontmatter.JSFiles}} - - {{end}} {{range .Layout.SiteScripts}} - - {{end}} + + + - - - - - + {{range .Frontmatter.JSFiles}} + + {{end}} {{range .Layout.SiteScripts}} + {{end}} - + + + + + + + + +{{end}} + + \ No newline at end of file diff --git a/site/static/index.json b/site/static/index.json deleted file mode 100644 index 48b4852..0000000 --- a/site/static/index.json +++ /dev/null @@ -1 +0,0 @@ -{"docs.md":{"CompleteURL":"docs.html","FilenameWithoutExtension":"docs","Frontmatter":{"Title":"Anna Documentation","Date":"","Draft":false,"JSFiles":null,"Type":"","Description":"","PreviewImage":"","Tags":null,"Authors":null},"Tags":null},"fireside_anna.md":{"CompleteURL":"posts/fireside_anna.html","FilenameWithoutExtension":"fireside_anna","Frontmatter":{"Title":"Presenting anna at fireside","Date":"2024-04-03","Draft":false,"JSFiles":null,"Type":"post","Description":"Building a static site generator in Go","PreviewImage":"","Tags":["acm","hsp","go","tech","talk","aiep"],"Authors":null},"Tags":["acm","hsp","go","tech","talk","aiep"]},"index.md":{"CompleteURL":"index.html","FilenameWithoutExtension":"index","Frontmatter":{"Title":"Home","Date":"2024-02-24","Draft":false,"JSFiles":null,"Type":"","Description":"homepage for our ssg","PreviewImage":"/static/plane.jpg","Tags":null,"Authors":null},"Tags":null},"lang_test.md":{"CompleteURL":"posts/lang_test.html","FilenameWithoutExtension":"lang_test","Frontmatter":{"Title":"Language Codeblock Test","Date":"2024-02-23","Draft":true,"JSFiles":null,"Type":"post","Description":"","PreviewImage":"","Tags":["rust","C"],"Authors":null},"Tags":["rust","C"]},"markdown_test.md":{"CompleteURL":"posts/markdown_test.html","FilenameWithoutExtension":"markdown_test","Frontmatter":{"Title":"Sample Post","Date":"2024-02-23","Draft":true,"JSFiles":null,"Type":"post","Description":"","PreviewImage":"","Tags":["test-post"],"Authors":null},"Tags":["test-post"]},"week-1.md":{"CompleteURL":"posts/week-1.html","FilenameWithoutExtension":"week-1","Frontmatter":{"Title":"Week-1 Progress","Date":"2024-03-18","Draft":false,"JSFiles":null,"Type":"post","Description":"","PreviewImage":"","Tags":["progress"],"Authors":["Adhesh","Aditya","Anirudh","Nathan"]},"Tags":["progress"]},"week-2.md":{"CompleteURL":"posts/week-2.html","FilenameWithoutExtension":"week-2","Frontmatter":{"Title":"Week-2 Progress","Date":"2024-03-25","Draft":false,"JSFiles":null,"Type":"post","Description":"","PreviewImage":"","Tags":["progress"],"Authors":["Adhesh","Aditya","Anirudh","Nathan"]},"Tags":["progress"]},"week-3.md":{"CompleteURL":"posts/week-3.html","FilenameWithoutExtension":"week-3","Frontmatter":{"Title":"Week-3 Progress","Date":"2024-04-01","Draft":false,"JSFiles":null,"Type":"post","Description":"","PreviewImage":"","Tags":["progress"],"Authors":["Adhesh","Aditya","Anirudh","Nathan"]},"Tags":["progress"]}} \ No newline at end of file diff --git a/test/engine/render_user_defined/rendered/.html b/test/engine/render_user_defined/rendered/.html index 3dd0104..c3dcf98 100644 --- a/test/engine/render_user_defined/rendered/.html +++ b/test/engine/render_user_defined/rendered/.html @@ -8,4 +8,3 @@

Index Page

- diff --git a/test/engine/sitemap/got_sitemap.xml b/test/engine/sitemap/got_sitemap.xml index dc94b5b..03e81a4 100644 --- a/test/engine/sitemap/got_sitemap.xml +++ b/test/engine/sitemap/got_sitemap.xml @@ -1,15 +1,15 @@ - example.org/index.html + example.org/about.html 2024-02-23 - example.org/research.html + example.org/index.html 2024-02-23 - example.org/about.html + example.org/research.html 2024-02-23