mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-21 20:30:39 +00:00
fix: fix formatting on code links (#316)
This commit is contained in:
parent
30d3c64c41
commit
4f3d48c1d9
@ -2,5 +2,6 @@
|
|||||||
default: True
|
default: True
|
||||||
MD013: False
|
MD013: False
|
||||||
MD041: False
|
MD041: False
|
||||||
|
MD042: False
|
||||||
MD004:
|
MD004:
|
||||||
style: dash
|
style: dash
|
||||||
|
@ -14,7 +14,7 @@ To display an inline shortcode use single quotes:
|
|||||||
`some code`
|
`some code`
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example:** `some code`
|
**Example:** `some code` with a [`link`](#)
|
||||||
|
|
||||||
## Code blocks
|
## Code blocks
|
||||||
|
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
||||||
|
{{- $code := hasPrefix .Text "<code" -}}
|
||||||
<a
|
<a
|
||||||
class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}"
|
class="gdoc-markdown__link{{ if $raw -}}
|
||||||
|
--raw
|
||||||
|
{{- else if $code -}}
|
||||||
|
--code
|
||||||
|
{{- end }}"
|
||||||
href="{{ .Destination | safeURL }}"
|
href="{{ .Destination | safeURL }}"
|
||||||
{{ with .Title }}title="{{ . }}"{{ end }}
|
{{ with .Title }}title="{{ . }}"{{ end }}
|
||||||
>{{ .Text | safeHTML }}</a
|
|
||||||
>
|
>
|
||||||
|
{{- .Text | safeHTML -}}
|
||||||
|
</a>
|
||||||
{{- /* Drop trailing newlines */ -}}
|
{{- /* Drop trailing newlines */ -}}
|
||||||
|
@ -69,6 +69,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__link--code {
|
||||||
|
text-decoration: none;
|
||||||
|
code {
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: none;
|
||||||
|
color: var(--link-color) !important;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:visited,
|
||||||
|
&:visited:hover {
|
||||||
|
color: var(--link-color-visited) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__figure {
|
&__figure {
|
||||||
padding: $padding-4;
|
padding: $padding-4;
|
||||||
margin: $padding-16 0;
|
margin: $padding-16 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user