Fix reload with taxonomies
This commit is contained in:
parent
e2c3bb2ce2
commit
aee41f279c
|
@ -10,6 +10,8 @@
|
|||
Tera function
|
||||
- Table of content now strips HTML from the titles to avoid various issues
|
||||
- `gutenberg-anchor` CSS class has been renamed `zola-anchor`
|
||||
- `data` is now a reserved variable name in templates, it is unused right now but
|
||||
might change soon.
|
||||
|
||||
### Others
|
||||
- Many many times faster (x5-x40) for most sites
|
||||
|
|
|
@ -118,6 +118,7 @@ fn delete_element(site: &mut Site, path: &Path, is_section: bool) -> Result<()>
|
|||
}
|
||||
|
||||
site.populate_sections();
|
||||
site.populate_taxonomies()?;
|
||||
// Ensure we have our fn updated so it doesn't contain the permalink(s)/section/page deleted
|
||||
site.register_early_global_fns();
|
||||
site.register_tera_global_fns();
|
||||
|
@ -190,6 +191,7 @@ fn handle_page_editing(site: &mut Site, path: &Path) -> Result<()> {
|
|||
// Updating a page
|
||||
Some(prev) => {
|
||||
site.populate_sections();
|
||||
site.populate_taxonomies()?;
|
||||
|
||||
// Front matter didn't change, only content did
|
||||
if site.library.get_page(&pathbuf).unwrap().meta == prev.meta {
|
||||
|
@ -362,6 +364,7 @@ pub fn after_template_change(site: &mut Site, path: &Path) -> Result<()> {
|
|||
site.render_markdown()?;
|
||||
}
|
||||
site.populate_sections();
|
||||
site.populate_taxonomies()?;
|
||||
site.render_sections()?;
|
||||
site.render_orphan_pages()?;
|
||||
site.render_taxonomies()
|
||||
|
|
|
@ -169,8 +169,11 @@ fn can_build_site_without_live_reload() {
|
|||
assert!(file_exists!(public, "posts/tutorials/devops/index.html"));
|
||||
assert!(file_contains!(public, "posts/tutorials/devops/index.html", "docker"));
|
||||
|
||||
// No tags or categories
|
||||
assert_eq!(file_exists!(public, "categories/index.html"), false);
|
||||
// We do have categories
|
||||
assert_eq!(file_exists!(public, "categories/index.html"), true);
|
||||
assert_eq!(file_exists!(public, "categories/a-category/index.html"), true);
|
||||
assert_eq!(file_exists!(public, "categories/a-category/rss.xml"), true);
|
||||
// But no tags
|
||||
assert_eq!(file_exists!(public, "tags/index.html"), false);
|
||||
|
||||
// Theme files are there
|
||||
|
@ -245,8 +248,11 @@ fn can_build_site_with_live_reload() {
|
|||
assert!(file_exists!(public, "posts/tutorials/programming/index.html"));
|
||||
// TODO: add assertion for syntax highlighting
|
||||
|
||||
// No tags or categories
|
||||
assert_eq!(file_exists!(public, "categories/index.html"), false);
|
||||
// We do have categories
|
||||
assert_eq!(file_exists!(public, "categories/index.html"), true);
|
||||
assert_eq!(file_exists!(public, "categories/a-category/index.html"), true);
|
||||
assert_eq!(file_exists!(public, "categories/a-category/rss.xml"), true);
|
||||
// But no tags
|
||||
assert_eq!(file_exists!(public, "tags/index.html"), false);
|
||||
|
||||
// no live reload code
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
title = "first"
|
||||
weight = 10
|
||||
date = 2017-01-01
|
||||
|
||||
[taxonomies]
|
||||
categories = ["a-category"]
|
||||
+++
|
||||
|
||||
# A title
|
||||
|
|
Loading…
Reference in a new issue