mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-21 07:12:13 +00:00
fix: parsing wikilinks that have codeblock anchors, scroll to anchor
This commit is contained in:
parent
fd5c8d17d3
commit
24348b24a9
16 changed files with 99 additions and 80 deletions
quartz/components
|
@ -1,6 +1,7 @@
|
|||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
import style from "./styles/backlinks.scss"
|
||||
import { relativeToRoot } from "../path"
|
||||
import { stripIndex } from "./scripts/util"
|
||||
|
||||
function Backlinks({ fileData, allFiles }: QuartzComponentProps) {
|
||||
const slug = fileData.slug!
|
||||
|
@ -9,7 +10,7 @@ function Backlinks({ fileData, allFiles }: QuartzComponentProps) {
|
|||
<h3>Backlinks</h3>
|
||||
<ul>
|
||||
{backlinkFiles.length > 0 ?
|
||||
backlinkFiles.map(f => <li><a href={relativeToRoot(slug, f.slug!)} class="internal">{f.frontmatter?.title}</a></li>)
|
||||
backlinkFiles.map(f => <li><a href={stripIndex(relativeToRoot(slug, f.slug!))} class="internal">{f.frontmatter?.title}</a></li>)
|
||||
: <li>No backlinks found</li>}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue