TentBnB, an app for tents
Just a prank for my friends. Nothing serious here.
Using Angular & Google Maps
See it live here
Always useful: angular to gh pages
Create js file with code from websemantics/gh-pages-spa.
Just copy the code from this file here, and
paste it in a file named ghspa.js (or however else you like) that you place in the src/
folder of your app. On the same level as
index.html
.
Create a 404
page with code from websemantics/gh-pages-spa.
Just copy the code from this file here, and
paste it in a file named 404.html that you place in the src/
folder of your app. On the same level as
index.html
.
Edit your index.html
file. Add these at the bottom of the <head>
tag.
redirect
variable<script>var redirect = location.href</script>
ghspa.js
file<script type="text/javascript" src="ghspa.js"></script>
Set <base>
to '/' (in <head>
tag):
<base href="/">
In angular-cli.json
, in the "assets" array within the "apps" array, add
your two new files, in order to be included in the build. Result should look something
like this, for example:
...
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
"404.html",
"spaghpages.js"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
...
In your terminal, run the following command, as seen here. Remember, it will only work if you specify the whole URL (https://yourusername.github.io/YourProject/)
ng build --prod --output-path docs --base-href https://yourusername.github.io/YourProject/
As mentioned in the angular-cli relevant tutorial here, commit your changes and push. On the GitHub project page, configure it to publish from the docs folder.