prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
355 stars 102 forks source link

Generating sitemaps for Google News #273

Closed bsdrazor closed 3 years ago

bsdrazor commented 3 years ago

Hi is there a way to generate sitemap for Google News in this format

 <?xml version="1.0" encoding="UTF-8"?> 
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
       xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
 <url>
   <loc>http://www.example.org/business/article55.html</loc>
   <news:news>
     <news:publication>
       <news:name>The Example Times</news:name>
       <news:language>en</news:language>
     </news:publication>
     <news:genres>PressRelease, Blog</news:genres>
     <news:publication_date>2008-12-23</news:publication_date>
     <news:title>Companies A, B in Merger Talks</news:title>
     <news:keywords>business, merger, acquisition, A, B</news:keywords>
     <news:stock_tickers>NASDAQ:A, NASDAQ:B</news:stock_tickers>
   </news:news>
 </url>
</urlset>

Also to split sitemap files when the given limit has reached? And as google says, if a new post has published the sitemap also needs to be updated, how to make it more dynamic

norkunas commented 3 years ago

It is documented here: https://github.com/prestaconcept/PrestaSitemapBundle/blob/f6e68a197f5a8cc20e3383477f26b328c173a4b2/Resources/doc/5-decorating-urls.md#adding-news

bsdrazor commented 3 years ago

Sorry. I did'nt see the part of URL Decorating about google news! Thanks for quick reply