cntrump / hugo-notepadium

a fast gohugo theme, 100% JavaScript-free.
https://examplesite.lvv.me/
MIT License
331 stars 125 forks source link

How can I show language type and line numbers in code blocks? #110

Open ClSlaid opened 3 years ago

ClSlaid commented 3 years ago

Hugo Version: Hugo Static Site Generator v0.80.0/extended linux/amd64 BuildDate: unknown Build Command: Hugo --theme=hugo-notepadium

I know very little about front end however I do love your customizable theme. I'll be glad to know how to show language types and line numbers in code blocks. an example of hugo-even-theme: image

reitzig commented 3 years ago

Seconded.

AsciiDoc:

..envrc
[source,bash,linenums]
----
export CLOUDSDK_CONFIG=$(realpath .)/gcloud-config
export PROJECT_ID=my-project
----

Line numbers don't appear:

image

qianbinbin commented 3 years ago

I don't know front end either, but hugo has a builtin feature to show line numbers: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences

cntrump commented 3 years ago

I don't know front end either, but hugo has a builtin feature to show line numbers: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences

Hugo can't do this.

Try https://prismjs.com/plugins/show-language/ ?

qianbinbin commented 3 years ago

I don't know front end either, but hugo has a builtin feature to show line numbers: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences

Hugo can't do this.

Try https://prismjs.com/plugins/show-language/ ?

I mean hugo can show line numbers, not language.