Use the alias we defined.
This commit is contained in:
parent
a76c725a96
commit
c37d8e4295
|
@ -7,7 +7,7 @@ defmodule JOL.Blog do
|
|||
end
|
||||
|
||||
use NimblePublisher,
|
||||
build: JOL.Blog.Post,
|
||||
build: Post,
|
||||
from: Application.app_dir(:jol, "priv/posts/**/*.md"),
|
||||
parser: Parser,
|
||||
as: :posts
|
||||
|
@ -15,6 +15,17 @@ defmodule JOL.Blog do
|
|||
@posts Enum.sort_by(@posts, & &1.date, {:desc, Date})
|
||||
@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 unique_tag_list, do: @tags
|
||||
|
||||
|
|
Loading…
Reference in a new issue