Postex v0.1.1 Postex.Validate View Source

For validating at compile time

Link to this section Summary

Functions

Raises if there are any duplicate slugs

Raises unless the prefix is set for the use Macro, i.e.

Raises unless all urls (prefix + slug) are less than 60 characters (for SEO) as per Neil Patel.

Link to this section Functions

Link to this function

no_duplicate_slugs(posts)

View Source
no_duplicate_slugs([Postex.Post.t()]) :: [Postex.Post.t()]

Raises if there are any duplicate slugs

Link to this function

prefix_defined(prefix)

View Source
prefix_defined(binary() | nil) :: :ok

Raises unless the prefix is set for the use Macro, i.e.

use Postex, prefix: "https://www.yoursite.com/posts/"

or is explicitly disabled, i.e.

use Postex, prefix: false
Link to this function

url_length(posts, prefix)

View Source
url_length([Postex.Post.t()], false | binary()) :: [Postex.Post.t()]

Raises unless all urls (prefix + slug) are less than 60 characters (for SEO) as per Neil Patel.

Feature can be disabled by setting prefix to false