New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to process archetype file themes/hugo-smorg/archetypes/default.md #6

Closed
tordanpersson opened this Issue Apr 24, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@tordanpersson

tordanpersson commented Apr 24, 2018

When I try to create a new file:

hugo new kontakt/kontakt-formular.md

I get the error:

Error: Failed to process archetype file "/Users/svennebanan/Documents/ABCLillaBegravningsbyrån/appernetic-hugo-project/themes/hugo-smorg/archetypes/default.md": template: default:2:19: executing "default" at <.Name>: can't evaluate field Name in type create.ArchetypeFileData

If I change hugo-smorg/archetypes/default.md:

title: "{{ replace .Name "-" " " | title }}"

to:

title: "{{ replace .TranslationBaseName "-" " " | title }}"

it works.

I haven't investigated it further, I'm happy I got it working for now. I am using Hugo v0.34

Realy nice theme by the way.

I have put all my customizations and bugfixes in the layout folder and archetypes folder overriding the theme. So no PR yet.

@solutionroute

This comment has been minimized.

Owner

solutionroute commented Apr 27, 2018

Thanks for the feedback on this issue and the kind words. I have to admit I have not looked very closely at the internationalization features Hugo offered but am willing to do so.

I'll put some conditional logic into the archetype so failures like that will not occur.

@solutionroute

This comment has been minimized.

Owner

solutionroute commented Apr 27, 2018

Fixed using TranslationBaseName per your note. At one point .Name must have been exposed in some version by Hugo as I've not run into this before but as .Name isn't documented the change is definitely needed. Thanks! Closes #6

https://gohugo.io/variables/files/#prose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment