module Sitemapper

Included Modules

Defined in:

sitemapper.cr
sitemapper/builder.cr
sitemapper/errors.cr
sitemapper/image_map.cr
sitemapper/paginator.cr
sitemapper/ping_bot.cr
sitemapper/storage.cr
sitemapper/storage/aws_storage.cr
sitemapper/storage/local_storage.cr
sitemapper/streamer.cr
sitemapper/video_map.cr

Constant Summary

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: 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 /srv/crystaldoc.info/github-jwoertink-sitemapper-v0.9.0/src`).chomp.stringify }}

Class Method Summary

Instance Method Summary

Class Method Detail

def self.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

[View source]
def self.config #

[View source]
def self.configure(&) #

[View source]
def self.ping_search_engines(sitemap_url : String, **additional_engines) : Nil #

Ping Google and Bing, along with any additional engines you want. Pass in the named arg of each additional search engine. Use the %s placeholder for replacing the sitemap path.

Sitemapper.ping_search_engines("https://mysite.com/sitemap.xml", fake_search: "https://fake.search/ping?sitemap=%s")

[View source]
def self.settings #

[View source]
def self.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.


[View source]
def self.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(Hash(String, String)) #

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

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

[View source]

Instance Method Detail

def settings #

[View source]