Fixed path handling for hack files
This commit is contained in:
parent aa6fc20977
commit 2f94d3bcdf
1 changed files with 3 additions and 4 deletions
| @ -1,5 +1,5 @@ | |||
{{ $filename := .Get "file" }} | ||||
{{ $file := path.Join (path.Dir $.Page.File) $filename }} | ||||
{{ $file := path.Join .Page.Path $filename }} | ||||
{{ $ext := strings.TrimLeft "." (path.Ext $file) }} | ||||
{{ if strings.HasSuffix $file ".blade.php" }} | ||||
{{ $ext = "html" }} | ||||
| @ -8,7 +8,6 @@ | |||
{{ $md := printf "```%s\n%s\n```" $ext (readFile $file) }} | ||||
{{ $mdLen := len (split $md "\n") }} | ||||
| ||||
| ||||
<div class="hack-file-wrapper"> | ||||
| ||||
| ||||
| @ -17,8 +16,8 @@ | |||
<div class="hack-file-block-filename">{{ $filename }}</div> | ||||
| ||||
<div class="hack-file-block-type type-{{ $type }}"> | ||||
<a target="_blank" href="/{{ path.Join (path.Dir $.Page.File) $filename }}">Download</a> | | ||||
<a target="_blank" href="/hacks/applying/#{{ if eq $type "logical"}}logical-theme-system{{ else if eq $type "visual"}}visual-theme-system{{ else if eq $type "head"}}head-html{{end}}" target="_blank"> | ||||
<a target="_blank" href="{{ $file }}">Download</a> | | ||||
<a target="_blank" href="/hacks/applying/#{{ if eq $type "logical"}}logical-theme-system{{ else if eq $type "visual"}}visual-theme-system{{ else if eq $type "head"}}head-html{{end}}"> | ||||
{{ if eq $type "logical"}} | ||||
Logical Theme System | ||||
{{ else if eq $type "visual"}} | ||||
| |
Loading…
Add table
Add a link
Reference in a new issue