Allow the site static content to be built on netlify (#3015)

This commit is contained in:
Kevin Simper 2019-01-03 16:49:44 +01:00 committed by istio-bot
parent 51f878a914
commit e5e8875a5e
5 changed files with 2701 additions and 17 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ tmp/
.htmlproofer
public
resources
node_modules

2657
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

29
package.json Normal file
View File

@ -0,0 +1,29 @@
{
"name": "istio.io",
"version": "1.0.0",
"description": "This repository contains the source code for the [istio.io](https://istio.io), [preliminary.istio.io](https://preliminary.istio.io) and [archive.istio.io](https://archive.istio.io) sites.",
"main": "index.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/istio/istio.io.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/istio/istio.io/issues"
},
"homepage": "https://github.com/istio/istio.io#readme",
"devDependencies": {
"markdown-spellcheck": "^1.3.1",
"sass": "^1.15.2",
"svgstore-cli": "^1.3.1",
"uglify-js": "^3.4.9"
}
}

View File

@ -27,11 +27,10 @@ RUN tar -xf /tmp/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz -C /tmp \
&& rm -rf /tmp/LICENSE.md \
&& rm -rf /tmp/README.md
RUN npm install -g \
sass \
uglify-js \
markdown-spellcheck \
svgstore-cli
COPY package.json .
COPY package-lock.json .
RUN npm install
RUN gem install \
mdl \

View File

@ -1,18 +1,16 @@
#!/usr/bin/env sh
set -e
echo -ne "sass "
sass --version
uglifyjs --version
mkdir -p static/css static/js static/img
sass src/sass/light_theme_archive.scss light_theme_archive.css -s compressed
sass src/sass/light_theme_normal.scss light_theme_normal.css -s compressed
sass src/sass/light_theme_preliminary.scss light_theme_preliminary.css -s compressed
sass src/sass/dark_theme_archive.scss dark_theme_archive.css -s compressed
sass src/sass/dark_theme_normal.scss dark_theme_normal.css -s compressed
sass src/sass/dark_theme_preliminary.scss dark_theme_preliminary.css -s compressed
npx sass src/sass/light_theme_archive.scss light_theme_archive.css -s compressed
npx sass src/sass/light_theme_normal.scss light_theme_normal.css -s compressed
npx sass src/sass/light_theme_preliminary.scss light_theme_preliminary.css -s compressed
npx sass src/sass/dark_theme_archive.scss dark_theme_archive.css -s compressed
npx sass src/sass/dark_theme_normal.scss dark_theme_normal.css -s compressed
npx sass src/sass/dark_theme_preliminary.scss dark_theme_preliminary.css -s compressed
mv light_theme* static/css
mv dark_theme* static/css
uglifyjs src/js/misc.js src/js/utils.js src/js/prism.js --mangle --compress -o static/js/all.min.js --source-map
uglifyjs src/js/styleSwitcher.js --mangle --compress -o static/js/styleSwitcher.min.js --source-map
svgstore -o static/img/icons.svg src/icons/**/*.svg
npx uglifyjs src/js/misc.js src/js/utils.js src/js/prism.js --mangle --compress -o static/js/all.min.js --source-map
npx uglifyjs src/js/styleSwitcher.js --mangle --compress -o static/js/styleSwitcher.min.js --source-map
npx svgstore -o static/img/icons.svg src/icons/**/*.svg