4 Commits

  1. 13
      CHANGELOG.md
  2. 24
      assets/css/app.scss
  3. 2699
      assets/package-lock.json
  4. 2
      assets/package.json
  5. 6
      lib/mirage/notes/tags.ex
  6. 30
      lib/mirage_web/templates/note/index.html.eex
  7. 2
      mix.exs

13
CHANGELOG.md

@ -5,6 +5,19 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.11.0](https://git.inhji.de/inhji/mirage/compare/v0.10.0...v0.11.0) (2021-02-07)
### Features:
* improve note styling
### Bug Fixes:
* handle case when topics is an unloaded assoc in tags_loaded
## [v0.10.0](https://git.inhji.de/inhji/mirage/compare/v0.9.0...v0.10.0) (2021-02-07)

24
assets/css/app.scss

@ -203,7 +203,7 @@ kbd {
.tags {
.tag {
font-size:75%;
background: $bg-content;
background: transparent;
padding: 0 0.3rem;
border-radius: 5px;
border: 1px solid $border-base;
@ -250,8 +250,21 @@ form {
article {
margin-bottom: 4rem;
.title {
font-family: $font-heading;
&>a {
text-decoration: none;
}
header {
border-bottom: 1px solid $border-base;
.title {
font-family: $font-heading;
margin-bottom: 0;
}
}
footer {
border-top: 1px solid $border-base;
}
&:last-child {
@ -280,6 +293,10 @@ article {
p {
margin-bottom: 1rem;
&:last-child {
margin-bottom: 0;
}
}
dl {
@ -328,6 +345,7 @@ article {
blockquote, pre {
padding: 1rem;
background: rgba(0,0,0,0.1);
margin-bottom: 1rem;
}
blockquote {

2699
assets/package-lock.json
File diff suppressed because it is too large
View File

2
assets/package.json

@ -24,7 +24,7 @@
"file-loader": "^6.x",
"mini-css-extract-plugin": "^1.x",
"sass": "^1.x",
"sass-loader": "^10.x",
"sass-loader": "^11.x",
"webpack": "5.x",
"webpack-cli": "^4.x"
}

6
lib/mirage/notes/tags.ex

@ -29,7 +29,7 @@ defmodule Mirage.Notes.Tags do
iex> Tags.get_tags(note)
"foo,bar"
"""
def get_tags(note), do: tags_loaded(note)
@ -122,10 +122,12 @@ defmodule Mirage.Notes.Tags do
end
@doc utils: :tag
defp tags_loaded(%{topics: topics}) do
defp tags_loaded(%{topics: topics}) when is_list(topics) do
topics |> Enum.map_join(", ", & &1.text)
end
defp tags_loaded(_), do: ""
@doc utils: :tag
defp split_tags(tags_string) when is_binary(tags_string) do
tags_string

30
lib/mirage_web/templates/note/index.html.eex

@ -4,18 +4,30 @@
<section class="notes">
<%= for note <- @notes do %>
<article class="width-full bg-content">
<h2 class="title">
<%= link note.title, to: Routes.note_path(@conn, :show, note) %>
</h2>
<article>
<%= link to: Routes.note_path(@conn, :show, note) do %>
<header class="width-full bg-content">
<h2 class="title">
<%= note.title %>
</h2>
</header>
<% end %>
<div class="content html">
<%= Earmark.as_html!(note.content) |> raw %>
</div>
<section>
<div class="content html width-full bg-content">
<%= Earmark.as_html!(note.content) |> raw %>
</div>
</section>
<aside>
<footer class="width-full bg-content">
<time datetime="<%= note.inserted_at %>"><%= Timex.from_now(note.inserted_at) %></time>
</aside>
<span class="tags">
<%= for topic <- note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</span>
</footer class="width-full bg-content">
</article>
<% end %>
</section>

2
mix.exs

@ -1,7 +1,7 @@
defmodule Mirage.MixProject do
use Mix.Project
@version "0.10.0"
@version "0.11.0"
def project do
[

Loading…
Cancel
Save