mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +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
|
ul(class: "archive") do
|
||||||
month_posts.sorted_posts.each do |post|
|
month_posts.sorted_posts.each do |post|
|
||||||
li do
|
render_post_item(post)
|
||||||
a(href: post_link(post)) { post.title }
|
|
||||||
time { short_date(post.date) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_link(post)
|
def render_post_item(post)
|
||||||
post.link_post? ? post.link : @site.url_for(post.path)
|
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
|
end
|
||||||
|
|
||||||
def short_date(date)
|
def short_date(date)
|
||||||
|
|
|
||||||
|
|
@ -445,6 +445,10 @@ article header time {
|
||||||
font-family: "Helvetica Neue", "Verdana", sans-serif;
|
font-family: "Helvetica Neue", "Verdana", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.permalink {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
p.fin {
|
p.fin {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #c4c4c4;
|
color: #c4c4c4;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue