Skip to content
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

Merged
merged 6 commits into from
Jul 25, 2024

Conversation

Bromind
Copy link
Contributor

@Bromind Bromind commented Jul 19, 2024

Addresses feature request #2248

this simply adds two fields in config.toml, one field no_sitemap, which disable the generation of sitemap.xml if set, and one field no_robots, which disable the generation of no_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:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@Bromind Bromind changed the title No sitemap no robots Add fields to disable sitemap.xml and robots.txt generation Jul 19, 2024
/// Disable the generation of Sitemap.xml
pub no_sitemap: bool,
/// Disable the generation of robots.txt
pub no_robots: bool,
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented (see 63ef902).

@Bromind Bromind requested a review from Keats July 21, 2024 21:04
@@ -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
Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@Bromind Bromind requested a review from Keats July 23, 2024 23:27
@Keats Keats merged commit fa44229 into getzola:next Jul 25, 2024
5 checks passed
@Keats
Copy link
Collaborator

Keats commented Jul 25, 2024

Thanks!

reujab pushed a commit to reujab/zola that referenced this pull request Aug 14, 2024
…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
Keats pushed a commit that referenced this pull request Aug 15, 2024
* 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
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants