From 84d4abe7d1d2feec810dad856e96f40702b2e623 Mon Sep 17 00:00:00 2001 From: Sumita Canopas Date: Wed, 24 Jan 2024 10:52:50 +0530 Subject: [PATCH] Fix sitemap api --- main.go | 1 + sitemap/sitemap.go | 2 +- sitemap/sitemap_test.go | 1 + {nuxt-frontend/public => sitemap/templates}/path.txt | 0 templates/path.txt | 12 ++++++++++++ 5 files changed, 15 insertions(+), 1 deletion(-) rename {nuxt-frontend/public => sitemap/templates}/path.txt (100%) create mode 100644 templates/path.txt diff --git a/main.go b/main.go index 8e888d8f5..558bf6557 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ import ( ) //go:embed templates/*.html +//go:embed templates/*.txt var templateFS embed.FS var router *gin.Engine diff --git a/sitemap/sitemap.go b/sitemap/sitemap.go index 6aac4596b..3ffce337f 100755 --- a/sitemap/sitemap.go +++ b/sitemap/sitemap.go @@ -80,7 +80,7 @@ func (repository *SitemapRepository) GenerateSitemap(c *gin.Context) { {Loc: baseUrl, Priority: `1`}, } - filePath := ".output/public/path.txt" + filePath := "templates/path.txt" sitemapUrls, err := repository.addPages(baseUrl, sitemapUrls, filePath) if err != nil { log.Error(err) diff --git a/sitemap/sitemap_test.go b/sitemap/sitemap_test.go index 75ad586b3..c671a9528 100644 --- a/sitemap/sitemap_test.go +++ b/sitemap/sitemap_test.go @@ -17,6 +17,7 @@ import ( ) //go:embed templates/career-email-template.html +//go:embed templates/path.txt var templateFS embed.FS var repo *SitemapRepository diff --git a/nuxt-frontend/public/path.txt b/sitemap/templates/path.txt similarity index 100% rename from nuxt-frontend/public/path.txt rename to sitemap/templates/path.txt diff --git a/templates/path.txt b/templates/path.txt new file mode 100644 index 000000000..6d7f0ab5e --- /dev/null +++ b/templates/path.txt @@ -0,0 +1,12 @@ +services +portfolio +contributions +resources +about +contact +android-app-development +ios-app-development +mobile-app-development +thank-you +jobs/thank-you +unsubscribe \ No newline at end of file