cupper-hugo-theme/content/patterns/serving.md
2017-06-29 09:53:55 +01:00

1.2 KiB

+++ 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:

{{}}npm run serve{{}}

This will serve your working library on localhost:1313. 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

There are three steps to hosting your library on Github Pages.

1. Edit the baseURL

Open up config.toml (at the root of your library project folder) and make sure baseURL matches your Github Pages URL.

baseURL = "[your user name].github.io/[your library repo name]"

If you are having trouble working out your Github Pages URL, this tool may help.

2. Commit your latest changes

On the (default) master branch run:

{{}}git commit -am "my commit message"{{}}

3. Run the host command

{{}}npm run host{{}}

You should now be able to find a "live" version of your library at [your user name].github.io/[your library repo name].