matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.6k stars 1.28k forks source link

By opening the given file, you should see the property chapter=true on top #66

Open sebhewelt opened 7 years ago

sebhewelt commented 7 years ago

hugo new --kind chapter basics/_index.md

By opening the given file, you should see the property chapter=true on top, meaning this page is a chapter.

Although there is chapter.md file in themes/hugo-theme-learn/archetypes, it is not applied to be the archetype for new --kind chapter. The default.md from ~/archetypes is applied instead.

The tutorial doesn't say it - should i copy the folders from themes/hugo-theme-learn to the root folder?

I thought the hugo engine would look into the themes/hugo-theme-learn/archetypes after it checks ~/archetypes, but it doesn't

matcornic commented 7 years ago

Hello,

Can you explain what are the commands and steps you execute ? I just tested it and it works well as expected : http://recordit.co/RY5lqSCOG8

sebhewelt commented 7 years ago

Oh ok, big thanks, the tutorial doesn't say I should cd to exampleSite directory. All clear now :)

matcornic commented 7 years ago

exampleSite is the documentation of the theme. In the tutorial, your are supposed to create your own site (then you don't need to cd to exampleSite because your are already in it) : https://learn.netlify.com/en/basics/installation/#create-your-project

sebhewelt commented 7 years ago

Yeah, i know, and i made my own site. But that's why I opened the issue in the first place, it didn't work on my hugo site.

http://recordit.co/wiY8iJBTl7

Maybe I skipped a step somewhere, but the line:

By opening the given file, you should see the property chapter=true on top, meaning this page is a chapter.

doesn't apply to my site. Could you take a look at the vid?

khalidabuhakmeh commented 6 years ago

I figured it out. @sebhewelt is right that running hugo new --kind chapter basics/_index.md doesn't work, but that's because the default.md file is taking precedence over any kind you specify (this could be a bug) in hugo itself.

Delete the default.md under your sites archetypes folder and it should work now.

khalidabuhakmeh commented 6 years ago

https://discourse.gohugo.io/t/hugo-doesnt-use-theme-archetypes/8382/20