Commit graph

372 commits

Author SHA1 Message Date
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
f8ded09a28 Fix some feed_filenames issues with multi languages 2024-08-15 20:19:03 +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
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
f4959bfd7e update tests 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
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
Sergei Gureev
8ba73749b6 fix: taxonomies missing lang in sitemap (#2373) 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
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
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
Vincent Prouillet
448a941f93 Fix typo in error message 2023-12-18 23:24:06 +01:00
Jake G
d72ebb1bdb Fix multi-lingual json index (#2197)
* Fix multi-ligual json index

* multi-lingual search Fix cargo fmt
2023-12-18 23:24:06 +01:00
Vincent Prouillet
deaaa16017 Fix tests 2023-03-19 20:36:25 +01:00
François
dd65e99300 Fix index errors (#2129)
* consider sections by path instead of by component

* add tests

* update more tests
2023-03-19 20:36:25 +01:00
Felix Zwettler
5ad9f84a81 fix zola serve not respecting preserve_dotfiles_in_output (#2113)
* fix `zola serve` not  respecting `preserve_dotfiles_in_output`
2023-02-24 22:20:26 +01:00
Vincent Prouillet
c67655e29f Fix colocated assets in content directory
Closes #2101
2023-02-24 22:20:26 +01:00
Kartavya Vashishtha
3e1f5777f1 feat: External URL redirect (#2080) 2023-02-16 20:49:03 +01:00
Seth Morabito
f4a1e99b98 Page and config authors (#2024) (#2092)
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.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
ee4cbb649a Handle pages named index.md in sections
Closes #2082
2023-02-16 20:49:03 +01:00
Orson Peters
84d057fa1e Reduced cachebust fingerprint to be more reasonable (#2074)
* Reduced cachebust fingerprint to be more reasonable.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
608837cddf Clippy + 1.63 2023-02-16 20:49:03 +01:00
Vincent Prouillet
e12b766e2c Fmt + change min version 2023-02-16 20:49:03 +01:00
Vincent Prouillet
fcbb21abca Replace libsass by grass
Closes #1535
Closes #2022
2023-02-16 20:49:03 +01:00
Felix Zwettler
d0b80654d1 add preserve_dotfiles_in_output configuration option (#1985) 2023-02-16 20:49:03 +01:00
Sosthène Guédon
3430d948f7 Fix needless_borrow warnings 2023-02-16 20:49:03 +01:00
Sosthène Guédon
f877835ed3 Site: fix clippy warnings 2023-02-16 20:49:03 +01:00
Sosthène Guédon
faf00d1047 Fix clippy::derive_partial_eq_without_eq 2023-02-16 20:49:03 +01:00
Soso
405dda6722 Cargo fmt (#2009)
* Run cargo fmt

* Add cargo fmt --check to pipeline
2023-02-16 20:49:03 +01:00
Sosthene
7000f787b3 Search json index (#1998)
* 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
2023-02-16 20:49:03 +01:00
Jeremy Barbosa
bedc6d7148 Minify embedded css and js with additional lib flags (#1922) 2023-02-16 20:49:03 +01:00
n-tux-tmp
baa473ceea add get_hash function (#1962)
Co-authored-by: Newbyte <newbie13xd@gmail.com>
Co-authored-by: n-tux-tmp <n-tux-tmp@example.com>
Co-authored-by: n-tux-tmp <n-tux-tmp@noreply.example.org>
2023-02-16 20:49:03 +01:00
Eric Scouten
5fb0867b3a Get term fn (#1964)
* Add new `get_taxonomy_term` global function

* Update per @Keats feedback to make `page_count` available all the time.
2023-02-16 20:49:03 +01:00
Vincent Prouillet
584de3adaf Remove logging 2022-08-14 16:08:48 +02:00
Nick Darnell
3fde41b6e5 The Glob library does not work correctly on windows. This changes the approach to use the normal WalkDir crate, and the Globset crate instead to find the filter. This new code correctly compiles sass files across platforms now. (#1950) 2022-08-14 16:08:48 +02:00
Tristam MacDonald
93d61cdf72 remove string manipulation of paths (#1941)
* remove string manipulation of paths
2022-08-14 16:08:48 +02:00
Vincent Prouillet
3fa855267e Ensure homepages get their translations filled 2022-07-15 18:00:55 +02:00
Vincent Prouillet
0d4c2e813f Fix some bugs + cargo fmt 2022-07-12 00:09:38 +02:00
Vincent Prouillet
bf7dbfeaae Update pinned rustc version 2022-07-10 16:54:00 +02:00
Vincent Prouillet
342569a92a Update deps 2022-07-10 16:31:09 +02:00