Module m_seo_sitemap

Model for tracking all URLs to be included in the sitemap.

Copyright © 2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Model for tracking all URLs to be included in the sitemap.

Function Index

count/1Return the number of sitemap entries.
delete_key/3Delete a complete source (key 'all') or a specific source key from the sitemap.
delete_loc/2Delete a specific location from the sitemap.
install/1
m_get/3
max_id/1
rebuild_rsc/1Rebuild the seo sitemap for all resources.
rebuild_rsc_task/2Task for fetching the seo sitemap locs for the next 1000 ids.
slice/3Return a slice from the sitemap entries.
update/2Insert or update a location for the sitemap.
update_rsc/2Insert entries for the given resource.

Function Details

count/1

count(Context::z:context()) -> non_neg_integer()

Return the number of sitemap entries

delete_key/3

delete_key(Source::binary(), Key::binary() | all, Context::z:context()) -> ok | {error, term()}

Delete a complete source (key 'all') or a specific source key from the sitemap.

delete_loc/2

delete_loc(Loc::binary(), Context::z:context()) -> ok | {error, term()}

Delete a specific location from the sitemap.

install/1

install(Context) -> any()

m_get/3

m_get(Rest, Msg, Context) -> any()

max_id/1

max_id(Context::z:context()) -> non_neg_integer()

rebuild_rsc/1

rebuild_rsc(Context::z:context()) -> ok

Rebuild the seo sitemap for all resources. This needs to be done after major access control changes, on the initial install of this module or when changing the language configuration.

rebuild_rsc_task/2

rebuild_rsc_task(FromId::m_rsc:resource_id(), Context::z:context()) -> ok | {delay, integer(), [m_rsc:resource_id()]}

Task for fetching the seo sitemap locs for the next 1000 ids. This task repeats till all ids are inserted into the seo_sitemap index table.

slice/3

slice(Offset::pos_integer(), Limit::pos_integer(), Context::z:context()) -> {ok, [map()]} | {error, empty}

Return a slice from the sitemap entries. Note that this might give duplicate entries in sitemaps, as the ids might change during sitemap discovery and consumption by the crawler. All locations are made into absolute urls with the correct hostname. As entries are filtered on publication_end, their language and resource visibility, this might return less entries than the Limit amount requested.

update/2

update(Url::map(), Context::z:context()) -> ok | {error, term()}

Insert or update a location for the sitemap. The entry must have a key to be uniquely identified. The loc may be a path or a complete url with hostname. If the hostname is omitted then the default hostname for the site will be used. The source 'rsc' is reserved for resources (pages), suggested is to use a site or module name as source.

update_rsc/2

update_rsc(Id::m_rsc:resource_id(), Context::z:context()) -> ok | {error, term()}

Insert entries for the given resource.


Generated by EDoc