mirror of
https://github.com/LukasJoswiak/etch.git
synced 2024-05-16 21:28:31 -04:00
print a user-defined number of sentences in the about excerpt
This commit is contained in:
parent
69f7b18a88
commit
2f3a6b3e24
|
@ -1,3 +1,5 @@
|
|||
{{ $about := .Site.GetPage "about" }}
|
||||
{{ $firstParagraph := (findRE "<p>.*?</p>" ($about.Content) 1) }}
|
||||
{{ safeHTML (index $firstParagraph 0) }}
|
||||
{{ $sentencesCount := (default 2 .Site.Params.aboutExcerptSentences) }}
|
||||
{{ $pattern := print "<p>(.*?\\.([[:space:]]|</p>)){" $sentencesCount "}" }}
|
||||
{{ $excerpt := (findRE $pattern ($about.Content) 1) }}
|
||||
{{ safeHTML (index $excerpt 0) }}
|
||||
|
|
Loading…
Reference in a new issue