mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-05 16:28:06 +08:00
Minified file to top level, changes scripts and test accordingly
This commit is contained in:
parent
39d74cd3fe
commit
02bcd0481f
@ -17,7 +17,7 @@
|
||||
When making updates to the directory listing page template, please note the following:
|
||||
|
||||
1. Make your changes to the (human-friendly) source documents in the `src` directory
|
||||
2. Before testing or releasing, make sure to run the build script to generate a minified version in the `dist` directory:
|
||||
2. Before testing or releasing, make sure to run the build script to update the minified version in the top-level directory:
|
||||
|
||||
```bash
|
||||
> npm run build
|
||||
|
||||
10
package.json
10
package.json
@ -18,10 +18,10 @@
|
||||
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
|
||||
"scripts": {
|
||||
"build": "npm run build:clean && npm run build:remove-style-links && npm run build:minify-wrap-css && npm run build:combine-html-css && npm run build:remove-unused",
|
||||
"build:clean": "rm -rf ./dist/*",
|
||||
"build:remove-style-links": "sed '/<link rel=\"stylesheet\"/d' ./src/dir-index.html > ./dist/base-html.html",
|
||||
"build:minify-wrap-css": "(echo \"<style>\" && cat ./src/icons.css ./src/style.css | tr -d \"\t\n\r\" && echo -e \"\\n</style>\") > ./dist/minified-wrapped-style.html",
|
||||
"build:combine-html-css": "sed '/<head>/ r ./dist/minified-wrapped-style.html' ./dist/base-html.html > ./dist/dir-index.html",
|
||||
"build:remove-unused": "rm ./dist/base-html.html && rm ./dist/minified-wrapped-style.html"
|
||||
"build:clean": "rm dir-index.html",
|
||||
"build:remove-style-links": "sed '/<link rel=\"stylesheet\"/d' ./src/dir-index.html > ./base-html.html",
|
||||
"build:minify-wrap-css": "(echo \"<style>\" && cat ./src/icons.css ./src/style.css | tr -d \"\t\n\r\" && echo -e \"\\n</style>\") > ./minified-wrapped-style.html",
|
||||
"build:combine-html-css": "sed '/<head>/ r ./minified-wrapped-style.html' ./base-html.html > ./dir-index.html",
|
||||
"build:remove-unused": "rm ./base-html.html && rm ./minified-wrapped-style.html"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"text/template"
|
||||
)
|
||||
|
||||
const templateFile = "../dist/dir-index.html"
|
||||
const templateFile = "../dir-index.html"
|
||||
|
||||
// Copied from go-ipfs/core/corehttp/gateway_indexPage.go
|
||||
type listingTemplateData struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user