Some more bits about continue_reading anchor

This commit is contained in:
Vincent Prouillet 2018-03-28 17:01:14 +02:00
parent 4c6e6c721f
commit e40e97711f
5 changed files with 12 additions and 4 deletions

View file

@ -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 `<!-- more -->` tag if you
want to link directly to it
## 0.3.2 (2018-03-05)

View file

@ -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"),

View file

@ -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#"<a name="continue-reading"></a>"#));
}
#[test]

View file

@ -78,6 +78,6 @@ To do so, add `<!-- more -->` 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:
`<a href="{{ page.permalink }}#continue-reading">Continue Reading</a>`

View file

@ -6,6 +6,8 @@ date = 2017-03-01
Same filename but different path
<!-- more -->
{{ basic() }}
{{ pirate(name="Bob") }}