From 23e4bfe25832dcaea3df6868552c68c7ce0d32c6 Mon Sep 17 00:00:00 2001 From: Heydon Pickering Date: Thu, 29 Jun 2017 09:53:55 +0100 Subject: [PATCH] better serving advice --- content/patterns/serving.md | 20 +++++++++++++++++--- public/patterns/serving/index.html | 2 +- themes/infusion/layouts/_default/baseof.html | 3 ++- themes/infusion/static/css/styles.css | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/content/patterns/serving.md b/content/patterns/serving.md index 3baf7e4..7cba17c 100644 --- a/content/patterns/serving.md +++ b/content/patterns/serving.md @@ -12,12 +12,26 @@ This will serve your working library on `localhost:1313`. Whenever you make chan ## Publishing on Github Pages -The easiest way to host your pattern library so you have a link to share is to run the `host` command. This will build the library and push it to the local Github repository's `gh-pages` branch. Before you can use `host` you will need to commit any changes you made on the master branch. Otherwise there's nothing new to push over to the `gh-pages` branch. +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. + +```html +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](https://drastudio.github.io/url-generator/). + +### 2. Commit your latest changes + +On the (default) master branch run: {{}}git commit -am "my commit message"{{}} -This will ensure changes go through to `gh-pages`. Now you can run: +### 3. Run the `host` command {{}}npm run host{{}} -You should now be able to find a "live" version of your library at `github.io/[your username]/[your library repo name]`. +You should now be able to find a "live" version of your library at `[your user name].github.io/[your library repo name]`. diff --git a/public/patterns/serving/index.html b/public/patterns/serving/index.html index da19e29..351c563 100644 --- a/public/patterns/serving/index.html +++ b/public/patterns/serving/index.html @@ -192,7 +192,7 @@

Publishing on Github Pages

-

The easiest way to host your pattern library so you have a link to share is to run the host command. This will build the library and push it to the local Github repository’s gh-pages branch. Before you can use host you will need to commit any changes you made on the master branch:

+

The easiest way to host your pattern library so you have a link to share is to run the host command. This will build the library and push it to the local Github repository’s gh-pages branch. Before you can use host you will need to commit any changes you made on the master branch. Otherwise there’s nothing new to push over to the gh-pages branch.

git commit -am "my commit message"
diff --git a/themes/infusion/layouts/_default/baseof.html b/themes/infusion/layouts/_default/baseof.html index 80959f6..94425c4 100644 --- a/themes/infusion/layouts/_default/baseof.html +++ b/themes/infusion/layouts/_default/baseof.html @@ -64,7 +64,8 @@ {{ block "main" . }} {{ end }} diff --git a/themes/infusion/static/css/styles.css b/themes/infusion/static/css/styles.css index 0d93ccb..93679de 100644 --- a/themes/infusion/static/css/styles.css +++ b/themes/infusion/static/css/styles.css @@ -224,6 +224,8 @@ th:empty { [role="contentinfo"] { font-size: 0.85rem; + margin-top: 4rem; + text-align: center; } /* Patterns navigation */