Extract hardcoded URL to danilafe.com into a site param.
This commit is contained in:
parent
e82879434e
commit
c728748106
|
@ -1,6 +1,6 @@
|
|||
{{ $scratch := .scratch }}
|
||||
{{ $scratch.Set "bestLength" -1 }}
|
||||
{{ $scratch.Set "bestUrl" (printf "https://dev.danilafe.com/Web-Projects/blog-static/src/branch/master/code/%s" .path) }}
|
||||
{{ $scratch.Set "bestUrl" (printf "%s/code/%s" .siteSourceUrl .path) }}
|
||||
{{ $filePath := .path }}
|
||||
{{ range $module, $props := .submoduleLinks }}
|
||||
{{ $path := index $props "path" }}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "highlightgroup.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 1) "comment" ", entire file" "code" (readFile (printf "code/%s" (.Get 1))) "language" (.Get 0) "opts" "linenos=table") }}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{ .Scratch.Set "opts" "" }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 1) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "linerangestr.html" (dict "scratch" .Scratch "from" (.Get 2) "to" (.Get 3)) }}
|
||||
|
||||
{{ partial "highlightgroup.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 1) "comment" (.Scratch.Get "comment") "code" (delimit $lines "\n") "language" (.Get 0) "opts" (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts"))) }}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 0) "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "geturl.html" (dict "scratch" .Scratch "path" (.Get 0) "siteSourceUrl" .Site.Params.siteSourceUrl "submoduleLinks" .Site.Params.submoduleLinks) }}
|
||||
{{ partial "group.html" (dict "url" (.Scratch.Get "bestUrl") "path" (.Get 0) "comment" ", entire file" "content" (safeHTML (printf "<pre><code>%s</code></pre>" (htmlEscape (readFile (printf "code/%s" (.Get 0))))))) }}
|
||||
|
|
Loading…
Reference in New Issue
Block a user