Commit graph

287 commits

Author SHA1 Message Date
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
Vincent Prouillet df720a5baf Update deps 2019-06-21 09:24:14 +02: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 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
Stuart Small 12d2576fba Fix for #632 - add ability to get asset image dimensions (#670) 2019-05-30 20:06:24 +02:00
Marcus Klaas de Vries bada9ab93f Touch up dead link error message (#698) 2019-05-27 16:24:42 +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
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 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
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
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 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 8a802b1828 Make sitemap entries in a set
Close #633
2019-03-14 21:53:29 +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 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
Vincent Prouillet 97d11995c5 Skip render=false sections in sitemap
Fix #604
2019-01-31 19:55:36 +01:00
Vincent Prouillet 1c7729cac6 Default lang to config.default_language 2019-01-29 19:20:11 +01:00
Vincent Prouillet 21d67235ae Arc-ify Library 2019-01-27 18:57:07 +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
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
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 538866487b Add multilingual taxonomies 2019-01-07 21:03:34 +01: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 a12e9512bc fmt/clippy 2018-12-29 11:17:43 +01:00
Vincent Prouillet 7313b41f4d Start adding some tests for building multilingual sites 2018-12-28 17:30:47 +01:00
Vincent Prouillet 1d06324a65 Load multi-languages pages/sections 2018-12-28 12:15: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
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
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 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 59f3e54e4e Add test for nested page_template 2018-11-07 20:48:39 +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 b7ce4e59fb rustfmt 2018-10-31 08:18:57 +01:00
Jake Howard aad12d829f Remote data (#494) 2018-10-29 20:13:09 +01: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 f84ae7c93b Rename all occurrences of gutenberg to zola in code 2018-10-18 22:50:06 +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 957c6bed9d Have a list of ancestors instead of only parent section 2018-10-18 15:54:51 +02: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
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
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 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 a11f8232de Fix robots.txt not being loaded in Tera
Closes #443
2018-09-30 19:05:59 +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 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
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 b4158921dd Fix email links being checked by link checker
Closes #403
2018-09-10 12:40:31 +02: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
Nathan Ringo 9df5da4697
Fixes bug with extra syntaxes in non-root section, adds tests. 2018-08-14 02:12:04 -05: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
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 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 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 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
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
Vojtech Kral 6662014e55 Add image resizing support #225 2018-06-25 18:05:04 +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 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 9c0dd95bdb Fix theme shortcode not being useable
Closes #272
2018-03-28 21:09:08 +02:00
Vincent Prouillet e40e97711f Some more bits about continue_reading anchor 2018-03-28 17:01:14 +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 3a2dab5974 Sort sitemap elements by permalink
Closes #257
2018-03-17 14:34:02 +01:00
Vincent Prouillet b3b2527c5d TIL about serde default 2018-03-12 20:11:03 +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 49793314a0 Update benchmarks 2018-01-26 16:07:44 +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 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 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 cfefb45913 Update to Tera 0.11 beta 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
Vincent Prouillet c8f07d8242 Update deps 2017-10-31 17:02:34 +01: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