mirror of
https://github.com/falsycat/ar.falsy.cat.git
synced 2024-12-26 00:14:51 +00:00
fix #54: root all image urls
This commit is contained in:
parent
3b3e6ec3b2
commit
f192f9a23d
@ -10,7 +10,7 @@ Quartz is designed to be effortless to deploy. If you forked and cloned Quartz d
|
|||||||
### Enable GitHub Actions
|
### Enable GitHub Actions
|
||||||
By default, GitHub disables workflows from running automatically on Forked Repostories. Head to the 'Actions' tab of your forked repository and Enable Workflows to setup deploying your Quartz site!
|
By default, GitHub disables workflows from running automatically on Forked Repostories. Head to the 'Actions' tab of your forked repository and Enable Workflows to setup deploying your Quartz site!
|
||||||
|
|
||||||
![Enable GitHub Actions](/notes/images/github-actions.png)*Enable GitHub Actions*
|
![Enable GitHub Actions](notes/images/github-actions.png)*Enable GitHub Actions*
|
||||||
|
|
||||||
### Enable GitHub Pages
|
### Enable GitHub Pages
|
||||||
|
|
||||||
|
8
layouts/_default/_markup/render-image.html
Normal file
8
layouts/_default/_markup/render-image.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{{$src := .Destination | safeURL }}
|
||||||
|
{{$external := strings.HasPrefix $src "http" }}
|
||||||
|
{{- if $external -}}
|
||||||
|
<img src="{{ $src }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||||
|
{{- else -}}
|
||||||
|
{{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}}
|
||||||
|
<img src="{{ $fixedUrl }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
|
||||||
|
{{- end -}}
|
@ -11,9 +11,6 @@
|
|||||||
fetchData().then(({content}) => {
|
fetchData().then(({content}) => {
|
||||||
const links = [...document.getElementsByClassName("internal-link")]
|
const links = [...document.getElementsByClassName("internal-link")]
|
||||||
links.forEach(li => {
|
links.forEach(li => {
|
||||||
console.log(li.dataset.src.replace(baseUrl, ""))
|
|
||||||
console.log(content[li.dataset.src.replace(baseUrl, "")])
|
|
||||||
console.log(content)
|
|
||||||
const linkDest = content[li.dataset.src.replace(baseUrl, "")]
|
const linkDest = content[li.dataset.src.replace(baseUrl, "")]
|
||||||
// const linkDest = content[li.dataset.src]
|
// const linkDest = content[li.dataset.src]
|
||||||
if (linkDest) {
|
if (linkDest) {
|
||||||
|
Loading…
Reference in New Issue
Block a user