Skip to content

Commit

Permalink
Add anchor tag icon
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcenteno committed Sep 18, 2024
1 parent f678267 commit 64269f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions assets/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,24 @@
:target {
scroll-margin-top: 100px;
}


a.heading-anchor {
&:hover {
text-decoration: none;

&::before {
opacity: 1;
}
}

&::before {
content: '#';
color: var(--mm-color-logo-blue-light);
font-size: 17px;
left: -15px;
opacity: 0;
position: absolute;
transition: opacity 0.1s ease-in-out;
}
}
2 changes: 1 addition & 1 deletion layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h{{ .Level }} id="{{ .Anchor }}">
<a href="#{{ .Anchor }}">{{ .Text }}</a>
<a class="heading-anchor" href="#{{ .Anchor }}">{{ .Text }}</a>
</h{{ .Level }}>
2 changes: 1 addition & 1 deletion layouts/shortcodes/release-note.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="release-note" data-title="{{ $title }}" data-date="{{ $date }}" data-anchor="{{ $anchor }}">
<h2 class="release-note__title" id="{{ $anchor }}">
<a href="#{{ $anchor }}">{{ $title }}</a>
<a class="heading-anchor" href="#{{ $anchor }}">{{ $title }}</a>
</h2>
<em class="release-note__date">
{{ $date | time.Format ":date_long" }}
Expand Down

0 comments on commit 64269f3

Please sign in to comment.