-
Notifications
You must be signed in to change notification settings - Fork 0
feat: blog with nimble publisher #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pyphilia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I've added some a11y suggestions, great PR!
| background-image: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.184 20c.357-.13.72-.264 1.088-.402l1.768-.661C33.64 15.347 39.647 14 50 14c10.271 0 15.362 1.222 24.629 4.928.955.383 1.869.74 2.75 1.072h6.225c-2.51-.73-5.139-1.691-8.233-2.928C65.888 13.278 60.562 12 50 12c-10.626 0-16.855 1.397-26.66 5.063l-1.767.662c-2.475.923-4.66 1.674-6.724 2.275h6.335zm0-20C13.258 2.892 8.077 4 0 4V2c5.744 0 9.951-.574 14.85-2h6.334zM77.38 0C85.239 2.966 90.502 4 100 4V2c-6.842 0-11.386-.542-16.396-2h-6.225zM0 14c8.44 0 13.718-1.21 22.272-4.402l1.768-.661C33.64 5.347 39.647 4 50 4c10.271 0 15.362 1.222 24.629 4.928C84.112 12.722 89.438 14 100 14v-2c-10.271 0-15.362-1.222-24.629-4.928C65.888 3.278 60.562 2 50 2 39.374 2 33.145 3.397 23.34 7.063l-1.767.662C13.223 10.84 8.163 12 0 12v2z' fill='currentColor' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E"); | ||
| } | ||
|
|
||
| blockquote:has(h4.alert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to split in another css file dedicated to the blog?
|
|
||
| defmodule Parser do | ||
| @moduledoc """ | ||
| A specific parser for the the blog properties to support yaml frontmatter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| A specific parser for the the blog properties to support yaml frontmatter | |
| A specific parser for the blog properties to support yaml frontmatter |
Frontmatter?
| parser: Admin.Blog.Parser | ||
|
|
||
| # The @posts variable is first defined by NimblePublisher. | ||
| # Let's further modify it by sorting all posts by descending date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Let's further modify it by sorting all posts by descending date. | |
| # We further modify it by sorting all posts by descending date. |
| # Let's further modify it by sorting all posts by descending date. | ||
| @posts Enum.sort_by(@posts, & &1.date, {:desc, Date}) | ||
|
|
||
| # Let's also get all tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we more friendly in the comments? Should we keep them neutral?
| </div> | ||
| <div class="flex flex-col gap-4 wrap grow px-2 gap-10"> | ||
| <%= for post <- @posts do %> | ||
| <div id={post.id} class="flex flex-col gap-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div id={post.id} class="flex flex-col gap-1"> | |
| <article id={post.id} class="flex flex-col gap-1"> |
| @@ -0,0 +1,43 @@ | |||
| <Layouts.landing flash={@flash} current_scope={@current_scope}> | |||
| <div class="flex flex-row max-w-screen-lg m-auto p-4 mt-6 gap-8"> | |||
| <div class="flex-col gap-4 wrap px-2 grow w-full max-w-[250px] hidden md:flex"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div class="flex-col gap-4 wrap px-2 grow w-full max-w-[250px] hidden md:flex"> | |
| <nav class="flex-col gap-4 wrap px-2 grow w-full max-w-[250px] hidden md:flex"> |
| </h2> | ||
|
|
||
| <p class="text-gray-400 text-sm"> | ||
| <time>{post.date}</time> by {Enum.join(post.authors, ", ")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have it you could add attribute datetime
| <.link class="btn btn-ghost w-fit" href={~p"/blog"}> | ||
| <.icon name="hero-arrow-left" /> Back to posts | ||
| </.link> | ||
| <div class="flex flex-col max-w-screen-md mx-auto"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div class="flex flex-col max-w-screen-md mx-auto"> | |
| <article class="flex flex-col max-w-screen-md mx-auto"> |
| @@ -0,0 +1,14 @@ | |||
| <Layouts.landing flash={@flash} current_scope={@current_scope}> | |||
| <div class="p-8 max-w-screen-lg mx-auto gap-4 flex flex-col align-start"> | |||
| <.link class="btn btn-ghost w-fit" href={~p"/blog"}> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass a name to link.


In this PR:
Screen.Recording.2026-01-26.at.12.26.12.mov
close #132