Closed Galicz555 closed 7 months ago
The recent update to the sitemap utility involves a modification that allows the GenerateSiteMap
function to adapt its behavior based on the application's environment. It now checks the "WGA_ENV" environment variable to determine if the application is running in a development environment. This information is then used to configure the sitemap generation process, specifically affecting the compression settings and the naming of the sitemap index.
File | Summary |
---|---|
utils/sitemap/main.go |
Introduced isDevelopment initialization from "WGA_ENV" environment variable and adjusted index object creation to use this variable for setting compress and sitemap index name parameters. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?
Introduction of isDevelopment
Variable
The code now uses a new variable called isDevelopment
. This is used to confirm if we are operating in a "development" setting.
Refactoring of index
Variable
The index
variable has been tweaked. Previously, it used a function called app.IsDebug()
to set values for another function NewSitemapIndex
. Now it uses the recently introduced isDevelopment
variable for the same purpose.
Updating index.SetCompress()
Method
The way the index.SetCompress()
method determines if compression should be enabled has been updated. Instead of relying on !app.IsDebug()
, it now uses !isDevelopment
. This change means that compression is enabled only when we're not working in a development environment.
Summary by CodeRabbit