mirror of
https://github.com/Polymer/polymer-starter-kit.git
synced 2025-02-25 18:55:22 -06:00
This change reduces confusion about using backslashes or not in the URL and is generally more helpful to new comers.
1.3 KiB
1.3 KiB
Deploy to Github Pages
You can deploy to github pages with a couple minor changes to Polymer Starter Kit:
- Uncomment this line
// app.baseUrl = '/polymer-starter-kit/';in app.js near the top
// Sets app default base URL
app.baseUrl = '/';
if (window.location.port === '') { // if production
// Uncomment app.baseURL below and
// set app.baseURL to '/your-pathname/' if running from folder in production
// app.baseUrl = '/polymer-starter-kit/';
}
-
Change
app.baseUrl = '/polymer-starter-kit/';toapp.baseUrl = '/your-pathname/';(ex: if you repo isgithub.com/username/bobs-awesome-siteyou would change this toapp.baseUrl = '/bobs-awesome-site/';) -
Add this code at the top of
<head>tag in the index.html to force HTTPS:
<script>'https:'!==window.location.protocol&&(window.location.protocol='https')</script>
-
Run
gulp build-deploy-gh-pagesfrom command line -
To see changes wait 1-2 minutes then load Github pages for your app (ex: https://polymerelements.github.io/polymer-starter-kit)
Notes
- When deploying to Github Pages we recommend using hashbangs which is Polymer Starter Kit default.
- This method should work for most hosting providers when using a subfolder.