Skip to content

imomaliev/hugo-archetype-lookup-order

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hugo archetype lookup order

The docs for version v0.151.2 say

The archetype lookup order is:

  1. archetypes/posts.md
  2. archetypes/default.md
  3. themes/my-theme/archetypes/posts.md
  4. themes/my-theme/archetypes/default.md

If none of these exists, Hugo uses a built-in default archetype.

But this does not match current lookup behavior and code

This repo is to showcase actual behavior

One the example

$ hugo new posts/post-1.md
$ hugo new articles/article-1.md

Expected content to be created:

Post: This is site post
Article: This is site default

Actual:

Post: This is site post
Article: This is theme article

Composite theme example

$ hugo new posts/post-1.md
$ hugo new articles/article-1.md
$ hugo new stories/story-1.md

Expected content to be created:

Post: This is site post
Article: This is site default
Story: This is site default

Actual:

Post: This is site post
Article: This is theme article
Story: This is fallback story

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published