{"id":23151204,"url":"https://github.com/caledoniaproject/gopkg-sitemap","last_synced_at":"2025-04-04T15:14:53.857Z","repository":{"id":268118015,"uuid":"903367100","full_name":"CaledoniaProject/gopkg-sitemap","owner":"CaledoniaProject","description":"Simple and effective golang sitemap generator package","archived":false,"fork":false,"pushed_at":"2024-12-20T13:48:54.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T00:44:19.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CaledoniaProject.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-14T12:27:42.000Z","updated_at":"2024-12-14T23:49:48.000Z","dependencies_parsed_at":"2024-12-14T13:38:53.696Z","dependency_job_id":"40d84d31-9343-491f-94d8-b4f483d7d6a9","html_url":"https://github.com/CaledoniaProject/gopkg-sitemap","commit_stats":null,"previous_names":["caledoniaproject/gopkg-sitemap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaledoniaProject%2Fgopkg-sitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaledoniaProject%2Fgopkg-sitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaledoniaProject%2Fgopkg-sitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaledoniaProject%2Fgopkg-sitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CaledoniaProject","download_url":"https://codeload.github.com/CaledoniaProject/gopkg-sitemap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T18:29:11.723Z","updated_at":"2025-04-04T15:14:53.832Z","avatar_url":"https://github.com/CaledoniaProject.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nOnce again I'm unable to find a suitable sitemap generator, so I created my own package. This one is optimized for memory efficiency and meets most standard requirements.\n\n## Usage example\n\nModule installation\n\n```bash\ngo get github.com/CaledoniaProject/gopkg-sitemap\n```\n\nModule usage\n\n```go\nimport (\n    \"github.com/CaledoniaProject/gopkg-sitemap\"\n)\n\n// your source of sitemap\ntype MyArticle struct {\n    ThumbnailURL []string\n    CanonicalURL string\n    CreatedAt    time.Time\n}\n\n// major function to create sitemap and index file\nfunc WriteSitemap(articles []*MyArticle) error {\n    sg := \u0026sitemap.SitemapGenerator{\n        OutputDirectory: \"/tmp/sitemap\", // where to save these files\n        LinksPerFile:    5000,           // adjust this parameter to avoid search engine limits\n    }\n\n    for _, article := range articles {\n        sitemapURL := \u0026sitemap.SitemapURL{\n            Loc:        article.CanonicalURL,\n            LastMod:    article.CreatedAt,\n            ChangeFreq: sitemap.Daily,\n            Priority:   0.4,\n        }\n\n        for _, thumbnail := range article.ThumbnailURL {\n            sitemapURL.Images = append(sitemapURL.Images, \u0026sitemap.SitemapImage{Loc: thumbnail})\n        }\n\n        if err := sg.AddURL(sitemapURL); err != nil {\n            return err\n        }\n    }\n\n    // the base url of your sitemap, aka where is it hosted\n    return sg.WriteIndex(\"http://cdn.example.com\")\n}\n```\n\nOutput directory structure\n\n```bash\n/var/www/cdn.example.com/sitemap\n- sitemap-index.xml\n- file-1.gz\n- ...\n- file-10.gz\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaledoniaproject%2Fgopkg-sitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaledoniaproject%2Fgopkg-sitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaledoniaproject%2Fgopkg-sitemap/lists"}