* 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
* Added support for multiple feeds
* Implemented backwards-compatibility for feed config
* Added a test for feed config backwards-compat, fixed bugs
- Fixed language config merge bug found by a test
- Adjusted two existing tests to fully check stuff related to multiple feeds
- Added a new test for backwards-compatibility of the changes
- Fixed bugs found by the newly added test
* Renamed MightBeSingle to SingleOrVec
* Made the multiple feeds config changes "loudly" backwards-incompatible
* added #[serde(deny_unknown_fields)] to front-matter, fixed problems this found in tests
* inital "just barely works" Fuse.js support
* implement FuseJavascript; refactor index_for_lang
* support search config
* move fuse index building to it's own file
* update doc of Search.index_format
* update config docs
* update search documentation
* use &str where possible
* use libs::serde_json
remmeber to commit Cargo.lock
* move extension logic to IndexFormat
* move the entire filename logic inside IndexFormat
* move elasticlunr to it's own module
* only create elasticlunr.min.js if we're actually using elasticlunr
* move ELASTICLUNR_JS to elasticlunr.js
* hide the details of search's submodules
* optionally include path
* explain include_path better
* remove references to stork
* replace if with match
* support include_description
* specify "permalink"
* move body cleaning and truncation to a function
* update truncate_content_length docs to specify *code points*
* Implemented bottom footnotes with backreferences
Fixes#1285
* Added bottom_footnotes option to configuration.md
* Renamed fix_github_style_footnotes()
* Added tests for convert_footnotes_to_github_style()
* Changed test to plain html instead of Vec<Event>
* Added integration test for footnotes
* Applied suggested changes
* Add optional decoding="async" loading="lazy" for img
In theory, they can make the page load faster and show content faster.
There’s one problem: CommonMark allows arbitrary inline elements in alt text.
If I want to get the correct alt text, I need to match every inline event.
I think most people will only use plain text, so I only match Event::Text.
* Add very basic test for img
This is the reason why we should use plain text when lazy_async_image is enabled.
* Explain lazy_async_image in documentation
* Add test with empty alt and special characters
I totaly forgot one can leave the alt text empty.
I thought I need to eliminate the alt attribute in that case,
but actually empty alt text is better than not having an alt attribute at all:
https://www.w3.org/TR/WCAG20-TECHS/H67.htmlhttps://www.boia.org/blog/images-that-dont-need-alternative-text-still-need-alt-attributes
Thus I will leave the empty alt text.
Another test is added to ensure alt text is properly escaped.
I will remove the redundant escaping code after this commit.
* Remove manually escaping alt text
After removing the if-else inside the arm of Event::Text(text),
the alt text is still escaped.
Indeed they are redundant.
* Use insta for snapshot testing
`cargo insta review` looks cool!
I wanted to dedup the cases variable,
but my Rust skill is not good enough to declare a global vector.
The W3C feed validator fails to validate RSS 2.0 and Atom 1.0 feed
elements that do not contain a valid author. This change adds an
`authors: Vec<String>` to pages, as well as an `author: Option<String>`
to Config that will act as a default to use in RSS and Atom templates if
no page-level authors are specified.
* search: Add support for a JSON index
* docs: Document JSON index for search
* docs: Use lazy-loaded JSON index
* Add elasticlunr prefix to search engine format configuration
This will be useful if support for more search libraries are added in the future
* add external_level and internal_level
* remove unnecessary debug derive on LinkDef
* clarify doc comment about link check levels
* simplify link checker logging
* add missing warn prefix
* simplify link level logging, remove "Level" from linklevel variants
* remove link level config from test site
* switch back to using bail! from get_link_domain
* move console's deps to libs
* remove unnecessary reference
* calling console::error/warn directly
* emit one error, or one warning, per link checker run
* various link checker level changes
* add docs about link checker levels
* remove accidentally committed test site
* remove completed TODO
* Make sure that zola serve/build can start from anywhere inside dir tree
* make clippy and rustfmt a bit happier
* replace unecessary if-else with unwrap_or and display which path could not get canonicalized if it fails at startup
* canonicalize config_path to avoid crash when config.toml changes
* Make ignored_content work with directories
Just had to remove strip_prefix(path) from file ignore code.
Added tests for subdirectory globbing.
* Add documentation
* add more tests
to confim that simple filename globs still match paths
without strip_prefix
Currently, init_extra_syntaxtes_and_highlight_themes will supress
loading anything if highlight_theme is "css". This makes sense for the
highlight themes, but will also skip loading any extra syntax
definitions too.
This change defers the theme = css check, so we still load syntaxes in
this case.
Fixes: #1723
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
* Add heuristic checking for HTML anchors
Previously only anchors specified or generated in markdown could be
linked to, without complaint from the link checker. We now use a
simple heuristic check for `name` or `id` attributes.
Duplicate code has been refactored and all XML anchor checks updated
to use regex rather than substring match.
* Fix regexp and refactor
* Next version
* Added tests for shortcode insertion
* Added TOC tests
* Added test for #1475 and #1355
* Basic internal / external links tests
* Added integration test
* Added pseudocode and started on logos
* Logos parsing for shortcodes
* Fixed string literal parsing
Moved string literal parsing to a new lexer in order to have greater
control of control characters which are parsed. This fixes the bug that
was present in the `string_from_quoted` function and also moves the
`QuoteType` to be in the `ArgValueToken`.
* Moved string literal logic to seperate module
* Added square bracket notation for variables
* Error handling rewritten
Remove the Result from the `fetch_shortcodes` function. Added proper
messages within the internal parsing.
* Reorganized and documented the shortcode submodule
* Added all logic for ShortcodeContext spans
* Added working insertion code for MD files
* Made functions generic over Markdown or HTML
* Add check for embedding bodies
* Structure of main function clear
* Added test for `new_with_transforms` function
* It runs!
* Added the code for handling p-ed html shortcodes
* Removed placeholders in markdown function
* Adjusted integration tests
* fetch_shortcodes now also returns a string
* Start of HTML insertion
* Kinda working everything
* Loading of shortcodes and builtins
* Fix tests
* Some missed fixes
* Tweaks + fmt
* Remove string literal handling
* Fix benches
* Grab shortcode def only once per site
* Fix benches
* Rewrite of parser
* Fix tests
* Add test for #1655
* Re-enable integration test
* Add test for #1601
* Add test for #1600
* Add test for #1500
* Add test for #1320
* Fix test on windows?
Co-authored-by: Gijs Burghoorn <g.burghoorn@gmail.com>
* Add class based syntax higlighting + line numbers
* Use fork of syntect for now
* Fix tests
* Fix diff background on inline highlighter
Co-authored-by: evan-brass <evan-brass@protonmail.com>