-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PT-14471: Extended XML model with Images
feat: Extends category and product provider to load images and attach them to sitemap using the correct google sitemap structure. Image sitemaps are a good way of telling Google about other images on your site, especially those that we might not otherwise find (such as images your site reaches with JavaScript code). You can create a separate image sitemap or add image sitemap tags to your existing sitemap; either approach is equally fine for Google. https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps
- Loading branch information
1 parent
7d72b1b
commit 5447fa6
Showing
12 changed files
with
306 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/VirtoCommerce.SitemapsModule.Core/Models/SitemapItemImageRecord.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
|
||
namespace VirtoCommerce.SitemapsModule.Core.Models | ||
{ | ||
public class SitemapItemImageRecord : ICloneable | ||
{ | ||
public string Loc { get; set; } | ||
|
||
#region ICloneable members | ||
|
||
public virtual object Clone() | ||
{ | ||
return MemberwiseClone() as SitemapItemImageRecord; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/VirtoCommerce.SitemapsModule.Data/Models/Xml/SitemapItemImageXmlRecord.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
using VirtoCommerce.SitemapsModule.Core.Models; | ||
|
||
namespace VirtoCommerce.SitemapsModule.Data.Models.Xml | ||
{ | ||
[Serializable] | ||
[XmlType(Namespace = "http://www.google.com/schemas/sitemap-image/1.1")] | ||
public class SitemapItemImageXmlRecord | ||
{ | ||
[XmlElement("loc")] | ||
public string Loc { get; set; } | ||
|
||
public virtual SitemapItemImageXmlRecord ToXmlModel(SitemapItemImageRecord coreModel) | ||
{ | ||
if (coreModel == null) | ||
{ | ||
throw new ArgumentNullException(nameof(coreModel)); | ||
} | ||
|
||
Loc = coreModel.Loc; | ||
|
||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.