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

Sections in sitemaps don't get their [extra] #842

Closed
Keats opened this issue Nov 11, 2019 · 1 comment
Closed

Sections in sitemaps don't get their [extra] #842

Keats opened this issue Nov 11, 2019 · 1 comment
Labels
bug done in pr Already done in a PR

Comments

@Keats
Copy link
Collaborator

Keats commented Nov 11, 2019

https://zola.discourse.group/t/sitemap-xml-no-extra-access-for-sections/240/2

Very easy to fix if someone wants to get a first try at Zola!

@stanistan
Copy link
Contributor

stanistan commented Nov 22, 2019

👋 Hi, I'd like to take this on as a first issue... I'm assuming it starting here?

diff --git a/components/site/src/sitemap.rs b/components/site/src/sitemap.rs
index 72152f7..345cfb6 100644
--- a/components/site/src/sitemap.rs
+++ b/components/site/src/sitemap.rs
@@ -77,7 +77,11 @@ pub fn find_entries<'a>(
         .sections_values()
         .iter()
         .filter(|s| s.meta.render)
-        .map(|s| SitemapEntry::new(Cow::Borrowed(&s.permalink), None))
+        .map(|s| {
+            let mut entry = SitemapEntry::new(Cow::Borrowed(&s.permalink), None)
+            entry.add_extra(&s.meta.extra);
+            entry
+        })
         .collect::<Vec<_>>();
 
     for section in library.sections_values().iter().filter(|s| s.meta.paginate_by.is_some()) {

I can open up a PR for this...

Update: I see there's a bit more going on there :)

@Keats Keats added done in pr Already done in a PR and removed good first issue help wanted labels Dec 3, 2019
@Keats Keats closed this as completed Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants