Skip to content

Commit

Permalink
fix saberhaoren#54: root all image urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Feb 16, 2022
1 parent 3b3e6ec commit f192f9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/notes/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Quartz is designed to be effortless to deploy. If you forked and cloned Quartz d
### 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!

![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

Expand Down
8 changes: 8 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -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 -}}
3 changes: 0 additions & 3 deletions layouts/partials/popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
fetchData().then(({content}) => {
const links = [...document.getElementsByClassName("internal-link")]
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]
if (linkDest) {
Expand Down

0 comments on commit f192f9a

Please sign in to comment.