Skip to content

Commit

Permalink
Bump version of dir-index-html
Browse files Browse the repository at this point in the history
Based on ipfs#1615

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
  • Loading branch information
rht committed Sep 4, 2015
1 parent 93e9f84 commit 15dd035
Show file tree
Hide file tree
Showing 17 changed files with 164 additions and 76 deletions.
14 changes: 4 additions & 10 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ func SeedInitDocs(nd *core.IpfsNode) (*key.Key, error) {
}

var initDirIndex = []string{
"../vendor/src/QmeMZwyPnHMkvgdUNtdNcTX425gTCi5DCMeHLwTXbKoUB8/dir-index-html/knownIcons.txt",
"../vendor/src/QmeMZwyPnHMkvgdUNtdNcTX425gTCi5DCMeHLwTXbKoUB8/dir-index-html/dir-index.html",
"../vendor/dir-index-html-v1.0.0/knownIcons.txt",
"../vendor/dir-index-html-v1.0.0/dir-index.html",
}

var initGwAssets = []string{
"gw-assets/icons.css",
"gw-assets/bootstrap.min.css",
}

// SeedGatewayAssets adds the list of embedded gateway inidex assets to the passed node, pins it and returns the root key
func SeedGatewayAssets(nd *core.IpfsNode) (*key.Key, error) {
return addAssetList(nd, initGwAssets)
func SeedInitDirIndex(nd *core.IpfsNode) (*key.Key, error) {
return addAssetList(nd, initDirIndex)
}

func addAssetList(nd *core.IpfsNode, l []string) (*key.Key, error) {
Expand Down
4 changes: 0 additions & 4 deletions assets/assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ func TestEmbeddedDocs(t *testing.T) {
testNFiles(initDocPaths, 6, t, "documents")
}

func TestGatewayAssets(t *testing.T) {
testNFiles(initGwAssets, 2, t, "assets")
}

func TestDirIndex(t *testing.T) {
testNFiles(initDirIndex, 2, t, "assets")
}
Expand Down
144 changes: 93 additions & 51 deletions assets/bindata.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/gw-assets

This file was deleted.

7 changes: 1 addition & 6 deletions cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,11 @@ func addDefaultAssets(out io.Writer, repoRoot string) error {
}
defer nd.Close()

gwAkey, err := assets.SeedGatewayAssets(nd)
if err != nil {
return fmt.Errorf("init: seeding init docs failed: %s", err)
}
log.Debugf("init: seeded gateway assets %s", gwAkey)

dkey, err := assets.SeedInitDocs(nd)
if err != nil {
return fmt.Errorf("init: seeding init docs failed: %s", err)
}
log.Debugf("init: seeded init docs %s", dkey)

if _, err = fmt.Fprintf(out, "to get started, enter:\n"); err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions core/corehttp/gateway_indexPage.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package corehttp

import (
"github.com/ipfs/go-ipfs/assets"
"html/template"
"path"
"strings"

"github.com/ipfs/go-ipfs/assets"
)

// structs for directory listing
Expand All @@ -23,7 +24,7 @@ type directoryItem struct {
var listingTemplate *template.Template

func init() {
assetPath := "../vendor/src/QmeMZwyPnHMkvgdUNtdNcTX425gTCi5DCMeHLwTXbKoUB8/dir-index-html/"
assetPath := "../vendor/dir-index-html-v1.0.0/"
knownIconsBytes, err := assets.Asset(assetPath + "knownIcons.txt")
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dependencies": [
{
"name": "dir-index-html",
"hash": "QmeMZwyPnHMkvgdUNtdNcTX425gTCi5DCMeHLwTXbKoUB8"
"hash": "QmdDfkqDWheE4gsCXNrhixwTwSHnZMPT2cGLcNbiBNcMyU"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
QmeZ95gjQtxEbMbnttTiViadqjVb2JDZqQDsYQA4BBZpE4

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vendor/dir-index-html-v1.0.0

This file was deleted.

0 comments on commit 15dd035

Please sign in to comment.