Merge pull request #269 from Libbum/summarylink

Anchor tag for summary
This commit is contained in:
Vincent Prouillet 2018-03-28 16:52:38 +02:00 committed by GitHub
commit 4c6e6c721f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -170,7 +170,7 @@ impl Page {
permalinks, permalinks,
anchor_insert anchor_insert
); );
let res = markdown_to_html(&self.raw_content, &context)?; let res = markdown_to_html(&self.raw_content.replacen("<!-- more -->", "<a name=\"continue-reading\"></a>", 1), &context)?;
self.content = res.0; self.content = res.0;
self.toc = res.1; self.toc = res.1;
if self.raw_content.contains("<!-- more -->") { if self.raw_content.contains("<!-- more -->") {

View file

@ -77,3 +77,7 @@ paragraph of each page in a list for example.
To do so, add `<!-- more -->` in your content at the point where you want the 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 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). 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:
`<a href="{{ page.permalink }}#continue-reading">Continue Reading</a>`