s4n7h0 / hugo-theme-timeline

Simple timeline theme for hugo
MIT License
63 stars 32 forks source link

How does the functionality of `images` work in the `posts` archetype? #5

Closed Hpmason closed 3 years ago

Hpmason commented 3 years ago

I apologize if I'm missing something, this is my first time using Hugo, but I noticed there's this property in the posts archetype:

https://github.com/s4n7h0/hugo-theme-timeline/blob/b2edb87d3406c0f71a78c9325e03d764c002e54a/archetypes/posts.md?plain=1#L6

Any time I try to use an image path I get this error:

ERROR 2021/10/19 14:52:40 Failed to render pages: render of "page" failed: execute of template failed: template: timeline/single.html:4:11: executing "timeline/single.html" at <partial "head.html" .>: error calling partial: "C:\Users\hpmas\Documents\Projects\blog\themes\timeline\layouts\partials\head.html:11:18": execute of template failed: template: _internal/schema.html:11:18: executing "_internal/schema.html" at <.>: range can't iterate over images    

Is this a property of the theme or a part of Hugo?

Also, is there any chance to add more info on how to use different properties related to this theme? I saw the cover property is used in the single.html.

s4n7h0 commented 3 years ago

Hi @Hpmason, The archetypes contain preconfigured items and content disposition for your website. More details on this is here https://gohugo.io/content-management/archetypes/

This theme in particular doesn't use archetypes/posts.md. You can delete this file. The timeline contents are added within the content directory. You can add or customize the parameters as you feel. The html files are mapped under themes/timeline/layouts/timeline/ directory.

Check the exampleSite folder for more reference.