View Source Postex.Validate (Postex v0.1.8)

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
@spec no_duplicate_slugs([Postex.Post.t()]) :: [Postex.Post.t()]

Raises if there are any duplicate slugs

@spec 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
@spec same_data_fields([Postex.Post.t()]) :: [Postex.Post.t()]
Link to this function

url_length(posts, prefix)

View Source
@spec 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