15 lines
351 B
Elixir
15 lines
351 B
Elixir
|
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()
|
||
|
|
||
|
def posts, do: @posts
|
||
|
def unique_tag_list, do: @tags
|
||
|
end
|