Skip to content

Instantly share code, notes, and snippets.

@cp-sumi-k
Last active March 22, 2022 11:38
Show Gist options
  • Save cp-sumi-k/5ba030a5bb2095b6cea1a3eccf2233f3 to your computer and use it in GitHub Desktop.
Save cp-sumi-k/5ba030a5bb2095b6cea1a3eccf2233f3 to your computer and use it in GitHub Desktop.
jobsUrl := baseUrl + '/jobs'
// Init all static urls for sitemap
sitemapUrls := []URL{
{Loc: baseUrl, Priority: `1`},
{Loc: jobsUrl , Priority: `1`},
}
// Init all dynamic urls for sitemap
jobs, err := GetJobs()
for i := range jobs {
sitemapUrls = append(sitemapUrls, URL{Loc: jobsUrl + `/` + jobs[i].Id, Priority: `0.9`})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment