зеркало из
1
0
Форкнуть 0

Trying a precompile to static html.

This commit is contained in:
ScottDowne 2016-10-25 16:28:43 -04:00
Родитель a0e7a0b140
Коммит c7dcc20c97
5 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -8,7 +8,7 @@
}, },
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"prebuild": "shx rm -rf dist && shx mkdir dist && shx cp -r src/assets dist/assets && shx cp src/index.html dist/index.html", "prebuild": "shx rm -rf dist && shx mkdir dist && shx cp -r src/assets dist/assets && shx cp src/index.html dist/index.html && shx mkdir dist/about && shx cp -r src/index.html dist/about/index.html && shx mkdir dist/curriculum && shx cp -r src/index.html dist/curriculum/index.html && shx mkdir dist/contact && shx cp -r src/index.html dist/contact/index.html && shx mkdir dist/tools && shx cp -r src/index.html dist/tools/index.html",
"build": "npm run build:css && npm run build:js", "build": "npm run build:css && npm run build:js",
"build:css": "node-sass src/index.scss dist/compiled.css --output-style=compressed && postcss --use autoprefixer --autoprefixer.browsers 'last 3 versions' -o dist/compiled.css dist/compiled.css", "build:css": "node-sass src/index.scss dist/compiled.css --output-style=compressed && postcss --use autoprefixer --autoprefixer.browsers 'last 3 versions' -o dist/compiled.css dist/compiled.css",
"build:js": "webpack --optimize-minimize", "build:js": "webpack --optimize-minimize",

Просмотреть файл

@ -7,7 +7,7 @@ class Header extends React.Component {
<div className="container"> <div className="container">
<div className="row"> <div className="row">
<a className="mozilla-logo" href="https://www.mozilla.org"> <a className="mozilla-logo" href="https://www.mozilla.org">
<img src="assets/mozilla-wordmark.svg" target="_blank" /> <img src="/assets/mozilla-wordmark.svg" target="_blank" />
</a> </a>
<h1 className="col-xs-12">Localizing Curriculum</h1> <h1 className="col-xs-12">Localizing Curriculum</h1>
<p className="header-subtitle m-t-1 col-xs-12 col-lg-10 col-lg-push-1 col-xl-8 col-xl-push-2">Let's teach curriculum globally</p> <p className="header-subtitle m-t-1 col-xs-12 col-lg-10 col-lg-push-1 col-xl-8 col-xl-push-2">Let's teach curriculum globally</p>

Просмотреть файл

@ -7,12 +7,12 @@
<title>Mozilla Learning Curriculum Localization</title> <title>Mozilla Learning Curriculum Localization</title>
<link rel="stylesheet" href="//code.cdn.mozilla.net/fonts/fira.css"> <link rel="stylesheet" href="//code.cdn.mozilla.net/fonts/fira.css">
<link rel="stylesheet" href="./compiled.css"> <link rel="stylesheet" href="/compiled.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
<script src="./compiled.js"></script> <script src="/compiled.js"></script>
</html> </html>

Просмотреть файл

@ -15,7 +15,7 @@ class App extends React.Component {
} }
handleTabChange(event) { handleTabChange(event) {
this.props.history.pushState(this.props.state, `/${ event.slug }`); this.props.history.pushState(this.props.state, `/${ event.slug }/`);
} }
componentDidUpdate() { componentDidUpdate() {

Просмотреть файл

@ -10,8 +10,8 @@ const ROOT = path.join("/", process.env.WEBSITE_ROOT || "");
const routes = ( const routes = (
<Route path={ ROOT }> <Route path={ ROOT }>
<IndexRedirect to="about" /> <IndexRedirect to="about/" />
<Route path=":tab" component={ App } /> <Route path=":tab/" component={ App } />
</Route> </Route>
); );