From e40e97711fb94bdae335dfd1f36d0ab7148b1f27 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Wed, 28 Mar 2018 17:01:14 +0200 Subject: [PATCH] Some more bits about continue_reading anchor --- CHANGELOG.md | 3 +++ components/site/src/lib.rs | 4 ++-- components/site/tests/site.rs | 3 +++ docs/content/documentation/content/page.md | 4 ++-- test_site/content/posts/python.md | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75c1e0..997e389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ to the public directory - Do not require themes to have a static folder - Now supports indented Sass syntax - Add search index building +- Update Tera: now has `break` and `continue` in loops +- Gutenberg now creates an anchor link at the position of the `` tag if you +want to link directly to it ## 0.3.2 (2018-03-05) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 210f848..e30132b 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -109,10 +109,10 @@ impl Site { let site = Site { base_path: path.to_path_buf(), - config: config, + config, + tera, pages: HashMap::new(), sections: HashMap::new(), - tera: tera, live_reload: false, output_path: path.join("public"), static_path: path.join("static"), diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index bb24c3c..f7968f2 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -198,6 +198,9 @@ fn can_build_site_with_live_reload() { // no live reload code assert!(file_contains!(public, "index.html", "/livereload.js?port=1112&mindelay=10")); + + // the summary anchor link has been created + assert!(file_contains!(public, "posts/python/index.html", r#""#)); } #[test] diff --git a/docs/content/documentation/content/page.md b/docs/content/documentation/content/page.md index 78010e5..f7c7f98 100644 --- a/docs/content/documentation/content/page.md +++ b/docs/content/documentation/content/page.md @@ -78,6 +78,6 @@ To do so, add `` in your content at the point where you want the summary to end and the content up to that point will be also available separately in the [template](./documentation/templates/pages-sections.md#page-variables). -An anchor link to this position is created so you can link directly to it if needed -for example: +An anchor link to this position named `continue-reading` is created so you can link +directly to it if needed for example: `Continue Reading` diff --git a/test_site/content/posts/python.md b/test_site/content/posts/python.md index aa39b4e..ef80a06 100644 --- a/test_site/content/posts/python.md +++ b/test_site/content/posts/python.md @@ -6,6 +6,8 @@ date = 2017-03-01 Same filename but different path + + {{ basic() }} {{ pirate(name="Bob") }}