Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Web.Sitemap.Gen
module contains types & rendering functions
to generate XML compliant with the sitemaps.org specification.
For more information see https://www.sitemaps.org/protocol.html
Synopsis
- newtype Sitemap = Sitemap {
- sitemapUrls :: [SitemapUrl]
- renderSitemap :: XmlOutput x => Sitemap -> x
- data SitemapUrl = SitemapUrl {}
- renderSitemapUrl :: SitemapUrl -> Xml Elem
- data ChangeFrequency
- renderChangeFrequency :: ChangeFrequency -> Xml Elem
- newtype SitemapIndex = SitemapIndex {
- indexEntries :: [IndexEntry]
- renderSitemapIndex :: XmlOutput x => SitemapIndex -> x
- data IndexEntry = IndexEntry {}
- renderIndexEntry :: IndexEntry -> Xml Elem
- sitemapNamespace :: Namespace
- formatSitemapTime :: UTCTime -> Text
- renderLastModified :: UTCTime -> Xml Elem
Sitemaps
A Sitemap
contains multiple SitemapUrl
elements which describe
crawlable locations for search engines.
Sitemap | |
|
Instances
Eq Sitemap Source # | |
Read Sitemap Source # | |
Show Sitemap Source # | |
Generic Sitemap Source # | |
type Rep Sitemap Source # | |
Defined in Web.Sitemap.Gen type Rep Sitemap = D1 (MetaData "Sitemap" "Web.Sitemap.Gen" "sitemap-gen-0.1.0.0-38twZSkxbtk4P5or3XePQL" True) (C1 (MetaCons "Sitemap" PrefixI True) (S1 (MetaSel (Just "sitemapUrls") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [SitemapUrl]))) |
renderSitemap :: XmlOutput x => Sitemap -> x Source #
Render a Sitemap into a output format supported by the xmlgen
package.
In most cases you will want to generate a ByteString
.
data SitemapUrl Source #
A SitemapUrl
describes a single URL in a Sitemap
.
SitemapUrl | |
|
Instances
renderSitemapUrl :: SitemapUrl -> Xml Elem Source #
Render a SitemapUrl
as a url
XML element.
data ChangeFrequency Source #
Describes how often a SitemapUrl' is updated. This is considered a hint for crawlers and may or may not be respected.
Always | The page changes every time it is visited. |
Hourly | |
Daily | |
Weekly | |
Monthly | |
Yearly | |
Never | The page is archived and will never change from now on. |
Instances
renderChangeFrequency :: ChangeFrequency -> Xml Elem Source #
Build the XML text content for a ChangeFrequency
.
Sitemap Indexes
newtype SitemapIndex Source #
A SitemapIndex
allows informing crawlers of multiple sitemap files
hosted on the same domain.
Instances
Eq SitemapIndex Source # | |
Defined in Web.Sitemap.Gen (==) :: SitemapIndex -> SitemapIndex -> Bool # (/=) :: SitemapIndex -> SitemapIndex -> Bool # | |
Read SitemapIndex Source # | |
Defined in Web.Sitemap.Gen readsPrec :: Int -> ReadS SitemapIndex # readList :: ReadS [SitemapIndex] # | |
Show SitemapIndex Source # | |
Defined in Web.Sitemap.Gen showsPrec :: Int -> SitemapIndex -> ShowS # show :: SitemapIndex -> String # showList :: [SitemapIndex] -> ShowS # | |
Generic SitemapIndex Source # | |
Defined in Web.Sitemap.Gen type Rep SitemapIndex :: Type -> Type # from :: SitemapIndex -> Rep SitemapIndex x # to :: Rep SitemapIndex x -> SitemapIndex # | |
type Rep SitemapIndex Source # | |
Defined in Web.Sitemap.Gen type Rep SitemapIndex = D1 (MetaData "SitemapIndex" "Web.Sitemap.Gen" "sitemap-gen-0.1.0.0-38twZSkxbtk4P5or3XePQL" True) (C1 (MetaCons "SitemapIndex" PrefixI True) (S1 (MetaSel (Just "indexEntries") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [IndexEntry]))) |
renderSitemapIndex :: XmlOutput x => SitemapIndex -> x Source #
Render a SitemapIndex
into an output format supported by the
xmlgen
package.
data IndexEntry Source #
A single sitemap entry for a sitemap index.
IndexEntry | |
|
Instances
renderIndexEntry :: IndexEntry -> Xml Elem Source #
Render an IndexEntry
as a sitemap
element.
Utilities
sitemapNamespace :: Namespace Source #
An XML Namespace for the sitemaps.org v0.9
schema.