Use the alias we defined.

This commit is contained in:
Jessica Canady 2024-08-17 09:19:42 -04:00
parent a76c725a96
commit c37d8e4295
Signed by: phoenix
SSH key fingerprint: SHA256:aaLOzOrLi+0n4eDZNQKH97PehwRt6KSE5fYJc+ZRKCQ

View file

@ -7,7 +7,7 @@ defmodule JOL.Blog do
end end
use NimblePublisher, use NimblePublisher,
build: JOL.Blog.Post, build: Post,
from: Application.app_dir(:jol, "priv/posts/**/*.md"), from: Application.app_dir(:jol, "priv/posts/**/*.md"),
parser: Parser, parser: Parser,
as: :posts as: :posts
@ -15,6 +15,17 @@ defmodule JOL.Blog do
@posts Enum.sort_by(@posts, & &1.date, {:desc, Date}) @posts Enum.sort_by(@posts, & &1.date, {:desc, Date})
@tags @posts |> Enum.flat_map(& &1.tags) |> Enum.uniq() |> Enum.sort() @tags @posts |> Enum.flat_map(& &1.tags) |> Enum.uniq() |> Enum.sort()
@spec all_posts() :: [
%Post{
author: String.t(),
body: String.t(),
date: DateTime.t(),
draft: false | nil,
slug: String.t(),
tags: [String.t()],
title: String.t()
}
]
def all_posts, do: @posts def all_posts, do: @posts
def unique_tag_list, do: @tags def unique_tag_list, do: @tags