The pulldown_cmark escaping functionality is now shipped in a separate
pulldown_cmark_escape crate
(https://crates.io/crates/pulldown-cmark-escape), starting with v0.10.0.
The markdown.rs module has to be adapted to a few API changes in
pulldown_cmark, and we have to introduce explicit handling of <img> alt
text to ensure it continues to be properly escaped.
There are also a few other behavior changes that are caught by the
tests, but these actually seem to be desired, so I've updated the insta
snapshot files for those tests to incorporate those changes.
Specifically, one footnote-parsing case seems to be handled better now,
and pulldown-cmark's `push_html` now doesn't escape quotes in text nodes
anymore (see https://github.com/pulldown-cmark/pulldown-cmark/pull/836).
* adding optional `lang` arugment to `get_section` global function
* Add handling of default language passed in `lang` argument of `get_section`
* Remove clones for path. Change "?" to an explicit check for error
* lint changes
* Clean up error handling for add_lang_to_path call
* fix format
* Add optional parameter "lang" to get_page template function. Add check for language available in config.
* Modify helper function name from calculate_path to get_path_with_lang. Modify documentation for get_section and get_page to include equivalent calls without using lang argument to demostrate how lang argument effects pathing.
* Remove ensure_directory_exists since it's identical to create_directory, and misleading
* Don't create directories unless needed; rely on create_dir_all instead of manually iterating over components
This fixes a bug introduced in https://github.com/getzola/zola/pull/2258
The issue arose when `output_path` was relative. The request being
served would be canonicalized and this would be a string. So, for
example, if you were serving content from `public` the code
[right after](38199c1255/src/cmd/serve.rs (L144-L147))
the canonicalization checking if
`root.starts_with(original_root)` would always return `false` since
an absolute path, `/some/path/to/content` would never start with a
string like `public`.
* refactor: pattern to separate file
causes a lot of lag and also probably isn't the best to inline since we
have scss preprocessing
* fix: escape quotes properly
* feat: improve header styles
Trying to deploy with the current asdf command gives me this error:
```
23:47:45.659 Executing user command: zola build
23:47:45.899 Building site...
23:47:45.904 Error: Failed to build the site
23:47:45.904 Error: Error parsing templates from the /templates directory
23:47:45.904 Error: Reason: Io error while writing rendered value to output: NotFound
23:47:45.904 Error: Reason: No such file or directory (os error 2)
23:47:45.906 Failed: Error while executing user command. Exited with error code: 1
23:47:45.915 Failed: build command exited with code: 1
23:47:46.837 Failed: error occurred while running build command
```
Changing the command to use the latest version, 0.18.0 fixed this.
The `authors` variable so far has only been documented as something you can define in the front matter for use of feeds, but it also works in templates to define the authors of a page. (For practical use see: 6c293fa1a4 (diff-672b08946ef5cbc8db5c086bf50651b69b29e9d7be0708a1de7ded170b440e99))
This PR adds it to the documentation so that folks don't have to dig in commit histories to figure out it also works in templates.