parent
2eacb8247b
commit
3a2dab5974
|
@ -3,6 +3,7 @@
|
||||||
## 0.3.3 (unreleased)
|
## 0.3.3 (unreleased)
|
||||||
|
|
||||||
- Fixed config flag in CLI
|
- Fixed config flag in CLI
|
||||||
|
- Sitemap entries are now sorted by permalinks to avoid random ordering
|
||||||
|
|
||||||
|
|
||||||
## 0.3.2 (2018-03-05)
|
## 0.3.2 (2018-03-05)
|
||||||
|
|
|
@ -632,9 +632,7 @@ impl Site {
|
||||||
|
|
||||||
let mut context = Context::new();
|
let mut context = Context::new();
|
||||||
|
|
||||||
context.add(
|
let mut pages = self.pages
|
||||||
"pages",
|
|
||||||
&self.pages
|
|
||||||
.values()
|
.values()
|
||||||
.filter(|p| !p.is_draft())
|
.filter(|p| !p.is_draft())
|
||||||
.map(|p| {
|
.map(|p| {
|
||||||
|
@ -644,15 +642,16 @@ impl Site {
|
||||||
};
|
};
|
||||||
SitemapEntry::new(p.permalink.clone(), date)
|
SitemapEntry::new(p.permalink.clone(), date)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>();
|
||||||
);
|
pages.sort_by(|a, b| a.permalink.cmp(&b.permalink));
|
||||||
context.add(
|
context.add("pages", &pages);
|
||||||
"sections",
|
|
||||||
&self.sections
|
let mut sections = self.sections
|
||||||
.values()
|
.values()
|
||||||
.map(|s| SitemapEntry::new(s.permalink.clone(), None))
|
.map(|s| SitemapEntry::new(s.permalink.clone(), None))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>();
|
||||||
);
|
sections.sort_by(|a, b| a.permalink.cmp(&b.permalink));
|
||||||
|
context.add("sections", §ions);
|
||||||
|
|
||||||
let mut categories = vec![];
|
let mut categories = vec![];
|
||||||
if let Some(ref c) = self.categories {
|
if let Some(ref c) = self.categories {
|
||||||
|
@ -664,6 +663,7 @@ impl Site {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
categories.sort_by(|a, b| a.permalink.cmp(&b.permalink));
|
||||||
context.add("categories", &categories);
|
context.add("categories", &categories);
|
||||||
|
|
||||||
let mut tags = vec![];
|
let mut tags = vec![];
|
||||||
|
@ -676,6 +676,7 @@ impl Site {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tags.sort_by(|a, b| a.permalink.cmp(&b.permalink));
|
||||||
context.add("tags", &tags);
|
context.add("tags", &tags);
|
||||||
context.add("config", &self.config);
|
context.add("config", &self.config);
|
||||||
|
|
||||||
|
|
|
@ -21,3 +21,5 @@ all the variables above are arrays of `SitemapEntry` with the following type:
|
||||||
permalink: String;
|
permalink: String;
|
||||||
date: String?;
|
date: String?;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
All `SitemapEntry` are sorted in each variable by their permalink.
|
||||||
|
|
Loading…
Reference in a new issue