Builds JSON-LD structured-data payloads for each page type.
Summary
Functions
Return a JSON-encoded BlogPosting structured data payload for a
single post.
Return a JSON-encoded BreadcrumbList payload for a category page.
Return a JSON-encoded BreadcrumbList payload for a single post.
Return a JSON-encoded CollectionPage structured data payload for a
category landing page.
Return a JSON-encoded WebSite structured data payload for the home page.
Return the absolute URL of the site's logo image.
Count words in a post body by stripping HTML tags and counting whitespace-delimited tokens.
Functions
@spec json_ld_blog_posting( StaticBlog.Post.t(), keyword() ) :: binary()
Return a JSON-encoded BlogPosting structured data payload for a
single post.
Arguments
postis theStaticBlog.Post.t/0to serialize.siteis the site configuration keyword list.
Returns
- A binary containing the JSON-LD document.
Return a JSON-encoded BreadcrumbList payload for a category page.
Arguments
tagis the human-readable tag name.siteis the site configuration keyword list.
Returns
- A binary containing the JSON-LD document.
@spec json_ld_breadcrumbs_for_post( StaticBlog.Post.t(), keyword() ) :: binary()
Return a JSON-encoded BreadcrumbList payload for a single post.
Arguments
postis theStaticBlog.Post.t/0to generate breadcrumbs for.siteis the site configuration keyword list.
Returns
- A binary containing the JSON-LD document.
@spec json_ld_collection_page(String.t(), [StaticBlog.Post.t()], keyword()) :: binary()
Return a JSON-encoded CollectionPage structured data payload for a
category landing page.
Arguments
tagis the human-readable tag name.postsis the list of posts in this category.siteis the site configuration keyword list.
Returns
- A binary containing the JSON-LD document.
Return a JSON-encoded WebSite structured data payload for the home page.
Arguments
siteis the site configuration keyword list.
Returns
- A binary containing the JSON-LD document.
Return the absolute URL of the site's logo image.
Arguments
siteis the site configuration keyword list.
Returns
- An absolute URL string.
@spec word_count(StaticBlog.Post.t()) :: non_neg_integer()
Count words in a post body by stripping HTML tags and counting whitespace-delimited tokens.
Arguments
postis the post whose body to count.
Returns
- A non-negative integer word count.