added remainder of content
This commit is contained in:
parent
27a8c22e9f
commit
a7e8651c0b
16 changed files with 175 additions and 11 deletions
lib
|
@ -16,7 +16,7 @@ defmodule Home73k.Blog do
|
|||
Path.wildcard("#{Home73k.app_blog_content()}/**/*.md") |> :erlang.md5() != unquote(post_paths_hash)
|
||||
end
|
||||
|
||||
@posts Enum.sort_by(posts, & &1.date, {:desc, Date})
|
||||
@posts Enum.sort_by(posts, & &1.date, {:desc, NaiveDateTime})
|
||||
@post_count length(@posts)
|
||||
|
||||
@tags posts |> Stream.flat_map(& &1.tags) |> Stream.uniq() |> Enum.sort()
|
||||
|
|
|
@ -83,7 +83,7 @@ defmodule Home73kWeb.BlogLive do
|
|||
|> Enum.at(page_int - 1)
|
||||
end
|
||||
|
||||
defp get_page_count, do: Integer.floor_div(Blog.post_count(), @page_size) + rem(Blog.post_count(), @page_size)
|
||||
defp get_page_count, do: Kernel.ceil(Blog.post_count() / @page_size)
|
||||
|
||||
defp assign_prev_next(socket, page_int) do
|
||||
socket
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue