pod afSitemap

(Internal) A library for creating XML sitemaps for your Bed Application

Mixins

SitemapExempt

Place on Pillow pages to remove them from the Sitemap list.

SitemapPage

(Service) Renders the /sitemap.xml page as detailed by www.sitemaps.org.

SitemapSource

Implement to define a source of Sitemap URLs.

Classes

SitemapSourceImpl

A simple implementation of SitemapSource to be used in service contributions.

SitemapUrl

The main Sitemap URL entity.

Enums

SitemapFreq

Describes how frequently the page is likely to change.

Overview

Sitemap is a support library that aids Alien-Factory in the development of other libraries, frameworks and applications. Though you are welcome to use it, you may find features are missing and the documentation incomplete.

Sitemap is a library that creates an XML sitemap for your Bed App.

Install

Install Sitemap with the Fantom Repository Manager ( fanr ):

C:\> fanr install -r http://repo.status302.com/fanr/ afSitemap

To use in a Fantom project, add a dependency to build.fan:

depends = ["sys 1.0", ..., "afSitemap 1.0"]

Documentation

Full API & fandocs are available on the Status302 repository.

Usage

The SitemapUrl object contains the data needed to render an individual URL object. These are gathered by Sitemap in serveral ways:

Pillow Pages

URLs from Pillow pages are added automatically. The page location is generated using BedSheet's host config value - so ensure this has been set!

Pillow pages are ignored if they contain an @InitRender method or @PageContext fields. Such pages take additional URL parameters of which, obviously, Sitemap can not determine valid values for. These pages should implement SitemapSource and return a list of valid SitemapUrls.

If you don't wish a Pillow page to be scanned or included, let it implement SitemapExempt.

Or you can disable all Pillow Pages by removing the SitemapPage contribution:

@Contribute { serviceType=SitemapPage# }
static Void contributeSitemapPage(Configuration config) {
    config.remove("afSitemap.fromPillowPages")
}

IoC Services

The IoC service registry is scanned for services that implement SitemapSource. Any service that does is called upon to generate SitemapUrls.

Disable all service scanning by removing the SitemapPage contribution:

@Contribute { serviceType=SitemapPage# }
static Void contributeSitemapPage(Configuration config) {
    config.remove("afSitemap.fromServices")
}

IoC Contribution

You may also manually contribute SitemapSource objects to the SitemapPage service:

@Contribute { serviceType=SitemapPage# }
internal static Void contributeSitemapPage(Configuration config) {
    url := SitemapUrl(`/wotever`) { ... }
    config.add(SitemapSourceImpl(url))
}

Release Notes

v1.0.0

  • Chg: Updated to use Ioc 2.0.0 and Pillow 1.0.22.
  • Chg: Removed ConfigIds - just remove the SitemapPage contribution instead!

v0.0.14

v0.0.12

v0.0.10

v0.0.8

v0.0.6

  • New: Added SitemapExempt mixin.

v0.0.4

v0.0.2

  • New: Preview Release.