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

Shortcode for AMP output not rendered on the fly #7448

Closed
coldeaclaudia opened this issue Jul 2, 2020 · 6 comments · Fixed by #7455
Closed

Shortcode for AMP output not rendered on the fly #7448

coldeaclaudia opened this issue Jul 2, 2020 · 6 comments · Fixed by #7455

Comments

@coldeaclaudia
Copy link

AMP shortcode isn't rendered unless Hugo is restarted.

Hugo Static Site Generator v0.73.0-428907CC windows/amd64 BuildDate: 2020-06-23T16:32:10Z
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.14.3"

config.toml

[outputs]
page = ["HTML", "AMP"]

MD post

{{< figureimage src="/images/blog/blah.jpg" alt="Blah" href="https://blah.com/" site="blah.com" url="https://blah.com/" width="640" height="427" >}}

figureimage.html

<figure><img src="{{.Get src}}" alt="{{.Get alt}}"><figcaption>Photo by <a href="{{ .Get href}}" target="_blank" rel="noopener noreferrer">{{ .Getalt}}</a> on <a href="{{ .Geturl}}" target="_blank" rel="noopener noreferrer">{{ .Getsite }}</a></figcaption></figure>

figureimage.amp.html

<amp-img src="{{.Get src}}" alt="{{.Get alt}}" width="{{.Get width}}" height="{{.Get height}}"></amp-img>

@bep
Copy link
Member

bep commented Jul 2, 2020

AMP shortcode isn't rendered unless Hugo is restarted.

Are you saying that it only shows the second time you start the server? Or do you mean that changes to the shortcode does not show unless it's restarted?

If It's the latter, I thought we had tests for that...

@bep bep added this to the v0.74 milestone Jul 2, 2020
@coldeaclaudia
Copy link
Author

Or do you mean that changes to the shortcode does not show unless it's restarted?

This one.

@jakejarvis
Copy link
Contributor

I can confirm this — doesn't even trigger the live reload for me. Will test out the PR when it's merged and report back. :)

@bep bep closed this as completed in #7455 Jul 3, 2020
bep added a commit that referenced this issue Jul 3, 2020
@bep
Copy link
Member

bep commented Jul 3, 2020

I apologise for this. This used to work, but I broke it when making this "template dependency change" graph thing more general, which I guess all in all will be a good thing. On step forward.

@jakejarvis
Copy link
Contributor

jakejarvis commented Jul 3, 2020

No worries at all, can confirm it now works perfectly for me on AMP templates so thanks! 👍

@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 Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants