module

Sitemapper

Inherits Habitat::SettingsHelpers < Habitat::TempConfig

Constants

HABITAT_SETTINGS = [{decl: use_index : Bool = false, example: nil, validation: nil}, {decl: host : String, example: "https://mysite.com", validation: nil}, {decl: sitemap_host : String | ::Nil = nil, example: nil, validation: nil}, {decl: sitemap_file_name : String = Sitemapper::Builder::DEFAULT_SITEMAP_FILENAME, example: nil, validation: nil}, {decl: index_file_name : String = Sitemapper::Builder::DEFAULT_INDEX_FILENAME, example: nil, validation: nil}, {decl: max_urls : Int32 = 500, example: nil, validation: nil}, {decl: storage : Sitemapper::Storage.class = Sitemapper::LocalStorage, example: nil, validation: nil}, {decl: compress : Bool = true, example: nil, validation: nil}, {decl: storage_path : String = "tmp/sitemaps", example: nil, validation: nil}, {decl: aws_config : AwsStorageConfig | ::Nil = nil, example: nil, validation: nil}] of Nil
VERSION = {{ (`shards version /tmp/tmp.GgIJFi/src/src`).chomp.stringify }}

Class methods

build(host : String = config.host, max_urls : Int32 = config.max_urls, use_index : Bool = config.use_index, &) : Array(Hash(String, String))

Build your sitemaps. The block arg is an instance of Sitemapper::Builder. Args default to the configuration, but can be overriden.

Sitemapper.build(max_urls: 20) do |builder|
  builder.add("/").add("/about")
end
Source
config
Source
configure
Source
ping_search_engines(sitemap_url : String, **additional_engines) : Nil

DEPRECATED The ping no longer works. See each search engine for their proper methods of submitting sitemaps

Source
settings
Source
store(sitemaps : Array(Hash(String, String)), path : String) : Nil

Store your sitemap xml files. Set the storage config option to the class of the storage.

Source
stored_file_name(file_name : String) : String

The name a sitemap is actually stored under, which picks up the .gz extension when config.compress is set.

Source
stream(host : String = config.host, max_urls : Int32 = config.max_urls, use_index : Bool = config.use_index, storage : Sitemapper::Storage.class = config.storage, storage_path : String = config.storage_path, &) : Array(String)

Build your sitemaps, streaming each file. The block arg is an instance of Sitemapper::Streamer. Each sitemap is saved to your configured storage as it fills up, then the sitemap_index.xml is saved last. Returns the filenames that were saved. Args default to the configuration, but can be overriden.

Sitemapper.stream(path: "tmp/sitemaps") do |builder|
  builder.add("/").add("/about")
end
Source

Instance methods

settings
Source

Nested types