+
+
+
+
+
+
+
+ Sitemap
+ Index
+
+
+
+
+
+
+
Sitemap
+
+ Index
+
+
+ Images
+
+
+ Video
+
+
+ Xhtml
+
+
+
+
+
+ This index contains
+
+ sitemaps.
+
+
+ This index contains
+
+ URLs.
+
+
+
+
+ This is an XML sitemap, meant for consumption by search engines.
+ You can find more information about XML sitemaps on sitemaps.org.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ URL |
+ Last Modified |
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ URL |
+
+ Change Freq. |
+
+
+ Priority |
+
+
+ Last Modified |
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Image:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Video:
+
+
+
+
+
+
+
+
+
+
+
+ thumb
+
+
+
+
+
+
+
+
+
+
+
diff --git a/classes/events.go b/classes/events.go
new file mode 100644
index 0000000..15d41cd
--- /dev/null
+++ b/classes/events.go
@@ -0,0 +1,56 @@
+package classes
+
+import (
+ "time"
+
+ "git.golem15.com/golem15/sm-sitemap-plugin/models"
+)
+
+// ItemInfo is what the sitemap knows about one URL it is about to write, the
+// PHP $itemInfo array: URL (before the final Url::to in BeforeAddItem, the
+// written loc in AddItem), MTime, the record's modification time when the
+// item has one, Lastmod, the written lastmod ("" when omitted), and the
+// hreflang Alternates.
+type ItemInfo struct {
+ URL string
+ MTime *time.Time
+ Lastmod string
+ Alternates []Alternate
+}
+
+// BeforeAddItem is the typed successor of the PHP event
+// golem15.sitemap.beforeAddItem. The generator fires it with
+// festival.Bus.UntilHandled for every URL before it is counted and written;
+// a listener that sets Skip drops the URL (PHP: a listener returned false).
+//
+// app.Events.Listen("acme.seo", func(ctx context.Context, e *classes.BeforeAddItem) error {
+// if strings.HasSuffix(e.Info.URL, "/draft") {
+// e.Skip = true
+// }
+// return nil
+// })
+type BeforeAddItem struct {
+ Item models.DefinitionItem
+ Info ItemInfo
+ Skip bool
+}
+
+// IsHandled reports Skip, so UntilHandled stops at the first listener that
+// drops the URL (festival.Handleable).
+func (e *BeforeAddItem) IsHandled() bool { return e != nil && e.Skip }
+
+// AddItem is the typed successor of the PHP event golem15.sitemap.addItem.
+// The generator fires it with festival.Bus.Fire after a URL's elements are
+// built; listeners may append child XML to Extra, which is written as it is,
+// before the url closing tag, so it must be escaped already (EscapeText,
+// EscapeAttr).
+//
+// app.Events.Listen("acme.images", func(ctx context.Context, e *classes.AddItem) error {
+// e.Extra = append(e.Extra, "