Commit graph

2113 commits

Author SHA1 Message Date
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
105257b21a Update changelog 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
SquirrelHub
8b2b066e64 Add Checking and Force Flag for Directory in Serve Command (#2265)
* Introduce option to force directory when running the serve command

* Update documentation about the force flag on the serve command

* Resolve cargo fmt issue

* Reword new serve flag documentation
2023-12-18 23:24:06 +01:00
Heitor
841b3dfc92 template:feeds: add extra block (#2263)
* template:feeds: add extra block

* add missing >

* Revert "add missing >"

This reverts commit 45c6b9c6eb.

* Revert "template:feeds: add extra block"

This reverts commit 596f7f1e7f.

* Update docs for feed templates
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
Vincent Prouillet
9aa5162659 Update edition 2023-12-18 23:24:06 +01:00
Vincent Prouillet
cf99b5a95f Update changelog 2023-12-18 23:24:06 +01:00
Maksym Vatsyk
208c506ec3 Fix LFI in zola serve (#2258)
* use fs canonicalize to prevent path traversal

* fix cargo fmt
2023-12-18 23:24:06 +01:00
Andrew Langmeier
2cd133b9fb Fixes #2250; Error instead of panic when root directory or config file not present (#2262) 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
sinofp
22dc32a589 Add support for lazy loading images (#2211)
* 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.html
https://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.
2023-12-18 23:24:06 +01:00
Andrew Langmeier
0a9bfa16c2 Hard link serve panic fix (#2210)
* Fix hard link panic and add better error info to std:fs errors

* cargo fmt

* Remove erroneously committed config change

* Remove console import; Use with context to provide additional error info

* improve error wording
2023-12-18 23:24:06 +01:00
Vincent Prouillet
448a941f93 Fix typo in error message 2023-12-18 23:24:06 +01:00
Andrew Langmeier
8e37025729 Add search.index_format into the serialized config (#2165) (#2196)
* Add search into the serialized config (#2165)

* Only expose index_format

* Create config.search struct

* cargo fmt
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
Jeremy Kerr
63054a96d2 templates: add base URL for feed content (#2190)
Relative links in the entry content do not currently have a base URI, so
will be resolved relative to the feed URI:

Given an entry with the content:

    <a href="some-resource.bin">

And URIS of:

 * entry: https://example.org/blog/some-entry/
 * feed:  https://example.org/atom.xml

The link URI will end up as:

    https://example.org/some-resource.bin

rather than the URI that ends up resolved in the rendered page:

   https://example.org/blog/some-entry/some-resource.bin

The atom and RSS formats allow for an xml:base attribute (itself
specified in [1]) to provide a base URI of a subset of a document. This
change adds xml:base attributes to each entry, using the page permalink.

This gives us something equivalent to:

    <entry>
     <content xml:base="https://example.org/blog/some-entry/">
      <![CDATA[
       <a href="some-resource.bin">
      ]]>
     </content>
    </entry>

[1]: https://www.w3.org/TR/xmlbase/

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2023-12-18 23:24:06 +01:00
‏‏Dave
c61e925073 Implement replace_re filter (#2163)
* Implement replace_re filter

* Cargo fmt

* add regex caching

* cargo fmt

* update docs, update unit test

* rename replace_re -> regex_replace
2023-12-18 23:24:06 +01:00
Marcel
c0dd38b234 Speedup "zola check" command by reusing the Client (#2171)
* Reuse Client when checking urls and add timeout for requests
2023-12-18 23:24:06 +01:00
Ever
201d674da1 print error message when no config file found (#2168)
fixed #2195
2023-12-18 23:24:06 +01:00
Vincent Prouillet
18fbbe532a Next version 2023-12-18 23:24:06 +01:00
Vincent Prouillet
d4d0e4b02a Update syntax highlighting recc 2023-12-17 23:47:03 +01:00
Javier Pérez
8276551811
Update syntax-highlighting.md (#2366) 2023-12-09 21:35:57 +01:00
Spencer Scorcelletti
c031cc592c
Update documention for using zola + Cloudflare Pages per advice in https://github.com/cloudflare/pages-build-image/issues/3#issuecomment-1646873666 (#2364) 2023-11-30 23:14:57 +01:00
Vincent Prouillet
2774d4d410
Update themes gallery (#2356)
Co-authored-by: GitHub Action <action@github.com>
2023-11-13 10:29:04 +01:00
Vincent Prouillet
a7ffb3be81
Update themes gallery (#2349)
Co-authored-by: GitHub Action <action@github.com>
2023-11-04 20:03:29 +01:00
One
7d5ce5c230
Document author (#2347)
* Add author to documentation for config.toml

* Add explanation of how author is used for feeds
2023-10-30 19:03:29 +01:00
c-git
152eccc447
Change to updated version of checkout action (#2340) 2023-10-29 19:45:04 +01:00
Olivier Samyn
0b46736aff
Add multi-stage dockerfile build example (#2327)
* Add multi-stage dockerfile build example

* Simplify install instructions, add docker image deployment example
2023-10-21 22:38:17 +02:00
Vincent Prouillet
9097703b51
Update themes gallery (#2322)
Co-authored-by: GitHub Action <action@github.com>
2023-10-18 13:30:26 +02:00
Rik Huijzer
4f9158f6af
docs: show that base_url should contain protocol (#2328) 2023-10-16 08:51:23 +02:00
Grant Handy
6a612ca388
Simple console error message dialog in zola serve webpages (#2312)
* first attempt at injecting HTML into outgoing webpages

* finish error handling

* fix test_site debug line
2023-09-25 09:46:36 +02:00
Vincent Prouillet
a49af5fa48
Update themes gallery (#2309)
Co-authored-by: GitHub Action <action@github.com>
2023-09-22 11:07:16 +02:00
dxvsh
0a8b2b410a
Fix the link to the author's site (#2313) 2023-09-19 21:41:45 +02:00
Peter Todorov
fc98cafe4a
docs: added aws s3 deployment instructions page (#2299)
* docs: added aws s3 deployment instructions page

* docs: fixed a typo in AWS S3 docs
2023-09-13 21:13:06 +02:00
Peter Todorov
7a6ed08ce6
docs: added peterprototypes.com (#2302) 2023-09-12 22:07:13 +02:00
n0xas
97d74b78b7
docs: update gitlab page deployment (#2292)
Co-authored-by: romain dusson <romain.dusson@alterway.fr>
2023-09-06 22:26:38 +02:00
Oscar Dominguez
e5e1a2fdac
docs: update links to new Tera docs URL (#2289)
More context here: https://github.com/Keats/tera/issues/854#issuecomment-1698901568
2023-08-31 14:32:36 +02:00
Alex Rutar
e6fe81cdf3
fix broken link to Tera (#2286) 2023-08-29 22:18:45 +02:00
Steven Roose
49b56c3026
docs: Update installation.md to use --locked (#2284) 2023-08-24 21:08:37 +02:00
Vincent Prouillet
9ae7d15139
Update themes gallery (#2279)
Co-authored-by: GitHub Action <action@github.com>
2023-08-21 17:31:33 +02:00
Vincent Prouillet
e727f43fe0 Fix link to tera 2023-08-20 14:29:06 +02:00
Vincent Prouillet
08c218d22a Add CNAME file 2023-08-20 12:53:41 +02:00