mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
Merge branch 'hugo' into feature/clipboard
This commit is contained in:
commit
48b8aacf07
@ -8,12 +8,7 @@ const syntaxTheme = document.querySelector("#theme-link");
|
||||
|
||||
if (currentTheme) {
|
||||
document.documentElement.setAttribute('saved-theme', currentTheme);
|
||||
if (currentTheme === 'dark') {
|
||||
syntaxTheme.href = '{{ $darkSyntax.Permalink }}';
|
||||
}
|
||||
else {
|
||||
syntaxTheme.href = '{{ $lightSyntax.Permalink }}';
|
||||
}
|
||||
(currentTheme === 'dark') ? syntaxTheme.href = '{{ $darkSyntax.Permalink }}' : syntaxTheme.href = '{{ $lightSyntax.Permalink }}';
|
||||
}
|
||||
|
||||
const switchTheme = (e) => {
|
||||
|
||||
@ -66,7 +66,7 @@ Please note that the `cname` field should *not* have any path `e.g. end with /qu
|
||||
|
||||
[Reference `deploy.yaml` here](https://github.com/jackyzha0/quartz/blob/hugo/.github/workflows/deploy.yaml)
|
||||
|
||||
```yaml
|
||||
```yaml {title=".github/workflows/deploy.yaml"}
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
{{$src := .Destination | safeURL }}
|
||||
{{$width := index (split .Text "|") 1 | default "auto" }}
|
||||
{{$external := strings.HasPrefix $src "http" }}
|
||||
{{- if $external -}}
|
||||
<img src="{{ $src }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
<img src="{{ $src }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
{{- else -}}
|
||||
{{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}}
|
||||
<img src="{{.Page.Site.BaseURL}}{{ $fixedUrl }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
<img src="{{.Page.Site.BaseURL}}{{ $fixedUrl }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||
{{- end -}}
|
||||
|
||||
@ -95,6 +95,7 @@
|
||||
{{if $.Site.Data.config.enableClipboard -}}
|
||||
initClipboard();
|
||||
{{ end }}
|
||||
|
||||
{{if $.Site.Data.config.enableSPA -}}
|
||||
addTitleToCodeBlocks();
|
||||
{{ end }}
|
||||
@ -135,6 +136,7 @@
|
||||
window.addEventListener("DOMContentLoaded", initClipboard);
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{if $.Site.Data.config.enableCodeBlockTitle -}}
|
||||
{{if $.Site.Data.config.enableSPA -}}
|
||||
addTitleToCodeBlocks();
|
||||
@ -166,8 +168,11 @@
|
||||
navigate: (url) => (window.location.href = url),
|
||||
prefetch: () => {},
|
||||
}
|
||||
init()
|
||||
render()
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
init()
|
||||
render()
|
||||
})
|
||||
</script>
|
||||
{{end}}
|
||||
</head>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user