feat: grey out broken links

This commit is contained in:
Jacky Zhao 2022-04-02 13:34:26 -07:00
parent 902d0f2a0f
commit c51573efa9
3 changed files with 20 additions and 9 deletions

View File

@ -185,6 +185,11 @@ article {
padding: 0 0.1em;
margin: auto -0.1em;
border-radius: 3px;
&.broken {
opacity: 0.5;
background-color: transparent;
}
}
}

View File

@ -2,12 +2,13 @@
title: 🪴 Quartz 3.1
---
Host your second brain and [digital garden](https://jzhao.xyz/posts/digital-gardening) for free. Quartz features
1. Extremely fast full-text search by pressing `/`
2. Display for backlinks of each note
3. Fully customizable local graph view
4. Endlessly powerful page and theme customization using CSS
5. Automatically generated tag and section lists of content
6. Beautiful link previews
1. Extremely fast full-text search by pressing `ctrl` + `k`
2. Wikilink support
3. Display for backlinks of each note
4. Fully customizable local graph view
5. Endlessly powerful page and theme customization using CSS
6. Automatically generated tag and section lists of content
7. Beautiful link previews
## Get Started
> 📚 [Setup your own digital garden using Quartz](notes/setup.md)
@ -18,7 +19,7 @@ Not convinced yet? Look at some [community digital gardens](notes/showcase.md) b
If you prefer browsing the contents of this site through a list instead of a graph, you can find content lists here too:
- [All Notes](/notes)
- [Setup-related Notes](/tags/setup)
- [Setup-related Notes](/tags/set)
## Troubleshooting
- 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md)

View File

@ -6,6 +6,11 @@
{{- else -}}
{{$spacedurl := replace $trimmed "%20" " " }}
{{$fixedUrl := (cond (hasPrefix $spacedurl "/") $spacedurl (print "/" $spacedurl)) | urlize}}
{{$nonexistent := eq (.Page.GetPage $spacedurl).RelPermalink ""}}
{{$rooted := default $spacedurl (strings.TrimRight "/" (.Page.GetPage $spacedurl).RelPermalink) }}
<a href="{{$rooted}}" rel="noopener" class="internal-link" data-src="{{$rooted}}">{{ .Text | safeHTML }}</a>
{{- end -}}
<a
{{if not $nonexistent}}href="{{$rooted}}"{{end}}
rel="noopener" class="internal-link{{if $nonexistent}} broken{{end}}"
data-src="{{$rooted}}">{{ .Text | safeHTML }}
</a>
{{- end -}}