Skip to content

Commit

Permalink
feat: grey out broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Apr 2, 2022
1 parent 902d0f2 commit c51573e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
5 changes: 5 additions & 0 deletions assets/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ article {
padding: 0 0.1em;
margin: auto -0.1em;
border-radius: 3px;

&.broken {
opacity: 0.5;
background-color: transparent;
}
}
}

Expand Down
15 changes: 8 additions & 7 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

0 comments on commit c51573e

Please sign in to comment.