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

Add Image/Video Sitemaps #655

Closed
derekperkins opened this issue Nov 20, 2014 · 10 comments
Closed

Add Image/Video Sitemaps #655

derekperkins opened this issue Nov 20, 2014 · 10 comments

Comments

@derekperkins
Copy link
Contributor

I get a lot of traffic through my images, so it would be nice to have some media sitemap options.

@bep
Copy link
Member

bep commented Nov 25, 2014

I have lots of images myself - do you have any ideas about how to attack this problem in a static Hugo context?

@derekperkins
Copy link
Contributor Author

There's a discussion at http://discuss.gohugo.io/t/hugo-seo-social-partials/353 that is trying to create a Hugo standard for registering images and videos in the front matter. Once that is in place, it's fairly trivial to generate image / video sitemaps based on that content.

@spf13
Copy link
Contributor

spf13 commented Nov 25, 2014

I don't want it dependent on front matter. One principle I've based hugo on is that if you can determine something based on the file system structure than you shouldn't need to add it to the front matter (see how section is derived, type from section, title from file name, etc). These also don't force the file system do put unnecessary information in it (ala date in the file name). Front matter can be used to support this, but shouldn't be required.

@derekperkins
Copy link
Contributor Author

@spf13 I'd love for it not to be dependent either, though it may be nice to provide that as a possible configuration. If that's the goal, that leaves us with two options that I can think of, and maybe a combination of all the options:

What about parsing through both of those, appending them to the front matter specified images if there are any, then deduping the list?

@Jos512
Copy link

Jos512 commented Aug 5, 2015

Any update on including images in the sitemap? This is especially important for people who want to use a CDN. Since that can give duplicate content (CDN images vs. origin if both are linked to), a sitemap is a tool to communicate to Google what the preferred URL for the content is.

See image sitemaps and Google webmaster blog for more.

@christophermancini
Copy link
Contributor

I see that there is a Media.go object and the Image and Video structs are referenced there, but there is not docs on what, if anything they provide in terms of images and sitemaps.

@bep
Copy link
Member

bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Feb 28, 2017
@bep
Copy link
Member

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep bep closed this as completed Mar 27, 2017
@thomasjsn
Copy link

This seems to be pretty easy now with page resources, I added this just before </url> in layouts/_default/sitemap.xml

  {{ range $i := .Resources.ByType "image" }}
  <image:image>
    <image:loc>{{ $i.Permalink }}</image:loc>
  </image:image>
  {{ end }}

@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 Feb 21, 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

6 participants