I’ve been trying to migrate from Jekyll since it doesn’t work well on Windows for a couple of weeks now.
At first I read the docs about converting to Jekyll, but stuck at a place where you rewrite your templates in go templates.
Afterwards I was trying to find what I’m looking for in the docs, but still didn’t get it.
So.
-
What are predefined variables which can appear after . symbol in templates? i.e. I see a lot of .Site… and stuff, but I want a list of all the implicit stuff there is.
-
How URLs are being resolved?
-
Most important. What are all the predefined names and structure for layouts/templates/partials whatever? Again I want a list of all the implicit stuff.
Pointing me to the right place in the docs would be nice enough.
Thank you.
Follow up.
Where should I create what file for it to be accessible under "http://localhost:1313/foobar.html"
I thought I’ll do /layouts/foobar.html but it doesn’t work.
For 1.
Look here https://gohugo.io/templates/variables/
For 2.
If you’re talking about URL migration look at aliases. https://gohugo.io/extras/aliases/
For 3.
Everything is here with examples https://gohugo.io/templates/overview/
1 Like
It goes at the root of your /Content/ folder
1 Like
@alexandros is right. To have urls with .html
you have to enable the “ugly urls” in the configuration file.
2 Likes
Thank you so much! Now I’m getting through it.
By the way is there any way I can
use "linenos=inline"
with GitHub flavored code-fences?
Like here {{< highlight go "linenos=inline,hl_lines=2 3" >}}
but with
```cpp
int main (int argc, char** argv) {
printf("Hello, world!");
}
Also is there any way to make it add `style` to line numbers span tags? I managed to did it with jekyll so I can restyle line numbers for black bg.
Anyways I can setup lineos for whole site?
PygmentsOptions = "linenos=inline"
in config.toml did the thing
2 Likes