Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix: mobile-toc target offset
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Aug 20, 2019
1 parent 36a9b75 commit f64c499
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/css/_core/_media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@
.post-warp {
padding-top: 6em;

.post-content {
a.post-title-target:target {
display: block;
position: relative;
top: -60px;
visibility: hidden;
}
}

.categories-card {
.card-item {
width: 95%;
Expand Down
3 changes: 3 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ <h2 class="post-toc-title">{{ T "toc" }}</h2>
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $REin = `<(h[23456]) (id=".+?")>` }}
{{ $REout = `<a class="post-title-target" $2></a><$1>` }}
{{ $content = replaceRE $REin $REout $content }}
{{ $content | safeHTML }}
</div>

Expand Down

0 comments on commit f64c499

Please sign in to comment.