cupper-hugo-theme/content/patterns/serving.md

28 lines
1.3 KiB
Markdown
Raw Normal View History

2017-06-27 21:15:38 +02:00
+++
title = "Serving"
+++
## Serving locally
While you're creating content for your library, you'll probably want to see what the finished product looks like. Fortunately, **Infusion** is easy to serve locally using the `serve` command:
{{<cmd>}}npm run serve{{</cmd>}}
2017-07-03 19:24:38 +02:00
This will serve your working library from `localhost:1313` (the exact URL will be determined by what's in your `baseURL` and will be revealed to you by your terminal). Whenever you make changes to your library's files, the site will automatically rebuild. No need to refresh the web page!
## Publishing on Github Pages
2017-07-03 21:02:40 +02:00
**Infusion** creates a `/docs` folder containing the latest version of your library whenever you do an `npm run build` or a `git commit`. This folder can be made the source for your Github Pages site by selecting it under **Settings → Github Pages → Source** in the web interface.
2017-07-03 19:24:38 +02:00
2017-07-03 20:56:19 +02:00
![The publishing source dropdown menu on Github](/images/serve_from_docs.png)
2017-07-03 21:02:40 +02:00
Then, whenever you push to master, you will also be updating the site found at your Github Pages URL.
This URL will be in the following format:
```
2017-07-05 11:30:01 +02:00
[your user name].github.io/[your library repo name]
2017-07-03 21:02:40 +02:00
```
You'll also need to add it to your `config.toml` file. See {{% pattern "Library setup" %}} for more information.