Browse Source

Merge pull request #269 from Libbum/summarylink

Anchor tag for summary
index-subcmd
Vincent Prouillet GitHub 6 years ago
parent
commit
4c6e6c721f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions
  1. +1
    -1
      components/content/src/page.rs
  2. +4
    -0
      docs/content/documentation/content/page.md

+ 1
- 1
components/content/src/page.rs 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 -->") {


+ 4
- 0
docs/content/documentation/content/page.md 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>`

Loading…
Cancel
Save