mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-26 14:47:44 +00:00
Fix internal permalink regression in archives
This commit is contained in:
parent
03bbd783a1
commit
c69c12db99
2 changed files with 18 additions and 6 deletions
|
|
@ -38,16 +38,24 @@ module Pressa
|
|||
|
||||
ul(class: "archive") do
|
||||
month_posts.sorted_posts.each do |post|
|
||||
li do
|
||||
a(href: post_link(post)) { post.title }
|
||||
time { short_date(post.date) }
|
||||
end
|
||||
render_post_item(post)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def post_link(post)
|
||||
post.link_post? ? post.link : @site.url_for(post.path)
|
||||
def render_post_item(post)
|
||||
if post.link_post?
|
||||
li do
|
||||
a(href: post.link) { "→ #{post.title}" }
|
||||
time { short_date(post.date) }
|
||||
a(class: "permalink", href: post.path) { "∞" }
|
||||
end
|
||||
else
|
||||
li do
|
||||
a(href: post.path) { post.title }
|
||||
time { short_date(post.date) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def short_date(date)
|
||||
|
|
|
|||
|
|
@ -445,6 +445,10 @@ article header time {
|
|||
font-family: "Helvetica Neue", "Verdana", sans-serif;
|
||||
}
|
||||
|
||||
.permalink {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
p.fin {
|
||||
text-align: center;
|
||||
color: #c4c4c4;
|
||||
|
|
|
|||
Loading…
Reference in a new issue