-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Comments
I have lots of images myself - do you have any ideas about how to attack this problem in a static Hugo context? |
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. |
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. |
@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? |
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. |
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. |
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 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. |
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 If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. |
This seems to be pretty easy now with page resources, I added this just before {{ range $i := .Resources.ByType "image" }}
<image:image>
<image:loc>{{ $i.Permalink }}</image:loc>
</image:image>
{{ end }} |
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. |
I get a lot of traffic through my images, so it would be nice to have some media sitemap options.
The text was updated successfully, but these errors were encountered: