Closed d-oit closed 1 month ago
Thanks for submitting the PR @d-oit! I've merged the changes with the main branch. I'll move the content of the added post to the docs next.
Thought in this way you could see directly the changes.
It has been released: https://gethinode.com/docs/components/file/#syntax-highlighting
Problem or enhancement idea
add hugo highlight options to the file shortcode
Proposed solution
{{< file full="true" show="false" path="./layouts/partials/navbar-mode.html" id="file-collapse-1" options="linenos=table,hl_lines=8 15-17,linenostart=3" >}}
use hugo syntax: https://gohugo.io/content-management/syntax-highlighting/
Solution: file shortcode
{{- $options := .Get "options" -}} {{- highlight (trim $content "\r\n") $lang $options -}}