-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fields to disable sitemap.xml and robots.txt generation #2579
Conversation
components/config/src/config/mod.rs
Outdated
/// Disable the generation of Sitemap.xml | ||
pub no_sitemap: bool, | ||
/// Disable the generation of robots.txt | ||
pub no_robots: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make those:
generate_sitemap
generate_robots_txt
with a default of true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented (see 63ef902).
…_sitemap (default to true)
components/config/src/config/mod.rs
Outdated
@@ -98,6 +98,10 @@ pub struct Config { | |||
pub markdown: markup::Markdown, | |||
/// All user params set in `[extra]` in the config | |||
pub extra: HashMap<String, Toml>, | |||
/// Disable the generation of Sitemap.xml | |||
pub generate_sitemap: bool, | |||
/// Disable the generation of robots.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update the coomments
generate_sitemap = false | ||
|
||
# When set to "false", robots.txt is not generated (default: true) | ||
generate_robots_txt = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the default in the docs so set them to true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I didn't look carefully at the docs. It should be correct by now.
…xt), now that the default is true and false is needed to disable
Thanks! |
…2579) * Add feature to disable robots.txt and sitemap.xml from the config file. Addresses feature request getzola#2248 * Add documentation for no_sitemap & no_robots * Rename no_robots and no_sitemap into generate_robots_txt and generate_sitemap (default to true) * fix rustfmt issues * Change documentation to show defaults * Update documentation for the fields generate_sitemaps (resp. robots_txt), now that the default is true and false is needed to disable
* Add feature to disable robots.txt and sitemap.xml from the config file. Addresses feature request #2248 * Add documentation for no_sitemap & no_robots * Rename no_robots and no_sitemap into generate_robots_txt and generate_sitemap (default to true) * fix rustfmt issues * Change documentation to show defaults * Update documentation for the fields generate_sitemaps (resp. robots_txt), now that the default is true and false is needed to disable
…2579) * Add feature to disable robots.txt and sitemap.xml from the config file. Addresses feature request getzola#2248 * Add documentation for no_sitemap & no_robots * Rename no_robots and no_sitemap into generate_robots_txt and generate_sitemap (default to true) * fix rustfmt issues * Change documentation to show defaults * Update documentation for the fields generate_sitemaps (resp. robots_txt), now that the default is true and false is needed to disable
Addresses feature request #2248
this simply adds two fields in
config.toml
, one fieldno_sitemap
, which disable the generation ofsitemap.xml
if set, and one fieldno_robots
, which disable the generation ofno_robots.txt
if set.IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
This feature is discussed in #2248 "We could make it a config.toml option." (Keats, July 2023) -> This is exactly what this PR implements
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: