Skip to content

Commit

Permalink
La appen fungere selv om den blir servet fra subdirectory (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornreppen authored Apr 10, 2019
1 parent 761fa15 commit 585396f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ directories:
- node_modules
script:
- yarn test
- yarn build
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- export PUBLIC_URL=https://nin.artsdatabanken.no/$(if [ "$BRANCH" == "master" ]; then echo ""; else echo $BRANCH; fi)
- yarn build
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
before_deploy:
- git tag "$(date +'%Y%m%d-%H%M%S')-$(git log --format=%h -1)"
Expand Down
47 changes: 26 additions & 21 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0">
<meta name="theme-color" content="#000000">
<!--
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -21,15 +26,16 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Natur i Norge</title>
</head>
<base href="%PUBLIC_URL%/" />
<title>Natur i Norge</title>
</head>

<body style="margin: 0">
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
<body style="margin: 0">
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -39,6 +45,5 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>

</html>
</body>
</html>
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const theme = createMuiTheme({
const App = () => {
return (
<MuiThemeProvider theme={theme}>
<BrowserRouter>
<BrowserRouter baseName={process.env.PUBLIC_URL}>
<SettingsContainer>
<ResponsivtVindu>
<Grunnkart />
Expand Down

0 comments on commit 585396f

Please sign in to comment.