Commit graph

863 commits

Author SHA1 Message Date
Clar Fon
59d70749af Fix shortcode/continue-reading parsing with inline HTML (smaller version) (#2606)
* Fix shortcode/continue-reading parsing with inline HTML (smaller version)

* Remove inline <!-- more -->
2024-08-15 20:19:03 +02:00
Walnut
abc851049d Add config option to ignore code blocks for word count (#2599)
* update docs

* add config option, logic, and tests

* remove config option
2024-08-15 20:19:03 +02:00
Samuel Tardieu
9dad659665 chore(components/config): cleanup code (#2592)
Cleanup code by using `Option::is_some_and()` and
`Option::as_deref()` instead of recoding them.
2024-08-15 20:19:03 +02:00
Samuel Tardieu
9594fa8d06 fix(taxonomies): fix error messages (#2591)
- Some error messages refer to `get_taxonomy_term_by_name` instead of
`get_taxonomy_term`
- If a term cannot be found in a taxonomy, the error message
erroneously pretends that the taxonomy itself is unknown instead of
the term.
2024-08-15 20:19:03 +02:00
Martin Vassor
b3fc3f49cf Add fields to disable sitemap.xml and robots.txt generation (#2579)
* 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
2024-08-15 20:19:03 +02:00
Vincent Prouillet
1cc3ad333a Ensure file exists when receiving events for zola serve
Closes #2563
2024-08-15 20:19:03 +02:00
Vincent Prouillet
96f266e3f8 Ignore Helix temp files 2024-08-15 20:19:03 +02:00
Vincent Prouillet
f8ded09a28 Fix some feed_filenames issues with multi languages 2024-08-15 20:19:03 +02:00
Nikita Karamov
56122defde Fix YAML date parsing (#2549)
* Refine YAML date regex

This commit does a few changes:

- Introduce a new regex
  - it is a bit off-spec (it allows one-digit months and days in date-only mode)
  - uses named groups
  - avoids group duplication
- parses offset once

Fixes #2538

* Fix nanosecond parsing

* Rename variables for brewity

* Add tests
2024-08-15 20:19:03 +02:00
Vincent Prouillet
b97f8a1fe2 Update changelog + add back config.generate_feed in templates for now 2024-06-24 23:03:21 +02:00
Vincent Prouillet
233e1cdcbd Closes #2537 2024-06-24 23:03:21 +02:00
LunarEclipse363
c054ed1b10 Added support for multiple feeds (i.e. generating both Atom and RSS) (#2477)
* 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
2024-06-20 23:15:24 +02:00
Vincent Prouillet
f60bda42f0 Update deps 2024-06-20 23:15:24 +02:00
Andrew Langmeier
ff9622f132 Add support for yaml datetimes (#2208)
* Add support for yaml datetimes

* cargo fmt

* Wire things up; Add more tests

* cargo fmt
2024-06-20 23:15:24 +02:00
Vincent Prouillet
9c1b004b13 Fix tests 2024-06-20 23:15:24 +02:00
endesigner
cb2a4b0ee8 Prevent generating folder & index.html for a specific page 2024-06-20 23:15:24 +02:00
Tanishq
c5991fc814 fix ignore links to #top when checking anchors (#2519)
* fix ignore links to #top when checking anchors

* move logic to check internal links

---------

Co-authored-by: Tanishq <tanishq@levels.fyi>
2024-06-20 23:15:24 +02:00
Connor K
26f6677bfb Add support for Fuse.js search format (#2507)
* 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*
2024-06-20 23:15:24 +02:00
orphen
5b3a57b1ac feat: move from notify v4 to notify-debouncer-full (#2503) 2024-06-20 23:15:24 +02:00
Vincent Prouillet
f480867912 cargo fmt 2024-06-20 23:15:24 +02:00
Vincent Prouillet
f4959bfd7e update tests 2024-06-20 23:15:24 +02:00
Vincent Prouillet
81db65def8 Update deps 2024-06-20 23:15:24 +02:00
Eugene Lomov
6a2b890545 Implemented bottom footnotes with backreferences (#2480)
* 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
2024-06-20 23:15:24 +02:00
Clar Fon
96a9dc1a28 Refactor: remove even more unnecessary create_directory (#2428) 2024-06-20 23:15:24 +02:00
Tanishq
9413d943f1 Fix link check report inconsistency (#2472)
* Fix link check report inconsistency

* Fix formatting issue

---------

Co-authored-by: Tanishq <tanishq@levels.fyi>
2024-06-20 23:15:24 +02:00
Tanishq
6a25b62d43 Fix resizing for images with EXIF orientation (#2468)
* Fix resizing for images with EXIF orientation

* Added test for asymmetric resize for exif images

---------

Co-authored-by: Tanishq <tanishq@levels.fyi>
2024-06-20 23:15:24 +02:00
William Ouwehand
954f1ce533 Fix section transparency serialization (#2462)
Fixes passing section.transparency for
https://github.com/getzola/zola/issues/1840
2024-06-20 23:15:24 +02:00
Clar Fon
aa81986580 Add MIME type to get_image_metadata (#2409) 2024-06-20 23:15:24 +02:00
Timon Van Overveldt
13682e1342 Update pulldown_cmark dep to v0.10, and add pulldown_cmark_escape dep. (#2432)
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).
2024-06-20 23:15:24 +02:00
SumDonkuS
80bcc51fd2 Issue 2359 get section by lang (#2410)
* 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.
2024-06-20 23:15:24 +02:00
Andrew Langmeier
7d18ddfde2 Allow ignoring files when link checking (#2264)
* Allow ignoring files when link checking

* cargo fmt

* Fix tests

* Remove mystery duplicate function..?

* Add in some mysterious missing code..?

* Simple tests for link checker file globs in config

* cargo fmt

* Remove comment

* convert expect to error propagation

* Address comments

* cargo fmt
2024-06-20 23:15:24 +02:00
Clar Fon
bdb18657b6 Refactor: copy_assets instead of copy_asset (#2418) 2024-06-20 23:15:24 +02:00
Clar Fon
7fb0a70477 Refactor: create_directory responsibly (#2407)
* 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
2024-06-20 23:15:24 +02:00
Clar Fon
a01e36bd86 Match <!--more--> in addition to <!-- more --> (#2397)
* Match <!-- more --> without spaces

* Add tests for new <!-- more --> handling, with a note on pulldown-cmark bug
2024-06-20 23:15:24 +02:00
Morgan Creekmore
a9ab3592c8 Add option to include date in search index (#2401) 2024-06-20 23:15:24 +02:00
Sergei Gureev
8ba73749b6 fix: taxonomies missing lang in sitemap (#2373) 2023-12-18 23:24:06 +01:00
Vincent Prouillet
74b06d704d Actually remove code blocks from search index
Closes #2065
2023-12-18 23:24:06 +01:00
Sandor Apati
4e0f9413f6 elasticlunr-rs 3.0.2, hu language support (#2151)
Co-authored-by: Sandor Apati <s.apati@mito.hu>
2023-12-18 23:24:06 +01:00
lauren n. liberda
1349947ed3 ignore kate-swp files (#2353) 2023-12-18 23:24:06 +01:00
Vincent Prouillet
b1f1e64da3 Update deps 2023-12-18 23:24:06 +01:00
Eldred Habert
8fe219a716 Update grass to 0.13 (#2321)
This allows benefitting from some bugfixes (potentially breaking but
better compatibility with the reference Sass impl)
2023-12-18 23:24:06 +01:00
Vincent Prouillet
24304fa9c6 Clippy 2023-12-18 23:24:06 +01:00
Alexander Borsuk
6b0585cf01 Avoid unnecessary checking for already checked links (#2305)
* Fixed "unnecessary mut" warning

* Fixed minor typo

* Use more than 8 threads for links checking if hardware supports it

* Fixed failing azure Linux check

* Avoid unnecessary HTTP requests to the same, already checked links
2023-12-18 23:24:06 +01:00
Óscar
670b88263c fix: suppress highlight language warnings if highlight_code is false (#2287)
The warning about unknown highlight languages was displayed even when
code highlighting was disabled via `markdown.highlight_code = false`.
This commit adds a condition to check this setting before issuing the
warning, effectively suppressing it when code highlighting is disabled.

Issue: #2280
2023-12-18 23:24:06 +01:00
Andrew Langmeier
4430515a02 Add ignored_static to config (#2209)
* Add ignored_static to config

* Make  handle ignored static files correctly

* cargo fmt

* Match on relative path rather than incorrect target path

* path -> partial path for serve static ignore

* remove debug println

* copy static directory if there is no ignored globset

* Update docs

* Deduplicate code with additional Option argument

* cargo fmt
2023-12-18 23:24:06 +01:00
Vincent Prouillet
35aab566f9 Update deps 2023-12-18 23:24:06 +01:00
Sergio A. Vargas
1de1dd56de Add attributes to base_url link in atom template (#2261)
The `rel` and `type` HTML attributes are needed in the `base_url` (or
`section.permalink`) link so feed aggregators know that's the HTML page
that corresponds to the atom feed.

Note: The RSS template doesn't have this issue.
2023-12-18 23:24:06 +01:00
Heitor
a1ac81681b Atom template authors (#2259)
* templates:atom: add support for multiple authors

Atom 1.0 [0] support multiple `<author>` entries in the feed. This commit
modified the template to generate as many `<author>` as the page's
metadata contains.

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements

* Test we can have multiple authors in ATOM feeds
2023-12-18 23:24:06 +01:00
William Ouwehand
c18a0c8031 always sort assets by filename (Windows/Linux difference) (#2236)
* sort page.assets by filename

Uses .to_str() to sort files and subfolders.

The .unwrap() may need work or be replaced by unwrap_or_default(). Given
earlier checks in the function it should work however.

* add tests for assets sorting

* fix rustfmt

* use existing loop instead of windows

* also check the non-recursive test

* use .zip() and add assert msg
2023-12-18 23:24:06 +01:00
TheOnlyMrCat
2532198acb Prevent spans crossing line boundaries in class-based code block formatter (#2237)
* Prevent spans crossing line boundaries in class formatter

* Add snapshot tests for classed highlighting
2023-12-18 23:24:06 +01:00