JOL/lib/jol/blog.ex

18 lines
406 B
Elixir
Raw Normal View History

defmodule JOL.Blog do
alias JOL.Blog.Post
use NimblePublisher,
build: Post,
from: Application.app_dir(:jol, "priv/posts/**/*.md"),
as: :posts
@posts Enum.sort_by(@posts, & &1.date, {:desc, Date})
@tags @posts |> Enum.flat_map(& &1.tags) |> Enum.uniq() |> Enum.sort()
2024-07-02 15:13:03 +00:00
@spec posts() :: []
def posts, do: @posts
2024-07-02 15:13:03 +00:00
@spec unique_tag_list() :: []
def unique_tag_list, do: @tags
end