diff --git a/dir-index.html b/dir-index.html index c4da35a76f47621496f9cd0fa0df89446a87e71c..7c3b65907b417bca54ab7d1a55239d0daed8e65e 100644 --- a/dir-index.html +++ b/dir-index.html @@ -1,4 +1,5 @@ +{{ $root := . }} @@ -44,7 +45,7 @@ Index of {{ range .Breadcrumbs -}} - /{{ if .Path }}{{ .Name }}{{ else }}{{ .Name }}{{ end }} + /{{ if .Path }}{{ .Name }}{{ else }}{{ .Name }}{{ end }} {{- else }} {{ .Path }} {{ end }} @@ -83,7 +84,7 @@ {{ if .Hash }} - + {{ .ShortHash }} {{ end }} diff --git a/test/main.go b/test/main.go index 625456ed92520d09e83cabf77ef08a0792e78074..3c73cf49b9d693a30597fd4e653233657f136338 100644 --- a/test/main.go +++ b/test/main.go @@ -12,6 +12,7 @@ const templateFile = "../dir-index.html" // Copied from go-ipfs/core/corehttp/gateway_indexPage.go type listingTemplateData struct { + GatewayURL string Listing []directoryItem Size string Path string @@ -35,6 +36,7 @@ type breadcrumb struct { var testPath = "/ipfs/QmFooBarQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7/a/b/c" var testData = listingTemplateData{ + GatewayURL: "//localhost:3000", Listing: []directoryItem{{ Size: "25 MiB", Name: "short-film.mov",