Skip to content

Commit

Permalink
Merge pull request #63 from ChristopherRWilson/Features/Issue-62---Im…
Browse files Browse the repository at this point in the history
…plementing-entire-Image-sitemap-schema

#62 - Add support for remainder of Image Sitemap schema
  • Loading branch information
ernado-x committed Sep 3, 2023
2 parents d28762b + 0c86b90 commit 96a2d03
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/X.Web.Sitemap/Url.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using JetBrains.Annotations;

namespace X.Web.Sitemap;

[PublicAPI]
[Serializable]
[Description("Encloses all information about a single image. Each URL (<loc> tag) can include up to 1,000 <image:image> tags.")]
[XmlRoot(ElementName = "image", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public class Image
{
[Description("The URL of the image.")]
[XmlElement(ElementName = "loc", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public string Location { get; set; } = "";

[Description("The caption of the image.")]
[XmlElement(ElementName = "caption", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public string? Caption { get; set; }

[Description("The geographic location of the image. For example, \"Limerick, Ireland\".")]
[XmlElement(ElementName = "geo_location", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public string? GeographicLocation { get; set; }

[Description("The title of the image.")]
[XmlElement(ElementName = "title", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public string? Title { get; set; }

[Description("A URL to the license of the image.")]
[XmlElement(ElementName = "license", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public string? License { get; set; }
}

[PublicAPI]
Expand All @@ -22,15 +41,15 @@ public class Url
{
[XmlElement("loc")]
public string Location { get; set; }

[XmlElement(ElementName = "image", Namespace = "http://www.google.com/schemas/sitemap-image/1.1")]
public List<Image> Images { get; set; }

[XmlIgnore]
public DateTime TimeStamp { get; set; }

/// <summary>
/// Please do not use this property to change last modification date.
/// Please do not use this property to change last modification date.
/// Use TimeStamp instead.
/// </summary>
[XmlElement("lastmod")]
Expand Down

0 comments on commit 96a2d03

Please sign in to comment.