Skip to content

Commit

Permalink
fix: Static files are now visible in pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rishav-singh-0 committed Nov 25, 2024
1 parent b679644 commit c9e0c96
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
19 changes: 19 additions & 0 deletions hugo_root/layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- $url := urls.Parse .Destination -}}
{{- $scheme := $url.Scheme -}}

<img src="
{{- if eq $scheme "" -}}
{{- if strings.HasSuffix $url.Path ".md" -}}
{{- relref .Page .Destination | safeURL -}}
{{- else -}}
{{- printf "/%s%s" .Page.File.Dir .Destination | safeURL -}}
{{- end -}}
{{- else -}}
{{- .Destination | safeURL -}}
{{- end -}}"
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}
{{- with .Text }} alt="{{ . | safeHTML }}"
{{- end -}}
/>

{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}
18 changes: 18 additions & 0 deletions hugo_root/layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- $url := urls.Parse .Destination -}}
{{- $scheme := $url.Scheme -}}

<a href="
{{- if eq $scheme "" -}}
{{- if strings.HasSuffix $url.Path ".md" -}}
{{- relref .Page .Destination | safeURL -}}
{{- else -}}
{{- .Destination | safeURL -}}
{{- end -}}
{{- else -}}
{{- .Destination | safeURL -}}
{{- end -}}"
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}>
{{- .Text | safeHTML -}}
</a>

{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}
2 changes: 1 addition & 1 deletion vault
Submodule vault updated from dfa113 to 96c297

0 comments on commit c9e0c96

Please sign in to comment.