Skip to content
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

Build failure for a site with shortcodes #2951

Closed
peterychuang opened this issue Jan 18, 2017 · 5 comments
Closed

Build failure for a site with shortcodes #2951

peterychuang opened this issue Jan 18, 2017 · 5 comments
Milestone

Comments

@peterychuang
Copy link
Contributor

My site cannot be generated with the hugo build from the latest commit (3ac1b9f), but it can be built successfully with v.0.18.1.

At build time, one of the following errors is shown.

Error: Error building site: Prepare pages failed: ["html/template: cannot redefine \"shortcodes/youtube.html\" after it has executed"]…

Error: Error building site: Prepare pages failed: ["html/template: cannot redefine \"_internal/shortcodes/highlight.html\" after it has executed"]…

Error: Error building site: Prepare pages failed: ["html/template: cannot redefine \"shortcodes/img.html\" after it has executed"]…

I find that the site can be built successfully if I remove the pages that uses shortcodes (youtube, img, highlight).

@bep
Copy link
Member

bep commented Jan 18, 2017

Will fix, thanks for the report.

@moorereason moorereason added this to the v0.19 milestone Jan 18, 2017
@bep
Copy link
Member

bep commented Jan 28, 2017

Just wanted to chime in and say that this will be resolved with #2932 -- It has taken me a little longer than it should, partly because I'm on vacation in a sunny part of the world ... But I have mostly a set of tests to fix before wrapping that one up, so it should happen in the next few days,

bep added a commit to bep/hugo that referenced this issue Feb 3, 2017
@bep bep closed this as completed in c71e1b1 Feb 4, 2017
@Tristor
Copy link

Tristor commented Feb 8, 2017

I just wanted to note that I am still seeing this issue occurring in master after #2932 was merged.

❯ hugo server ws .
Started building sites ...
Error: Error building site: Prepare pages failed: ["html/template: cannot redefine \"shortcodes/flickr.html\" after it has executed" "html/template: cannot redefine \"shortcodes/gist.html\" after it has executed" "html/template: cannot redefine \"shortcodes/gist.html\" after it has executed" "html/template: cannot redefine \"shortcodes/gist.html\" after it has executed" "html/template: cannot redefine \"shortcodes/gist.html\" after it has executed"]…
❯ hugo version
Hugo Static Site Generator v0.19-DEV darwin/amd64 BuildDate: 2017-02-08T13:39:30-05:00

@shohan4556
Copy link

I am also having this issue, how can I solve this please tell me.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants