Hello,
I have a question regarding the readFile
function.
First, the context
According to the Hugo documentation, the readfile
function can be used to obtain the content of a file as a string. Like so:
{{readFile "README.txt"}} ā "Hugo Rocks!"
However by default the readFile
function reads the whole content of the file, and I wish I could restrict it by specifying the first and last lines of the file to read.
Here is an example of what Iād like to have
We have a file README.txt:
Hugo Rocks!
Hugo's fast!
Hugo is open source!
Hugo uses Markdown!
Then use it like that:
{{readFile "README.txt" 2 4 }} ā "Hugo's fast!\nHugo is open source!\nHugo uses Markdown!"
So my question is:
Do you know how I can perform that? Even without using readFile
.
Thank you,
Remi Andruccioli