Configuration for the generation of the sitemap. Here we define some values that are going to be in use for the sitemap files or index files but we cannot add in the individual adds, i.e. hostname.
In addition, we define here some configuration for the maximum number of files, links, news, images, and sizes.
Summary
Functions
Returns a specification to start this module under a supervisor.
Set the configuration from default source. It's first trying to get from system environment variables and if they are not set, then from application configuration.
Let's configure the values of the configuration via the first parameter.
If we pass nil then it's using configure/0. The order of the
configuration is: parameter, or system environment variable, or
configuration from the application.
Get the configuration from the agent where we have it stored.
Set the configuration inside of the agent.
Passing as first parameter a list of tuples, we use set/2 for setting
each pair of key-value data from the overwrite parameter.
Types
@type keys() ::
:max_sitemap_files
| :max_sitemap_links
| :max_sitemap_news
| :max_sitemap_images
| :max_sitemap_file_size
| :host
| :filename
| :public_path
| :files_path
| :verbose
| :compress
| :create_index
@type t() :: %Sitemaps.Config{ compress: boolean(), create_index: boolean(), filename: String.t(), files_path: String.t(), host: String.t(), max_sitemap_file_size: pos_integer(), max_sitemap_files: pos_integer(), max_sitemap_images: pos_integer(), max_sitemap_links: pos_integer(), max_sitemap_news: pos_integer(), public_path: String.t(), verbose: boolean() }
The configuration struct contains the following data:
max_sitemap_files: max sitemap links per index file.max_sitemap_links: max links per sitemap.max_sitemap_news: max news sitemap per index file.max_sitemap_images: max images per URL.max_sitemap_file_size: max sitemap file size in bytes.host: your domain, also host with http/https scheme.filename: name of the sitemap file.public_path: after domain path's location on URL.files_path: generating sitemaps to this directory path.verbose: give more output for each step or not.compress: if the sitemap files and indexes should be compressed.create_index: if we need to create index files or not.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Set the configuration from default source. It's first trying to get from system environment variables and if they are not set, then from application configuration.
Let's configure the values of the configuration via the first parameter.
If we pass nil then it's using configure/0. The order of the
configuration is: parameter, or system environment variable, or
configuration from the application.
The environment variables you can set:
SITEMAPS_MAXFILESfor:max_sitemap_files, default value: 10_000SITEMAPS_MAXLINKSfor:max_sitemap_links, default value: 10_000SITEMAPS_MAXNEWSfor:max_sitemap_news, default value: 1_000SITEMAPS_MAXIMAGESfor:max_sitemap_images, default value: 1_000SITEMAPS_MAXFILESIZEfor:max_sitemap_file_size, default value: 5_000_000SITEMAPS_HOSTfor:host, default value: "http://www.example.com"SITEMAPS_FILENAMEfor:filename, default value: "sitemap"SITEMAPS_SITEMAPS_PATHfor:files_path, default value: "sitemaps/"SITEMAPS_PUBLIC_PATHfor:public_path, default value: "sitemaps/"SITEMAPS_VERBOSEfor:verbose, default value: trueSITEMAPS_COMPRESSfor:compress, default value: trueSITEMAPS_CREATE_INDEXfor:create_index, default value: "auto"
Get the configuration from the agent where we have it stored.
Set the configuration inside of the agent.
Passing as first parameter a list of tuples, we use set/2 for setting
each pair of key-value data from the overwrite parameter.