Commit graph

850 commits

Author SHA1 Message Date
Vincent Prouillet
b2eb00a374 Ensure lang is always set on default sections 2020-04-12 19:17:29 +02:00
Vincent Prouillet
56e25132a9 Update deps + fix some misleading doc 2020-04-12 17:21:04 +02:00
Yusuke Tanaka
e3cb4ff0ea
Preserve timestamps when copying files (#974) (#983)
* Preserve timestamps when copying files (#974)

* Do not copy files with the same modification timestamps

* Clean temp dbg!

* Add filesize comparison
2020-04-04 11:05:24 +02:00
Gaëtan Caillaut
16a22e76fa Fail if a language is set both in config.default_languages and config.languages 2020-03-31 02:15:58 +02:00
Vincent Prouillet
01597adfd2 Pass lang to taxonomy list template
Closes #963
2020-03-25 20:05:10 +01:00
Vincent Prouillet
91bf91a88b Fix link checker not checking for capital id/name
Closes #948
2020-03-25 19:54:24 +01:00
Vincent Prouillet
2eb8dcdf87 Revert "Fix RSS template (#969)"
This reverts commit 4b0339377f.
2020-03-12 20:44:41 +01:00
Andrew Barchuk
4b0339377f
Fix RSS template (#969)
Remove a link tag mistakenly imported from Atom XML namespace. The tag
was used to specify the link to the feed itself which is not supported
by RSS 2.0:
https://cyber.harvard.edu/rss/rss.html

Fixes #967
2020-03-12 20:31:29 +01:00
Vincent Prouillet
457996046c Update deps and changelog 2020-03-12 18:44:31 +01:00
Vincent Prouillet
2eaa791349 Enable strikethrough in markdown filter 2020-02-28 08:17:01 +01:00
Luke Hsiao
661bd9c0fa Set default user agent for external requests
Many servers will return errors (e.g. 400/403) to requests that do not
set a User-Agent header. This results in issues in both the link_checker
and load_data components. With the link_checker these are false positive
dead links. In load_data, remote data fails to be fetched. To mitigate
this issue, this sets a default User-Agent of

    $CARGO_PKG_NAME/$CARGO_PKG_VERSION

Note that the root cause of this regression from zola v0.9.0 is that
reqwest 0.10 changed their default behavior and no longer sets a
User-Agent by default:

    https://github.com/seanmonstar/reqwest/pull/751

Fixes #950.
2020-02-17 17:40:06 -08:00
Vincent Prouillet
15a3ab1a51 One last deps update 2020-02-16 19:17:41 +01:00
Vincent Prouillet
855d2376df Fix some theme extension
Closes #937
2020-02-10 23:09:22 +01:00
Vincent Prouillet
0d5fefd446 Update image to 0.23 2020-02-10 20:48:52 +01:00
Vincent Prouillet
a903473a87 Use rustls reqwest feature 2020-02-07 21:16:44 +01:00
Aphek
cc67bf0c88
Change continue-reading to use a span with id instead of a named anchor in a paragraph (#941)
* Change continue-reading to use a span element instead of named anchor

* Fix all tests
2020-02-07 21:07:10 +01:00
Vincent Prouillet
ac3ced828b
Multiple slugification strategies (#929) 2020-02-05 09:13:14 +01:00
Vincent Prouillet
8c1faac761 Update deps + fix tera fn error msg 2020-02-02 17:48:43 -08:00
Travis Cross
983e021d5b Fix warning when building site tests (#936)
For the site integration tests, we have a file of common code which is
used by multiple files in `tests/`.  However, not all functions in
this file are used by all files in `tests/`.

As Cargo compiles each `tests/*.rs` file as a separate crate, this
means that some of these crates end up with unused code.  Rust notices
this and prints a warning.

Let's tell Rust that we don't care about dead code in this file so
that the warning is not printed.
2020-02-02 17:48:43 -08:00
ethereal
94445ae745 Add --root global argument. Fixes #899. (#932) 2020-02-02 17:48:43 -08:00
Sepehr Torab Parhiz
2fa442cead Add Markdown strikethrough rendering (#924)
Fixes #921
2020-02-02 17:48:43 -08:00
Rostislav
145671ed20 Detect empty links on markdown rendering and issue an error (#884)
* Detect empty links on markdown rendering and issue an error

* Add a test for empty links stopping rendering with an error

* Assert error message is the expected one

When testing for empty links detection compare the error message
to make sure it's the correct error that stopped the process
and not some unrelated issue.
2020-02-02 17:48:43 -08:00
Sam Ford
0c93e15b1f Update tokio and re-enable check_site test (#915)
The issue with the check_site test hanging and timing out seems to
be related to a similar reqwest issue, which was ultimately due to
an upstream bug in tokio and may be fixed in tokio 0.2.7 onward.
2020-02-02 17:48:43 -08:00
djugei
046213ce28 fixed warning (#912) 2020-02-02 17:48:43 -08:00
Vincent Prouillet
44a07a4a55 Disable check_site test for now 2020-02-02 17:48:43 -08:00
Vincent Prouillet
622b0f2965 Serialize toc level 2020-02-02 17:48:43 -08:00
Sam Ford
d7bad732f1 Update reqwest to v0.10 (#892) 2020-02-02 17:48:43 -08:00
Sam Ford
3ef62036ef Fix benchmarks (#901)
* Restore #![feature(test)] and extern crate test; statements, which
were mistakenly removed as part of the Rust 2018 edition migration.

* Fix rendering benchmark's usage of RenderContext. 6 parameters were
provided when 5 were expected.
2020-02-02 17:48:43 -08:00
Sam Ford
6b5768fd76 Treat 304 as valid, add mock tests, fix mock issue (#900)
* Treat 304 (Not Modified) requests as valid.

* Add tests for 301-to-200 links, 301-to-404 links, and 500 links.
This helps to test redirections and the previously-added
response.status() checking for non-success status codes in check_url().

* Make names for HTTP mock paths unique, to avoid weird behavior. It
seems like mocks with the same path can potentially bleed between
tests, so you may end up with an unexpected response which causes the
test to sometimes pass and sometimes fail.

* Fix Clippy warnings about String::from(format!()).
2020-02-02 17:48:43 -08:00
Sam Ford
11f7a6d114 Mock HTTP requests in tests (#898)
Certain tests involving HTTP requests were sometimes hanging
indefinitely, so this uses Mockito for HTTP mocking. This seemingly
resolves the issue and makes these tests more reliable.

The existing can_fail_404_links test has been renamed to
can_fail_unresolved_links, to represent what actually occurs in the
test. The can_fail_404_links test now deals with a proper 404
response.

Just to be clear, the check_site test in the site component will
still create outgoing HTTP requests (due to the URLs used in the
test_site), so this commit only uses HTTP mocking where possible.
2020-02-02 17:48:43 -08:00
Sam Ford
2f1b592ab4 link_checker: Handle non-success status codes (#897)
The can_fail_404_links() test doesn't encounter a 404 response in
actuality, since the google.comys domain doesn't resolve. When the
test is updated such that the response's status code is a 404, the
test fails because the check_url() function doesn't handle
non-success responses how the test's assertions expect. This commit
updates check_url() to handle non-success responses, treating them
much like errors.
2020-02-02 17:48:43 -08:00
Sam Ford
b63c563622 Format code using cargo fmt (#896) 2020-02-02 17:48:43 -08:00
Sam Ford
e804f907b2 Use Rust 2018 edition (#885) 2020-02-02 17:48:43 -08:00
Vincent Prouillet
ceb9bc8ed7 Optionally do not slugify paths (#875)
* maybe_slugify() only does simple sanitation if config.slugify is false

* slugify is disabled by default, turn on for backwards-compatibility

* First docs changes for optional slugification

* Remove # from slugs but not &

* Add/fix tests for utf8 slugs

* Fix test sites for i18n slugs

* fix templates tests for i18n slugs

* Rename slugify setting to slugify_paths

* Default slugify_paths

* Update documentation for slugify_paths

* quasi_slugify removes ?, /, # and newlines

* Remove forbidden NTFS chars in quasi_slugify()

* Slugification forbidden chars can be configured

* Remove trailing dot/space in quasi_slugify

* Fix NTFS path sanitation

* Revert configurable slugification charset

* Remove \r for windows newlines and \t tabulations in quasi_slugify()

* Update docs for output paths

* Replace slugify with slugify_paths

* Fix test

* Default to not slugifying

* Move slugs utils to utils crate

* Use slugify_paths for anchors as well
2020-02-02 17:48:43 -08:00
Sam Ford
0a0b6a3ad4 Fix Clippy warnings (#886)
This addresses the following Clippy warnings:

* clippy::option_and_then_some
* clippy::useless_format
2020-02-02 17:48:43 -08:00
Vincent Prouillet
8e3f1f59f6 Update Tera 2020-02-02 17:48:43 -08:00
Philipp Oppermann
72373bea9b Add path to TranslatedContent (#863)
* Add path to `TranslatedContent`

This makes it possible to retrieve the translated page through the `get_page` function.

* Use TranslatedContent::path field in test_site_i18n

Use it with the `get_page` function to get a reference to the page object.
2020-02-02 17:48:43 -08:00
Vincent Prouillet
73ea4b3b16 Finish path collision & fix paginate_path when empty
Closes #866
2020-02-02 17:48:43 -08:00
Vincent Prouillet
5532f62c2d Check for paths collisions
Closes #366
2020-02-02 17:48:43 -08:00
Vincent Prouillet
6153d20047 Link to issues for regression tests 2020-02-02 17:48:43 -08:00
Philipp Oppermann
3362df4a48 Compute canonical path before adjusting parent path (#856)
* Compute canonical path before adjusting parent path

* Don't use adjusted `parent` to recalculate `canonical` in `find_language`

* Add regression tests

- Test for correct canonical field when calling `new_page`
- Test for correct canonical field after calling `find_language`
2020-02-02 17:48:43 -08:00
Stan Rozenraukh
a89b30073c Section extra -> SitemapEntry (#850) 2020-02-02 17:48:42 -08:00
Tjeu Kayim
75570d041a Skip link checking for URL with prefix in config (#846) 2020-02-02 17:47:01 -08:00
Morgan
e8dc33ad08 fixes #844 duplicate entries in doc (#845) 2020-02-02 17:47:01 -08:00
Laurent Arnoud
aaaed31f9c Add title and body to alias page (#830) 2020-02-02 17:45:16 -08:00
Vincent Prouillet
d624f7ec8b Update base64 2020-02-02 17:45:16 -08:00
Geobert Quach
3f166285de Paginator total pages (#829)
* feat(pagination): Add `total_pages` in paginator object

* feat(pagination): Added doc for `total_pages`

* feat(pagination): Added test for `total_pages`
2020-02-02 17:45:16 -08:00
Jochen Kupperschmidt
587d7396b3 Properly escape & in injected live-reload script tag (#825)
"[…] `&` normally indicates the start of a character entity reference or
numeric character reference; writing it as `&` […] allows `&` to be
included in the content of an element or in the value of an attribute."

From: https://en.wikipedia.org/wiki/HTML#Character_and_entity_references
2020-02-02 17:45:16 -08:00
Jochen Kupperschmidt
b3bc8a8896 Do not attempt to serve on "well-known" ports (#824) 2020-02-02 17:45:16 -08:00
Vincent Prouillet
243702e2c2 Update tera 2020-02-02 17:45:16 -08:00
Tjeu Kayim
6149fd17e1 Skip anchor checking for URL with prefix in config (#812)
* cargo fmt & clippy

* Skip anchor checking for URL with prefix in config
2020-02-02 17:45:16 -08:00
Bob
4aa2ba84fc Let toc is visable through Page & Section variables in templates (#818)
* Let toc is visable through Page & Section variables in templates

* Removed the current toc variable from page & section
2020-02-02 17:44:38 -08:00
Michael Macias
b1ceb3e80e rendering: Avoid prepending URL prefix to links that start with a scheme (#817)
Links that start with a scheme (e.g., `tel:18008675309`) inadvertently
had a URL prefix prepended. Previously, only `mailto:` was handled, but
given the sheer number of [registered URI schemes][uri-schemes], a loose
pattern matcher is used to detect schemes instead.

External links, as identified by the renderer, are now limited to `http`
and `https` schemes.

Fixes #747 and fixes #816.

[uri-schemes]: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
2020-02-02 17:44:38 -08:00
Arne Beer
f96aad2fdd Only shrink when resizing with fit (#803) 2019-09-24 16:54:14 -07:00
Vincent Prouillet
5844047435 Update slotmap 2019-09-16 11:44:39 +02:00
Marcus Klaas de Vries
4fd5d3f348 Bump pulldown_cmark to version 0.6.0 (#797)
* Bump pulldown_cmark to version 0.6.0

* Rename headers to headings
2019-09-06 23:36:30 +02:00
Neil Kistner
52c2b74b39 Add anchor existence checking to link_checker component (#786)
* Add anchor existant checking to link_checker component

* Oops, forgot some changes

* Drop scraper dependency and rework tests

* Handle name attributes
2019-09-04 20:31:19 +02:00
Zdenek Crha
096fefe7ed Remove pub visibility from Config::translations hash (#796)
The access to translations is not straightforward and requires checks if
language and key exists. It is better to forbit direct access to
attribute and provide method - `get_translation()` - that will handle
all details of key translations.

Remove unit tests that use direct access and test only public method.
2019-09-04 20:30:32 +02:00
Bob
9db9fc8fb2 Fix the issue of generating the search index for multiple language (#794)
* fix the issue of generating the search index for multiple language

* updat docs for generating the search index for multiple language

* fix failed tests

* add tests for the search index of multiple language
2019-09-03 16:50:23 +02:00
zdenek-crha
5aadd3d4f2 Fix crash of trans() function called on absent translation key (#793)
Add method get_translation(lang, key) into Config struct that retrieves
translated term from parsed configuration or error when either
desired language or key is missing.

Use the new method in Trans struct implementing global Tera function
trans().

Add unit test to cover both happy and error path for translation
retrieval in both config and templates crate.
2019-09-03 10:51:41 +02:00
Bob
e77adc56fd Fix the issue when checking the changes for multiple language section index file (#787)
* Fix the issue when checking the changes of multiple language section
2019-08-30 15:44:57 +02:00
Vincent Prouillet
fb89f94516 Process images on rebuild
Closes #790
2019-08-29 20:08:04 +02:00
Vincent Prouillet
b396a1bc20 Add --drafts flag + rustfmt 2019-08-24 22:23:08 +02:00
Vincent Prouillet
6a7e955ab0 Add lang to get_taxonomy & get_taxonomy_url 2019-08-15 22:14:53 +02:00
Vincent Prouillet
6d5611f409 Use new Tera escape_xml filter for xml files 2019-08-15 20:33:13 +02:00
southerntofu
4695b029a0 Fix ToC generation for heading levels > 3 (bugfix) (#774)
* Fix ToC generation for heading levels > 3

* typo

* Add tests for deep ToCs

* Code style change
2019-08-15 10:19:32 +02:00
Vincent Prouillet
8942c15428 Add to changelog + rustfmt 2019-08-13 20:02:13 +02:00
Vincent Prouillet
a6db79f89b Use fixed version for syntect
>3.2.0 has an updated onig version which requires llvm
which isn't built in azure pipelines in Windows
2019-08-12 22:48:39 +02:00
Katsutoshi Horie
0238e34047 Add trailing slash to multilingual section path (#772) 2019-08-12 18:59:04 +02:00
Vincent Prouillet
e231818718 Add back subsections in basic section ser
Closes #733
2019-08-10 19:21:55 +02:00
Vincent Prouillet
c503a9fe5d Fix test 2019-08-10 19:09:29 +02:00
Vincent Prouillet
7f459940e1 Allow multiple taxonomies with same name in different language
Closes #766
2019-08-10 18:54:32 +02:00
Vincent Prouillet
e74dab535d Update deps & re-render on anchor-link.html changes
Closes #719
2019-08-08 00:37:38 +02:00
Vincent Prouillet
0199017d07 Slugify given slugs as well 2019-08-04 16:17:02 +02:00
Pyry Kovanen
4b43b75d22 Allow ignored_content to support markdown files (#759)
* Allow ignored_content to support markdown files

* Add test for markdown supported ignored_content
2019-08-01 10:18:42 +02:00
Thomas Hurst
0cd9e58a86 Allow relative paths in new_file()/new_section() (#763)
These functions expect that file_path can have base_path stripped from
it, but during reloading they can be given relative paths.  Maybe this
behaviour varies between the notify backends?

This fixes two zola serve panics on FreeBSD (poll backend).
2019-08-01 10:17:38 +02:00
Vincent Prouillet
7e618684da Ensure public exists for search index
Closes #756
2019-07-20 16:09:17 +02:00
Vincent Prouillet
0e4e0c35b3 Remove all draft specific code 2019-07-19 11:10:28 +02:00
Vincent Prouillet
99abbb87a1
Set up CI with Azure Pipelines (#750)
* Set up CI with Azure Pipelines

[skip ci]

* Remove other CI + remove newline in anchor link tpl

* Some more Windows specific changes
2019-07-19 10:35:31 +02:00
lsm
d0167647a8 fixed tags in draft not found error (#753) 2019-07-19 09:45:15 +02:00
Vincent Prouillet
af00a2e8f1 Add tests for custom url scheme 2019-07-15 20:18:24 +02:00
Vincent Prouillet
7c3a112d7d Render draft pages in serve mode 2019-07-12 23:47:15 +02:00
Vincent Prouillet
28ecf553d5 Add counts in zola check
Closes #726
2019-07-12 23:38:46 +02:00
Vincent Prouillet
f5c7b44027 Add warning for old style internal link + fix one 2019-07-12 22:56:07 +02:00
Vincent Prouillet
d2a62153d7 Do not load draft pages
Part fix of #742
2019-07-12 22:54:18 +02:00
traviscross
46ee256ba4 Fix clippy warnings (#744)
Clippy is returning some warnings.  Let's fix or explicitly ignore
them.  In particular:

- In `components/imageproc/src/lib.rs`, we implement `Hash` explicitly
  but derive `PartialEq`.  We need to maintain the property that two
  keys being equal implies the hashes of those two keys are equal.
  Our `Hash` implementations preserve this, so we'll explicitly ignore
  the warnings.

- In `components/site/src/lib.rs`, we were calling `.into()` on some
  values that are already of the correct type.

- In `components/site/src/lib.rs`, we were using `.map(|x| *x)` in
  iterator chains to remove a level of indirection; we can instead say
  `.copied()` (introduced in Rust v1.36) or `.cloned()`.  Using
  `.copied` here is better from a type-checking point of view, but
  we'll use `.cloned` for now as Rust v1.36 was only recently
  released.

- In `components/templates/src/filters.rs` and
  `components/utils/src/site.rs`, we were taking `HashMap`s as
  function arguments but not generically accepting alternate `Hasher`
  implementations.

- In `src/cmd/check.rs`, we use `env::current_dir()` as a default
  value, but our use of `unwrap_or` meant that we would always
  retrieve the current directory even when not needed.

- In `components/errors/src/lib.rs`, we can use `if let` rather than
  `match`.

- In `components/library/src/content/page.rs`, we can collapse a
  nested conditional into `else if let ...`.

- In `components/library/src/sorting.rs`, a function takes `&&Page`
  arguments.  Clippy warns about this for efficiency reasons, but
  we're doing it here to match a particular sorting API, so we'll
  explicitly ignore the warning.
2019-07-12 22:54:18 +02:00
Jakub Turski
8a737d71fb Add an option to hard link files from static/ instead of copying. (#723)
* Add hard_link_static config option.

* Copy or hardlink file depending on an argument.

Modify the call sites for `copy_file` to account for the extra argument.

* Plug the config setting through to copy_file.

Don't apply the config option to theme's static directory.

* Update documentation.

* Backticks make no sense in this comment.

* Addressing PR comments.

* Be consistent with argument naming.
2019-07-12 22:54:18 +02:00
Jakub Wieczorek
b716401217 Fix warnings caused by unnecessary mut qualifiers (#735) 2019-07-12 22:54:18 +02:00
Vincent Prouillet
627222afad Update sitemaps namespace
Closes #722
2019-07-12 22:54:18 +02:00
Igor Gnatenko
d43812dee6 chore: Update toml to 0.5 everywhere
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-07-12 22:54:18 +02:00
Vincent Prouillet
df720a5baf Update deps 2019-06-21 09:24:14 +02:00
Vincent Prouillet
fec33c8e8b
Merge pull request #706 from elbaro/next
Round up reading time
2019-06-20 10:00:22 +02:00
Vincent Prouillet
dc4904dd5f Update escaping with latest version of Tera 2019-06-16 12:17:13 +02:00
elbaro
237671a0b2 Round up reading time 2019-06-16 15:38:49 +09:00
Vincent Prouillet
35138468ac Urlencode urls in xml templates 2019-06-15 11:49:47 +02:00
Vincent Prouillet
0aee33f9c5 Add very copy/pasty impl of anchor checking 2019-06-06 19:49:40 +02:00
Vincent Prouillet
83cf19877a
Merge pull request #703 from cbiffle/master
Add XML declarations to XML templates.
2019-06-05 19:21:28 +02:00
Cliff L. Biffle
eba9726d07 Add XML declaration to XML templates.
Without this, at least one search engine spider was generating a
validation warning.
2019-06-05 08:03:22 -07:00
Vincent Prouillet
76dc62ac49 Copy static folders after processing images when building 2019-06-03 11:29:44 +02:00
Vincent Prouillet
cb962f7a64 Add aliases to sections 2019-06-02 20:21:06 +02:00
Igor Gnatenko
1a05401ecd chore: Update glob to 0.3 (#700)
* chore: Update glob to 0.3

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

* chore: Update ws to 0.8

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-05-31 22:46:48 +02:00
Vincent Prouillet
debb1529ce Merge branch 'next' of github.com:getzola/zola into next 2019-05-30 20:08:51 +02:00
Stuart Small
12d2576fba Fix for #632 - add ability to get asset image dimensions (#670) 2019-05-30 20:06:24 +02:00
Vincent Prouillet
fae644cffe Update pulldown_cmark
Close #693
2019-05-29 20:33:36 +02:00
Marcus Klaas de Vries
bada9ab93f Touch up dead link error message (#698) 2019-05-27 16:24:42 +02:00
Vincent Prouillet
ec61a57841 Use @/ for internal links rather than ./
Close #686
2019-05-27 14:35:18 +02:00
Marcus Klaas de Vries
0d964204c3 Check command global (#683)
* Add check subcommand

* Add some brief documentation for the check subcommand

* Start working on parallel link checks

* Check all external links in Site

* Return *all* dead links in site
2019-05-27 14:05:07 +02:00
Chris Morgan
1a9ab968fe Allow manual specification of header IDs (#685)
Justification for this feature is added in the docs.

Precedent for the precise syntax: Hugo.

Hugo puts this syntax behind a preference named headerIds, and automatic
header ID generation behind a preference named autoHeaderIds, with both
enabled by default. I have not implemented a switch to disable this.

My suggestion for a workaround for the improbable case of desiring a
literal “{#…}” at the end of a header is to replace `}` with `&#125;`.

The algorithm I have used is not identical to [that
which Hugo uses][0], because Hugo’s looks to work at the source level,
whereas here we work at the pulldown-cmark event level, which is
generally more sane, but potentially limiting for extremely esoteric
IDs.

Practical differences in implementation from Hugo (based purely on
reading [blackfriday’s implementation][0], not actually trying it):

- I believe Hugo would treat `# Foo {#*bar*}` as a heading with text
  “Foo” and ID `*bar*`, since it is working at the source level; whereas
  this code turns it into a heading with HTML `Foo {#<em>bar</em>}`, as
  it works at the pulldown-cmark event level and doesn’t go out of its
  way to make that work (I’m not familiar with pulldown-cmark, but I get
  the impression that you could make it work Hugo’s way on this point).
  The difference should be negligible: only *very* esoteric hashes would
  include magic Markdown characters.

- Hugo will automatically generate an ID for `{#}`, whereas what I’ve
  coded here will yield a blank ID instead (which feels more correct to
  me—`None` versus `Some("")`, and all that).

In practice the results should be identical.

Fixes #433.

[0]: a477dd1646/block.go (L218-L234)
2019-05-20 13:08:49 -07:00
Vincent Prouillet
b70f9f95e3 Process images at the end of the build process
To also process the ones found in templates

Closes #669
2019-05-20 11:29:54 +02:00
Vincent Prouillet
55a166ac9e Fix dodgy test 2019-05-17 07:53:07 -07:00
Vincent Prouillet
52f6072ea6 Use file path rather than page path for assets
Closes #674
2019-05-15 21:40:59 -07:00
Vincent Prouillet
debe0633bc Revert "Allow default base-path command line option to be set for building and serving"
This reverts commit 1815155c1d.
2019-04-20 12:50:34 +02:00
Vincent Prouillet
603906de85 Add a test for local time in TOML 2019-04-18 18:55:09 +02:00
Vincent Prouillet
5604738048
Merge pull request #660 from bdjnk/strip_shortcode_outer_newlines
strip wrapping whitespace from newline outward from shortcodes
2019-04-17 19:29:07 +02:00
Konrad Gądek
d9122b105e Sort sitemap elements by permalink
This feature was originally reported in #257 and got fixed in
3a2dab5974, however it seems this
got lost during development.

Closes #661
Ref #257
2019-04-13 19:06:39 +02:00
Michael Plotke
2804b40875 strip wrapping whitespace from newline outward from shortcodes 2019-04-10 13:31:33 -04:00
sebastien
c2f682ede6 specify proper sitemap schema 2019-04-02 18:31:50 +02:00
Blake Smith
1815155c1d Allow default base-path command line option to be set for building and serving 2019-03-23 20:25:56 -05:00
Vincent Prouillet
97e796a724 More tests for load_data 2019-03-22 20:44:06 +01:00
Vincent Prouillet
e00cd3e1b0 Always default to plain for load_data on unknown extensions 2019-03-22 20:34:02 +01:00
Vincent Prouillet
283a15cd93 Fix some deprecation notice of pest 2019-03-19 21:35:49 +01:00
Vincent Prouillet
2a8d0de532 Pass extra for page in sitemap entries 2019-03-19 20:42:16 +01:00
Vincent Prouillet
c63b7fde44 load_data now defaults to plain type + fix bug with get_taxonomy fn 2019-03-16 10:01:11 +01:00
Vincent Prouillet
3eaf13d49b Update pulldown_cmark 2019-03-15 21:29:51 +01:00
Vincent Prouillet
8a802b1828 Make sitemap entries in a set
Close #633
2019-03-14 21:53:29 +01:00
Vincent Prouillet
9beaa26023 Add link to sitemap to robots.txt 2019-03-14 21:30:53 +01:00
Vincent Prouillet
7baf08cef2 Update docs for sitemap 2019-03-14 21:15:01 +01:00
Sébastien Mariaux
2a0d0b9b77 Split sitemap (#619)
Split sitemap when it is getting too big
2019-03-14 20:57:22 +01:00
Vincent Prouillet
3b8a95eb8f Generate assets before rendering templates 2019-03-11 20:25:28 +01:00
Vincent Prouillet
135dc5d5bc Change default directory for load_data 2019-03-11 20:21:13 +01:00
Vincent Prouillet
eccb1e9986 Strip base_path from page/section paths
To ensure we will get the right `content`
directory.
Fix #629
2019-03-08 23:30:43 +01:00
Vincent Prouillet
974492bb7b Ensure we don't delete root index without
adding back default in rebuild

Fix #620
2019-02-22 21:48:31 +01:00
Vincent Prouillet
11c58458e8 Revert useless change in shortcodes 2019-02-22 21:02:42 +01:00
Vincent Prouillet
84f10f6b69 Use platform separator for shortcodes paths 2019-02-16 16:32:11 +01:00
Vincent Prouillet
25b943ec35 Print list of template names to debug Windows error 2019-02-16 15:40:59 +01:00
Vincent Prouillet
42089a18ba
Merge pull request #609 from mziter/next
Handle csv parsing error when encountering rows with different lengths
2019-02-16 08:59:56 +01:00
Vincent Prouillet
705a30aa8d Move toc to be a rendering page/section variable level 2019-02-09 20:49:18 +01:00
Vincent Prouillet
9bc675f2a7 Fix colocated dates + rustfmt
Closes #607
2019-02-09 19:54:47 +01:00
Vincent Prouillet
a42e6dfec4 Fix benches 2019-02-08 19:06:01 +01:00
Matthew Ziter
844be88472 Handle csv parsing error to fix issue getzola/zola#588 2019-02-04 15:58:58 -05:00
Vincent Prouillet
97d11995c5 Skip render=false sections in sitemap
Fix #604
2019-01-31 19:55:36 +01:00
Vincent Prouillet
776bf41123 Show actual Tera source error 2019-01-30 20:42:53 +01:00
Vincent Prouillet
260c413de4 Fix double trailing slash for section permalinks
Only happens for sections with lang != default
2019-01-30 20:01:26 +01:00
Vincent Prouillet
5082e0f15a Render all relevant parent sections on rebuild 2019-01-30 09:15:46 +01:00
Vincent Prouillet
1c7729cac6 Default lang to config.default_language 2019-01-29 19:20:11 +01:00
Peng Guanwen
0b897ce7c7 Replace trim_{left, right} with trim_{start, end}
trim_{start, end} is introduced in rust 1.30.0 and
trim_{left, right} is deprecated since 1.33.0.
2019-01-29 16:30:54 +08:00
Vincent Prouillet
9398ab789c Clone-less toc making 2019-01-28 00:34:18 +01:00
Vincent Prouillet
21d67235ae Arc-ify Library 2019-01-27 18:57:07 +01:00
Vincent Prouillet
d1154d236f Comment out failing test while its getting fixed in Tera 2019-01-26 11:46:54 +01:00
Vincent Prouillet
7c260eb5b2 Fix multilingual tests 2019-01-25 16:18:48 +01:00
Vincent Prouillet
1e2dd9ce03 Update tera to v1 alpha 2019-01-23 19:20:43 +01:00
Vincent Prouillet
464e384760
Merge pull request #581 from peng1999/event-refined
Footnote is now supported in headers
2019-01-22 17:24:33 +01:00
Vincent Prouillet
e119b68533 Remove earlier/later/lighter/heavier from pages when rendering sections 2019-01-21 17:55:05 +01:00
Nicolas Pochet
b65979fac7
Render the theme template files if present
* Change the behavior of the template rendering:
    * Check if the template bare name is present
    * Check if the template is part of a theme
    * Fallback to defaults
* Change the behavior of the shortcode rendering:
    * Call the template rendering function
* Prepend `__zola_builtins/` to most of the default elements in `ZOLA_TERA`
* Add a test to verify the presence and content of a `404.html` page
from a theme's template
2019-01-19 18:06:51 +01:00
Peng Guanwen
5ab3466e2b Doc improvements 2019-01-18 22:50:35 +08:00
Vincent Prouillet
1b4cfd49d0 More early tera fns and mention limitation of shortcodes in docs 2019-01-17 18:29:18 +01:00
Vincent Prouillet
83472a53d7 Register load_data early
Closes #582
2019-01-17 18:18:03 +01:00
Vincent Prouillet
5caf24f06c Remove error-chain
Closes #576
2019-01-17 14:31:47 +01:00
Vincent Prouillet
69fb399726 Add failing shortcode body split test 2019-01-17 14:31:47 +01:00
Peng Guanwen
1dbd8874c0 derive Debug for HeaderIndex 2019-01-16 17:09:23 +08:00
Peng Guanwen
80786a2fbb Revert accidentally change 2019-01-12 17:25:01 +08:00
Peng Guanwen
c027cd97d6 Footnote is now supported in headers
This fixes #569 .

`markdown_to_html` is heavily refactored, header-related things is
handled in a second pass.
2019-01-12 16:55:52 +08:00
Vincent Prouillet
538866487b Add multilingual taxonomies 2019-01-07 21:03:34 +01:00
toidiu
09f691fa47 add id to continue reading p tag (#577)
* add id to continue reading p tag
2019-01-07 19:20:19 +01:00
Peng Guanwen
7130616f63 Minor fixes 2019-01-06 19:04:53 +08:00
Peng Guanwen
972aab1ac4 Add emphasis, strong and code support in header 2019-01-05 23:50:30 +08:00
Peng Guanwen
774514f4d4 refactor markdown_to_html
this commit contains two refactors:
- extract custom link transformations into a function.
- separate some trivial markup generation.
2019-01-05 23:50:30 +08:00
Vincent Prouillet
2e126b3a08 Fix race condition with language folder creation 2019-01-04 21:57:27 +01:00
Vincent Prouillet
f45293ab25 cargo fmt 2019-01-04 20:34:28 +01:00
Vincent Prouillet
19075191ff Add translations to page/sections 2019-01-04 20:31:31 +01:00
Vincent Prouillet
3d22b4f1f9 Generate per language RSS feed 2019-01-02 22:11:34 +01:00
Vincent Prouillet
832360f9b1 Update deps + rustfmt 2019-01-02 20:41:29 +01:00
Vincent Prouillet
fdb6a2864c
Merge pull request #566 from vojtechkral/imgproc
Implement suggestions in #546
2018-12-30 12:44:48 +01:00
Vincent Prouillet
a12e9512bc fmt/clippy 2018-12-29 11:17:43 +01:00
Vincent Prouillet
34708d6592 Handle editing language index colocated 2018-12-28 18:18:12 +01:00
Vincent Prouillet
7313b41f4d Start adding some tests for building multilingual sites 2018-12-28 17:30:47 +01:00
Vincent Prouillet
779511ae43 Pass down lang and start docs 2018-12-28 13:24:49 +01:00
Vincent Prouillet
1d06324a65 Load multi-languages pages/sections 2018-12-28 12:15:17 +01:00
Vincent Prouillet
b0f6963e4c Use lang code in permalinks 2018-12-28 10:42:26 +01:00
Vojtech Kral
9bd6a559c1 imageproc: Use Lanczos3 filter instead of Gaussian 2018-12-28 01:41:22 +01:00
Vojtech Kral
6e84eec32b imageproc: Add the format option, support for PNG thumbnails
Fix #546
2018-12-28 01:41:22 +01:00
Vincent Prouillet
e50d3daad1 Get language from filename 2018-12-27 13:26:53 +01:00
Vincent Prouillet
f0cafcd1d6 Add languages to config 2018-12-27 10:53:17 +01:00
Vincent Prouillet
c0bbe16eac cargo fmt + update 2018-12-10 18:21:08 +01:00
Anton Lazarev
885c7ded80
inject livereloader for 404 template 2018-12-07 20:47:01 -05:00
Anton Lazarev
7cff1d335c
add rendering for 404.html when running zola serve 2018-12-06 20:07:34 -05:00
Vincent Prouillet
814cec99e2 Allow RFC3339 datetimes in filenames
Closes #537
2018-11-30 22:21:00 +01:00
Vincent Prouillet
0cf8e8ca1c Fix pagers not being in sitemap
Closes #521
2018-11-29 21:48:04 +01:00
Vincent Prouillet
b3004c69ef Fix broken taxonomies pagination
Closes #533
2018-11-29 20:24:46 +01:00
Vincent Prouillet
4fa9d89ea8
Merge pull request #532 from sinkuu/redundant_clone
Remove redundant clone
2018-11-20 11:46:06 +01:00
Vincent Prouillet
9a99b40216 Add test for rebuild after deletion 2018-11-19 17:25:24 +01:00
Vincent Prouillet
a465d6a61e Fix deleting while zola serve 2018-11-19 17:19:05 +01:00
Shotaro Yamada
692103bff4 Remove redundant clone 2018-11-19 23:08:34 +09:00
Vincent Prouillet
aee41f279c Fix reload with taxonomies 2018-11-16 23:51:11 +01:00
Vincent Prouillet
e2c3bb2ce2 Fix shortcodes <-> markdown indentation 2018-11-16 18:19:38 +01:00
Vincent Prouillet
41a693a528 Ignore rename of non md files 2018-11-16 16:59:06 +01:00
Vincent Prouillet
7af314c61e Update deps + fmt 2018-11-14 17:34:21 +01:00
Vincent Prouillet
20a05da475 Fix bug with pages starting with dates 2018-11-13 00:08:46 +01:00
Vincent Prouillet
afc30543cc Handle file/dir renaming
Closes #385
2018-11-10 22:23:39 +01:00
Vincent Prouillet
59f3e54e4e Add test for nested page_template 2018-11-07 20:48:39 +01:00
Vincent Prouillet
2d324b3cee Do not clone tpl name for pages 2018-11-07 20:38:07 +01:00
Vincent Prouillet
9c2eeaf1f7 Fewer string cloning for tpl names 2018-11-07 20:38:07 +01:00
Vincent Prouillet
56af4ca7f9 Add page_template to sections
To override all child pages

Closes #397
Tests from PR #434
2018-11-07 19:42:23 +01:00
Vincent Prouillet
a3b0f1e103 Add transparent sections
Closes #413
Closes #408
2018-11-06 00:46:13 +01:00
Vincent Prouillet
3c8505ffb4 Fix 1.28 build for real 2018-11-05 22:22:15 +01:00
Vincent Prouillet
988811a4bd Fix build for 1.28 2018-11-02 08:30:57 +01:00
Vincent Prouillet
cb3c42078a Fix load_toml date handling and fix bug in date conversion 2018-11-01 10:36:19 +01:00
Vincent Prouillet
b7ce4e59fb rustfmt 2018-10-31 08:18:57 +01:00
Vincent Prouillet
8586bc1838 Some clippy fixes 2018-10-30 15:47:49 +01:00
Vincent Prouillet
d524482ac1 Cargo update & some doc tweak 2018-10-30 15:07:23 +01:00
Jake Howard
aad12d829f Remote data (#494) 2018-10-29 20:13:09 +01:00
Vincent Prouillet
a0da580f87 Do not error on files starting with utf-8 BOM
Close #501
2018-10-29 12:43:53 +01:00
Vincent Prouillet
db4def63dc Set date from filename
Fix #396
2018-10-25 16:22:02 +02:00
Vincent Prouillet
0f6c0736cb Serialize page/section assets only once 2018-10-24 11:49:09 +02:00
Vincent Prouillet
4e3d231ca9 Small refactor for serialized page/sections 2018-10-24 11:40:57 +02:00
Vincent Prouillet
dc94aa219b Do not paginate drafts
Fix #495
2018-10-23 13:37:24 +02:00
Vincent Prouillet
19b4341957 Fix test 2018-10-22 22:34:38 +02:00
Magnus Hovland Hoff
05b8bb4ac6 Ensure root output directory exists explicitly.
Aliases that have no directory nesting sneakily avoid the code path that ensures the directories exist
2018-10-22 22:17:51 +02:00
Vincent Prouillet
4c9fd0d302 Do not panic if something is already bound to 1111 in serve 2018-10-19 16:33:11 +02:00
Vincent Prouillet
e2b0ad47c6
Merge pull request #489 from jwatt/next
Remove unmatchable rules from render_shortcodes
2018-10-19 14:11:41 +02:00
Vincent Prouillet
465778c196 Always populate sections on section change 2018-10-19 08:59:45 +02:00
Jonathan Watt
f1b6f3082e Remove unmatchable rules from render_shortcodes 2018-10-19 01:00:11 +01:00
Vincent Prouillet
1811c18b4a No need for clone 2018-10-18 23:20:29 +02:00
Vincent Prouillet
0101e5cb12 Update docs to refer to zola 2018-10-18 23:11:36 +02:00
Vincent Prouillet
f84ae7c93b Rename all occurrences of gutenberg to zola in code 2018-10-18 22:50:06 +02:00
Vincent Prouillet
dffd39aa8f Do not have trailing slash for rss.xml
Closes #486
2018-10-18 18:09:32 +02:00
Vincent Prouillet
83b04a561c Expose relative path of pages & sections
Closes #485
2018-10-18 18:00:40 +02:00
Luke Frisken
1baa7750f3 CSV and TOML loading global functions (#379)
Local CSV/TOML/JSON loading Tera function
2018-10-18 17:32:30 +02:00
Vincent Prouillet
ad6e443ffa
Merge pull request #484 from Keats/subsections
section.subsections is now an array of paths
2018-10-18 17:17:57 +02:00
Vincent Prouillet
86c418372f Add metadata_only to get_section 2018-10-18 16:49:33 +02:00
Vincent Prouillet
957c6bed9d Have a list of ancestors instead of only parent section 2018-10-18 15:54:51 +02:00
Michael Plotke
4db629a060 prevent html tags from appearing in the toc 2018-10-18 08:58:50 -04:00
Vincent Prouillet
f14dbcbdf4 section.subsections is now an array of paths
Close #446
Close #260
Close #478
Close #284
Close #480
2018-10-15 22:28:27 +02:00
Vincent Prouillet
ce79f9881a
Merge pull request #474 from jwatt/next
Fix content parser's 'text' rule to use the correct production
2018-10-11 14:17:21 +02:00
Vincent Prouillet
7ecdc47b91 Remove line trimming for shortcode bodies
Can't remember why it was doing that even
with the comment and the test added in the
commit still pass so...

Fix #462
2018-10-10 15:26:33 +02:00
Vincent Prouillet
44a33c020c Clearer error message when failing to load theme.toml 2018-10-10 13:58:21 +02:00
Chris Krycho
56c5036abc
Allow inclusion of all items in RSS feeds.
Switch to an `Option<usize>` for the serialized value of `rss_items`.
This lets us just set a blank value in the configuration and thereby
include *all* items.

This is a backwards-compatible change; it does not affect the behavior
of existing configurations.

Fixes #468. Closes #471.
2018-10-09 20:20:09 -06:00
Jonathan Watt
324211159e Fix content parser's 'text' rule to use the correct production 2018-10-09 20:13:16 +01:00
Vincent Prouillet
0b0b4a86db Update pest for shortcode parser 2018-10-09 15:24:56 +02:00
Vincent Prouillet
ee3f4dc511 Update to syntect 3 2018-10-09 14:33:43 +02:00
Vincent Prouillet
0ce3a0f070
Merge pull request #459 from Keats/database
Slotmap refactor
2018-10-09 11:30:49 +02:00
Vincent Prouillet
6843ec5c9c Rebuild more things now that it is more performant to do so
Fix #122
2018-10-06 13:52:40 +02:00
Vincent Prouillet
cdcebaea26 Cleanup of slotmap impl
Fix #205
2018-10-05 19:46:04 +02:00
Vincent Prouillet
396d237673 Use Tera render_with_borrowed 2018-10-05 15:03:22 +02:00
Vincent Prouillet
10aba20fe5 Slotmap refactor 2018-10-03 16:29:29 +02:00
Greizgh
fec58054b4 Inject config in robots.txt context
This allow to use base_url in robots.txt, to reference a sitemap for
example.
2018-10-02 08:15:26 +02:00
Vincent Prouillet
2cf99c3cfc Fix robots.txt template for real this time 2018-10-01 17:50:42 +02:00
Vincent Prouillet
99215a4523
Merge pull request #455 from ccoors/fix-clippy
Fix some clippy warnings
2018-09-30 23:54:50 +02:00
Vincent Prouillet
e1aaed3c04 Remove paginator.pagers 2018-09-30 23:49:32 +02:00
Vincent Prouillet
c0090513a0 Remove printlnt 2018-09-30 23:28:08 +02:00
Christian Friedrich Coors
85529186e4 Fix some clippy warnings 2018-09-30 21:15:09 +02:00
Vincent Prouillet
9dca46cfd3 Correct usage of reqwest headers 2018-09-30 20:20:26 +02:00
Vincent Prouillet
f5c88540ed Update reqwest and image 2018-09-30 19:17:51 +02:00
Vincent Prouillet
a11f8232de Fix robots.txt not being loaded in Tera
Closes #443
2018-09-30 19:05:59 +02:00
Vincent Prouillet
9461769bcc Parse date only once for pages 2018-09-21 09:40:52 +02:00
Vincent Prouillet
69dce561c8 Do not clone pages in taxonomies 2018-09-20 23:03:16 +02:00
Vincent Prouillet
14560f224e No clone when rendering rss feed 2018-09-20 22:47:43 +02:00
Vincent Prouillet
f100d956c6 Fix incorrect default for highlight_code of Config 2018-09-20 20:07:20 +02:00
Vincent Prouillet
69a9a352a0 Only compute reading analytics once... 2018-09-20 18:27:56 +02:00
Vincent Prouillet
6903975202 Do not copy pages of sections when rendering taxonomies 2018-09-19 09:24:35 +02:00
Vincent Prouillet
ccaf36ee94 Avoid the use of enumerate in render_paginated 2018-09-18 19:18:50 +02:00
Vincent Prouillet
91adc03bdd Some more benches 2018-09-18 17:19:59 +02:00
Vincent Prouillet
5876a67100 Remove useless benches and add more useful ones 2018-09-18 16:01:44 +02:00
Vincent Prouillet
10c7aa0a6a No replacein markdown rendering
Fix #430
2018-09-15 14:24:16 +02:00
Vincent Prouillet
62b89d0c72 _processed_images -> processed_images 2018-09-15 13:16:46 +02:00
Thomas Hurst
088b3df79a Replace fold/reduce over Result::and with collect
Not only is this tidier, but it avoids making these iterators
Rayon-specific.
2018-09-13 19:17:05 +01:00
Vincent Prouillet
d11f4aa56a Do not load markdown files starting with a . 2018-09-13 17:07:14 +02:00
Thomas Hurst
34d17e613d Make get_all_orphan_pages more idiomatic 2018-09-13 00:23:49 +01:00
Thomas Hurst
2d7315676b Use a HashSet for detecting orphan pages
This offers a big performance bump for large sites:

  small-kb (100 pages)
    before: 530ms
     after: 500ms

  medium-kb (1000 pages)
    before: 2.9s
     after: 1.5s

  huge-kb (10,000 pages)
    before: 150s
     after:   9.1s
2018-09-12 23:54:15 +01:00
Vincent Prouillet
67698a3aa1 Move to non-deprecated fns 2018-09-12 16:45:52 +02:00
Vincent Prouillet
4571b067ea Fix ignored shortcode swallowing whitespace
Fix #383
2018-09-12 16:44:53 +02:00
Vincent Prouillet
5fe4590063 Default get_url to not add a trailing slash
Closes #388
2018-09-10 20:13:45 +02:00
Vincent Prouillet
c2b76d1850 Enable markdown extensions for markdown filter
Closes #417
2018-09-10 17:22:36 +02:00
Vincent Prouillet
b4158921dd Fix email links being checked by link checker
Closes #403
2018-09-10 12:40:31 +02:00
C Jones
dabc614fb3 Change highlighting to not include duplicated background colors 2018-09-09 16:42:10 -04:00
Vincent Prouillet
367f58b0a3 Fix loading html files in themes outside of templates
Fix #412
2018-09-09 20:12:55 +02:00
Vincent Prouillet
38b30eb144 Update deps and fix deprecrations 2018-09-09 19:43:14 +02:00
Vincent Prouillet
a6adbabb3d Fix benches 2018-09-03 19:05:24 +02:00
Vincent Prouillet
f98efe5311
Merge pull request #384 from Freaky/linkchecker-headers
link_checker: Set Accept header
2018-08-26 11:14:13 +02:00
Thomas Hurst
2a53955696 Fix rendering benchmarks. 2018-08-26 00:13:15 +01:00
Thomas Hurst
6a5ace62fc link_checker: Set Accept header
As mentioned in #381, crates.io 404's any request without an Accept:
text/html header.  It 200's any request with one, but at least
false-successes don't prevent checking any other links.

This also makes it easier to add a custom User-Agent if desired.

rustfmt and fix a clippy nit (unnecessary return) while I'm here.
2018-08-25 17:17:06 +01:00
Thomas Hurst
68690a2cf1 Add a test for summary handling in Markdown rendering. 2018-08-24 22:46:28 +01:00
Thomas Hurst
c53c403790 Update rendering tests 2018-08-24 22:37:55 +01:00
Thomas Hurst
5f1f9efe7a Derive debug for markdown::Rendered 2018-08-24 22:37:39 +01:00
Thomas Hurst
f2f3bed080 Markdown parsing: prefer Borrowed over Owned where possible
As mentioned in #376
2018-08-24 17:40:26 +01:00
Thomas Hurst
c069bfdafa Rework summary handling.
Push summary handling into Markdown parsing, identifying the presence
of one by giving its length in the rendered markup.

Hopefully a better fix for #376.
2018-08-22 17:34:32 +01:00
Vincent Prouillet
e0291cec65 Add Swift, MiniZinc syntax and update the rest
Also fix tests

Close #367, #372
2018-08-15 15:42:43 +02:00
Nathan Ringo
48391dbafb
extra_syntaxes documentation 2018-08-14 09:54:24 -05:00
Nathan Ringo
9df5da4697
Fixes bug with extra syntaxes in non-root section, adds tests. 2018-08-14 02:12:04 -05:00
Nathan Ringo
64fa890aa9
Adds support for loading additional syntaxes via extra_syntaxes. 2018-08-12 02:08:50 -05:00
cmal
31479ff23b Remove condition that's always true (optimization) 2018-08-09 11:58:09 +02:00
cmal
739c2011a7 Remove redundant filtering operation (optimization) 2018-08-09 11:55:27 +02:00
cmal
77f8d96c9c Make comment more explicit 2018-08-09 11:53:45 +02:00
cmal
3b9c8c71b5 Revert "Start implementing _index folder for section content/assets"
This reverts commit c7156a84f0.
2018-08-09 11:51:01 +02:00
cmal
c7156a84f0 Start implementing _index folder for section content/assets 2018-08-08 10:51:40 +02:00
cmal
15190962ba Copy relevant assets in case of colocation for section 2018-08-07 12:14:59 +02:00
cmal
8473dff23d Implement assets colocation in section 2018-08-07 12:12:12 +02:00
Vincent Prouillet
4f418a11b4 Fix live reload of section content 2018-08-05 10:30:01 +02:00
Vincent Prouillet
84a3193e97 Last fixes 2018-08-03 19:47:39 +02:00
Vincent Prouillet
bd6578e71c Fix failing test 2018-08-03 18:32:30 +02:00
Vincent Prouillet
efddb24b95 We actually need get_taxonomy_url. Also update docs 2018-07-31 16:35:16 +02:00
Vincent Prouillet
60a52fd2cc Some intellij reformatting 2018-07-31 15:30:49 +02:00
Daniel Sockwell
77ac196f46 Change populate_next_and_previous_page
Replace `populate_next_and_previous_page` with `populate_siblings`
2018-07-30 22:41:27 -04:00
Daniel Sockwell
97f5065259 Fix formating/typos flaged in code review 2018-07-29 17:03:14 -04:00
Daniel Sockwell
c2437cc0eb Remove order and add heavier/later
This commit removes the option to sort by order and also removes
`page.next` and `page.previous` variables.  Instead, pages can be sorted
by two methods `date` and `weight`.  The Tera `reverse` filter will
reverse either of those sorts, so the old `order` behavior can be
achieved by using the `reverse` filter with `weight`.

In place of the `previous`/`next` variables, this commit adds the
`page.earlier`/`page.later` variables (which are set when the page is
sorted by date) and the `page.heavier`/`page.lighter` variables (which
are set when the page is sorted by weight).  These variables have the
advantage of not having confusing semantics when the `reverse` filter is
used.
2018-07-27 23:00:28 -04:00
Vincent Prouillet
9972b72d91 Register get_taxonomy global fn 2018-07-27 18:45:19 +02:00
Vincent Prouillet
3e48ff24b5 Add an external link checker
Close #115
2018-07-16 21:15:50 +02:00
Vincent Prouillet
18bef00671 Rename taxonomies paginate and error on unknown ones 2018-07-16 18:14:48 +02:00
Vincent Prouillet
2f100ecd01 Fix path in windows for taxo rss 2018-07-16 12:01:03 +02:00
Vincent Prouillet
7bf36642d9 Update deps 2018-07-16 11:03:45 +02:00
Vincent Prouillet
1ae0702494
Custom taxonomies (#330) 2018-07-16 10:54:05 +02:00
Vincent Prouillet
735bb38bd7 Update docs for 404 and enable preserve-order of tera 2018-07-05 17:43:48 +02:00
Vincent Prouillet
734beba0fd
Merge pull request #323 from onelson/actix-middleware-err-response
Custom 404 page
2018-07-05 17:22:40 +02:00
Vincent Prouillet
9e9fe50769 Fix rendering benchmark 2018-07-01 16:14:46 +02:00
Owen Nelson
8f460dc28b Custom 404 page now template driven.
Since we are using a builtin template, we can be assured to have the
target file in place. Middleware renamed since it is bound directly to
the concept of handling 404s.
2018-06-25 23:24:57 -07:00
Vincent Prouillet
d47ba4aff0 Rebasing + tweaks 2018-06-25 19:13:21 +02:00
Vojtech Kral
17de3c9a97 imageproc: Rename _resized_images as _processed_images 2018-06-25 18:09:45 +02:00
Vojtech Kral
3e4aa82ecc imageproc: Use DefaultHasher from stdlib instead of twox-hash 2018-06-25 18:09:45 +02:00
Vojtech Kral
a89768dab0 Remove page.images 2018-06-25 18:09:03 +02:00
Vincent Prouillet
8e8cdfeb7f Add year, month and day to page context with a date 2018-06-25 18:06:25 +02:00
Vojtech Kral
4a6244adcf imageproc: Cleanup and comments in hash collision resolution 2018-06-25 18:05:49 +02:00
Vojtech Kral
77bc526008 imageproc: Fix naming, cleanup 2018-06-25 18:05:49 +02:00
Vojtech Kral
6662014e55 Add image resizing support #225 2018-06-25 18:05:04 +02:00
Vincent Prouillet
3eb571fdbf Trim left every line of a shortcode to avoid the accidental markdown codeblock 2018-06-25 18:04:00 +02:00
Vincent Prouillet
f07bb38c37 Fix image in markdown rendering 2018-06-25 18:04:00 +02:00
Vincent Prouillet
28641fc223 Add HTML aliases to changelog 2018-06-25 18:04:00 +02:00
Vincent Prouillet
d334b1cf46 More shortcode docs update 2018-06-25 18:03:20 +02:00
Vincent Prouillet
b120754862 Update shortcode parsing and docs 2018-06-25 18:02:21 +02:00
Vincent Prouillet
860d1f4d1f Indicate which file is failing to render on error 2018-06-25 18:02:07 +02:00
Clar Charr
da3b0fcf0e Use proper Unicode word count; fixes #304 2018-06-25 18:02:07 +02:00
James Munns
fbb57253a3 Add html-alias test 2018-06-25 18:02:07 +02:00
James Munns
cf1f8317bb Reduce the number of allocations 2018-06-25 18:02:07 +02:00
James Munns
40ef634439 Allow creation of specific html aliases 2018-06-25 18:02:07 +02:00
Vincent Prouillet
d69ada09d2 Make permalinks out of co-located images 2018-06-25 18:00:05 +02:00
Vincent Prouillet
ef543b3d2b Make co-located asset link permalinks 2018-06-25 18:00:05 +02:00
Vincent Prouillet
d39edd8ecb Allow links in headers 2018-06-25 18:00:05 +02:00
Vincent Prouillet
85e13483eb Use the new shortcode parser 2018-06-25 18:00:05 +02:00
Vincent Prouillet
204f514c0e WIP: new markdown rendering 2018-06-25 17:59:04 +02:00
Vincent Prouillet
b892c07ed3 Don't hardcode the ws port
Closes #282
2018-06-25 17:59:04 +02:00
Vincent Prouillet
3e6054a9ac tempdir -> tempfile 2018-06-25 17:57:33 +02:00
Vincent Prouillet
7f48b9bee8 Update more deps and appveyor config 2018-06-22 13:39:29 +02:00
Vincent Prouillet
d9dbf4d567 Fix internal links to content dir not working
Closes #275
2018-03-29 14:55:26 +02:00
Vincent Prouillet
9c0dd95bdb Fix theme shortcode not being useable
Closes #272
2018-03-28 21:09:08 +02:00
Vincent Prouillet
d67211bfd6 Fix many shortcode parsing issues
Closes #228
Closes #229
2018-03-28 19:41:04 +02:00
Vincent Prouillet
e40e97711f Some more bits about continue_reading anchor 2018-03-28 17:01:14 +02:00
Tim DuBois
c8dfc5156a
Change naming convention 2018-03-27 07:38:04 +02:00
Tim DuBois
0a34184ac5
Anchor tag for summary 2018-03-25 13:05:42 +02:00
Vincent Prouillet
73ddbf7152 Write some docs 2018-03-21 16:18:24 +01:00
Vincent Prouillet
2c538d3776 Fix some bugs in search 2018-03-20 23:08:20 +01:00
Vincent Prouillet
b0363298f5 Search is working now 2018-03-20 21:27:33 +01:00
Vincent Prouillet
ddf8970ad8 [WIP] Search 2018-03-20 18:43:30 +01:00
Vincent Prouillet
f1abbd0860 Move copy utils to utils crate 2018-03-20 18:43:17 +01:00
Vincent Prouillet
bcf42a0c10 The wonders of serde default, take 2 2018-03-20 18:42:42 +01:00
Vincent Prouillet
d0137377d5
Merge pull request #264 from ErichDonGubler/sass-indented-syntax
Make indented syntax available for SASS via the "sass" file extension
2018-03-19 18:46:07 +01:00
Erich Gubler
0d8dc656f1 CR review: s/Options/SassOptions/, break bail args in compile_sass into multiple lines 2018-03-19 10:04:48 -06:00
Vincent Prouillet
43db3a43ff Do not require themes to have a static folder 2018-03-18 09:34:37 +01:00
Vincent Prouillet
ac8f3a6353
Merge pull request #255 from ErichDonGubler/sass-folders
Preserve folder structure of SCSS content
2018-03-17 20:39:19 +01:00
Erich Gubler
ea4cc63aa9 Make indented syntax available for SASS via the "sass" file extension 2018-03-17 13:23:02 -06:00
Erich Gubler
9fbbcca3c6 Preserve folder structure of SCSS content 2018-03-17 13:22:23 -06:00
Vincent Prouillet
00729581f9 Break sorting ties by a-z ordering
Closes #259
2018-03-17 18:08:02 +01:00
Vincent Prouillet
3a2dab5974 Sort sitemap elements by permalink
Closes #257
2018-03-17 14:34:02 +01:00
Vincent Prouillet
2eacb8247b Fix config CLI option
Closes #254
2018-03-16 19:11:12 +01:00
Vincent Prouillet
b3b2527c5d TIL about serde default 2018-03-12 20:11:03 +01:00
Vincent Prouillet
1e25117887 Fix date serializing in extra section of pages
Closes #238
2018-03-01 14:49:34 +01:00
Vincent Prouillet
de80de1628 Mention 2x serde attributes is not a typo 2018-03-01 11:57:04 +01:00
Vincent Prouillet
f218f2eaf5
Merge pull request #240 from PhilipDaniels/next
Filter ignored content in page.rs.
2018-02-27 08:37:26 +01:00
Philip Daniels
92f38d1b70 Remove unnecessary if when compiling the glob set. 2018-02-25 21:28:04 +00:00
Philip Daniels
045e9def21 globset can be a dev-dependency in 'content' 2018-02-25 21:00:47 +00:00
Vincent Prouillet
5c56278be1 Let people edit their index.md
Closes #241
2018-02-25 19:29:48 +01:00
Philip Daniels
3e1221064b Filter ignored content in page.rs.
* Add ignored_content to the Config structure.
* Use the GlobSet crate to parse the glob patterns into a matcher, which
  is created once at program initialization. If there are no patterns in
  ignored_content, an empty globber is created, which excludes no files.
  This is consistent with the existing behaviour of Gutenberg, before
  this feature was added.
* Bail if there are any errors in the glob patterns.
* Add a call to the globber in page.rs to actually do the filtering.
* Update documentation.

A note on the Config structure
------------------------------
* I had to remove the PartialEq derive from the Config structure as it
  does not work for the GlobSet type. No harm is done, Config does not
  need to be PartialEq anyway, since there is no need to sort Configs.
* The implementation follows the pattern of the existing config settings
  in that it uses an Option<...>. This would appear unnecessary, in that
  an empty vec could be used as the default, but it appears to be needed
  by the TOML parsing. A better approach would be to use a separate
  SerializableConfig and map to/from a Config struct. This would also
  allow the elimination of most, if not all, of the other Options in
  the Config structure, but that ought to be another PR.
2018-02-25 15:15:51 +00:00
Vincent Prouillet
10818cd0de Stop trying to load every file as markdown on serve
Closes #235
2018-02-22 16:49:37 +01:00
Vincent Prouillet
45fc1ee761 Release 0.3.1 2018-02-15 10:41:49 +01:00
Vincent Prouillet
54841b19bb
Merge pull request #220 from Keats/markdown-inline
Markdown inline
2018-02-02 17:29:16 +01:00
Vincent Prouillet
16f658c70c Move test_site and turn rebuild.rs into a component 2018-01-29 18:40:12 +01:00
Vincent Prouillet
29ce510aa3 Add inline option of markdown filter
Fix #197
2018-01-26 16:22:38 +01:00
Vincent Prouillet
49793314a0 Update benchmarks 2018-01-26 16:07:44 +01:00
Vincent Prouillet
b73ff48482 Fix not compiling on nightly
Fix #215
2018-01-24 13:21:48 +01:00
Vincent Prouillet
a44dd5f49a serve cleans after itself now
Closes #199
2018-01-22 18:11:28 +01:00
Vincent Prouillet
11bfd7b2be Tera 0.11 has been released 2018-01-22 15:10:03 +01:00
Vincent Prouillet
8c7e3d7358 Remove stray println 2018-01-22 13:54:10 +01:00
Vincent Prouillet
f37992e03a Do not unwrap on serve 2018-01-22 13:46:36 +01:00
Vincent Prouillet
b06f012be4 Fix tests wrt language_code 2018-01-16 13:49:49 +01:00
Baptiste Darthenay
046de8c998 Config with i18n 2018-01-15 17:54:06 +01:00
Vincent Prouillet
1d1ff74d88 Use TOML dates in front-matter rather than strings
Closes #210
2018-01-14 18:04:01 +01:00
Vincent Prouillet
892c987152 Livereload shortcode changes
Fix #204
2018-01-09 23:39:21 +01:00
Vincent Prouillet
77634ebe83 Update syntect 2018-01-02 17:46:51 +01:00
Vincent Prouillet
bfdc93f948 Cargo update 2017-12-29 19:51:22 +01:00
Vincent Prouillet
14edd2b875 Add output-dir option to build & serve
From #191
2017-12-29 19:26:17 +01:00
Vincent Prouillet
129e693521 Add default templates 2017-11-27 18:09:09 +01:00
Vincent Prouillet
cfefb45913 Update to Tera 0.11 beta 2017-11-26 10:07:34 +01:00
Vincent Prouillet
021c99c5f0 Fix tests and add taxonomies to changelog 2017-11-26 10:07:34 +01:00
Vincent Prouillet
322d2f30fb Add get_taxonomy_url global_fn
And fix bug with taxonomies urls
2017-11-26 10:07:34 +01:00
Carson Page
8759323a16 Add trailing_slash opt. to get_url (#173)
* Added inital trailing_slash impl

* Added simple test

* Updated docs website to use trailing_slash option

* Updated documentation to reflect new trailing_slash option

* Added combined cachebust and trailing_slash test
2017-11-26 10:07:34 +01:00
Jeff Parsons
ca99bb0204 Expose to templates whether or not a page is draft
Useful if you are, e.g., generating an index of blog posts.
2017-11-01 14:30:09 +11:00
Vincent Prouillet
c8f07d8242 Update deps 2017-10-31 17:02:34 +01:00
Vincent Prouillet
791fbe685b Add page and section components 2017-10-31 16:41:31 +01:00
Vincent Prouillet
744e0f8df1
Merge pull request #162 from RadicalZephyr/shortcode-hacky-fix
Hack fix and new tests for body-shortcodes
2017-10-31 08:39:04 +01:00
Vincent Prouillet
4719dca100 Remove unused file 2017-10-31 08:36:20 +01:00
Geoff Shannon
c19e900bec Extract syntex highlighting module into a new component in workspace
This removes the dependency cycle between config and rendering that
causes 4 packages to be recompiled every time a change is made.

I just want to code fast!
2017-10-30 13:55:14 -07:00
Reilly Tucker Siemens
e662f73438 Hack fix and new tests for body-shortcodes 2017-10-29 18:02:48 -07:00
Vincent Prouillet
bfdfe3bba3 Properly parse shortcode arg value types 2017-10-26 17:03:26 +02:00
Vincent Prouillet
1d8df5774f Allow static folder to be missing 2017-10-25 14:49:54 +02:00
Vincent Prouillet
d4779aa2ed Fix generated index section not found in get_section 2017-10-24 20:32:46 +02:00
Vincent Prouillet
404240ef82 Fix some index related bugs 2017-10-24 20:11:39 +02:00
Vincent Prouillet
9d0f84051d Add test for unterminated shortcode# 2017-10-23 15:54:32 +02:00
Vincent Prouillet
7d7efdd6ea Handle markdown parser potentially splitting shortcodes 2017-10-23 14:18:05 +02:00
Vincent Prouillet
bddf2b53fd Add a test for shortcodes with arg 2017-10-23 10:57:39 +02:00
Vincent Prouillet
ca5bdc8f3c Do not ignore shortcodes without args 2017-10-23 10:49:23 +02:00
Vincent Prouillet
bdcad38310 Finishing up site (#131)
* Finishing up site

* Make site a bit responsive

* Fix menu responsiveness

* Remove Fira Sans and revamp a bit text

* Update list of syntax and change output of syntax

* Add Rust mention

* Some doc tweaks

* Correct capitalization for GitHub

Correct capitalization for GitHub

* Some CSS tweaks

* More css tweaks + favicon

* Add link to my site
2017-10-19 13:48:50 +02:00
Vincent Prouillet
f26b9d53bd url -> path in page front-matter 2017-10-04 09:35:37 +09:00
Vincent Prouillet
a24851790c Fix bug with colocated folders 2017-10-04 09:23:25 +09:00
Vincent Prouillet
5aed3a4a1d Default to compressed sass output 2017-10-04 00:03:06 +09:00
Vincent Prouillet
2db7ec4843 Remove deprecated link param of get_url 2017-10-03 23:25:02 +09:00
Vincent Prouillet
97d5561569 Next version will be 0.2.0 2017-10-03 20:50:34 +09:00
Vincent Prouillet
20c1947b47 Clippy run 2017-10-02 20:16:56 +09:00
Vincent Prouillet
952b6679ce Change taxonomies to be sorted a-z and add permalinks 2017-10-01 14:04:30 +09:00
Vincent Prouillet
57b87aa50a Add more docs pages 2017-10-01 12:51:43 +09:00
Vincent Prouillet
dee1dbe667 Working on site
And some tweaks as I write the docs
2017-09-29 15:37:58 +09:00
Vincent Prouillet
c2b190513e Refactor markdown header rendering 2017-09-27 23:09:13 +09:00
Vincent Prouillet
5d7e0bb33e Register all Tera global fns on change 2017-09-26 17:25:55 +09:00
Vincent Prouillet
f11cc6abb4 Serialize page & section paths is, without leading slash 2017-09-26 17:21:08 +09:00
Vincent Prouillet
b248b03045 Allow sorting subsections by weight 2017-09-26 17:04:18 +09:00
Vincent Prouillet
2d97786e67 Add back drafts 2017-09-25 18:55:43 +09:00
Vincent Prouillet
195b760fdc Fix subsection pages not being filled correctly 2017-09-12 16:13:10 +09:00
Vincent Prouillet
f58e416b96 Clippy run 2017-08-31 18:01:26 +09:00
Vincent Prouillet
e1ee6b9dc4 Add test for extending theme template 2017-08-30 22:11:17 +09:00
Vincent Prouillet
edc3fd2295 Only build inheritance chain for user tpls after adding theme tpl 2017-08-30 17:48:13 +09:00
Vincent Prouillet
262ff5ec00 Rewrite theme tera paths and merge theme.toml data 2017-08-25 08:38:03 +09:00
Vincent Prouillet
521b9755f8 Remove local crates Cargo.lock 2017-08-23 19:22:21 +09:00
Vincent Prouillet
c77cc9b170 First draft of theme support 2017-08-23 19:17:24 +09:00
Vincent Prouillet
8a11d8e049 Fold get_static_url in get_url 2017-08-07 23:29:58 +09:00
Vincent Prouillet
fc63765ee1 Add a get_static_url global fn
Fix #108
2017-08-07 20:38:14 +09:00
Vincent Prouillet
23e4b911e7 Improve gutenberg init
Fix #104
2017-07-27 18:28:06 +09:00
Vincent Prouillet
2beb0621ca Add a redirect_to parameter to section front matter
Close #103
2017-07-25 16:58:00 +09:00
Vincent Prouillet
26011e4c94 Update sass-rs 2017-07-25 16:57:31 +09:00
Vincent Prouillet
c61518225b Fix RSS feed; close #101 2017-07-15 12:51:43 +09:00
Vincent Prouillet
ce597c1b43 Use released version of sass-rs 2017-07-14 16:53:48 +09:00
Vincent Prouillet
e2b09d4d27 Sass works on windows; try to use msvc on appveyor 2017-07-13 22:45:31 +09:00
Vincent Prouillet
b3d002f54d Clippy run 2017-07-11 22:51:02 +09:00
Vincent Prouillet
7ace63a6c5 Use compile_file for sass 2017-07-09 11:37:05 +09:00
Vincent Prouillet
d78477b619 Add Sass support for *nix 2017-07-06 22:19:50 +09:00
Vincent Prouillet
3cb4641f1f Remove sections for index page and clean up pager 2017-07-06 18:51:36 +09:00
Vincent Prouillet
ae8335c84b Parallelize taxonomy rendering 2017-07-05 19:34:41 +09:00
Vincent Prouillet
015f146792 Put back a limit on rss feed number of pages 2017-07-05 12:18:37 +09:00
Vincent Prouillet
0b38568015 Previous behaviour of populate was correct so reverting back to it 2017-07-05 12:04:00 +09:00
Vincent Prouillet
998283d17c Faster render_sitemap 2017-07-05 08:27:27 +09:00
Vincent Prouillet
ce704097a4 Add benches for rendering crate 2017-07-04 21:27:32 +09:00
Vincent Prouillet
3022598649 Add one bench for rendering html of page 2017-07-04 19:55:28 +09:00
Vincent Prouillet
37af36186a Improve sorting speed 2017-07-04 18:33:58 +09:00
Vincent Prouillet
c3b525745e Convert project to a workspace 2017-07-01 16:47:41 +09:00