diff options
author | Marcia Ramos <virtua.creative@gmail.com> | 2018-01-19 21:45:01 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-01-19 21:45:01 +0300 |
commit | 4ed102c207b160ae4a75ca5e408e7b6094229c58 (patch) | |
tree | 45b790249636b021db54d7183912b25e1b461157 /README.md | |
parent | 95e12e1123069e20cd630478859ade65cc74a9d7 (diff) |
Docs: how to preview the Docs site on mobile devices
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -110,12 +110,30 @@ Now let's make Bundler deal with the dependencies defined in the `Gemfile`: - Switch to Ruby 2.4.0: `rvm 2.4.0` - Run `bundle install` -### Preview the Docs Website +### Preview the Docs website - `bundle exec nanoc live` This will host the site at `localhost:3000`. Changes will be reloaded automatically using [Guard Nanoc](https://github.com/guard/guard-nanoc). +#### Preview on mobile + +If you want to check how your changes look on mobile devices, you can preview the Docs site with +your own devices, as long as they are connected to the same network as your computer. + +To do that, we need to change the IP address Nanoc is serving on from the default `http://127.0.0.1` to your computer's [private IPv4 address](https://www.howtogeek.com/236838/how-to-find-any-devices-ip-address-mac-address-and-other-network-connection-details/). + +Once you know what's your computer's private IPv4, use the flag `-o` with the command +`nanoc live`. For example, let's say your current IPv4 address is `192.168.0.105`: + +```shell +bundle exec nanoc live -o 192.168.0.105 +``` + +Now, open your mobile's browser and type `http://192.168.0.105:3000`, and you should +be able to navigate through the docs site. This process applies to preview the docs site +on every device connected to your network. + ### Extra Step To pull down the documentation content, run `rake pull_repos`. If you want to force-delete the `tmp/` and `content/` folders so the task will run without manual intervention, run `RAKE_FORCE_DELETE=true rake pull_repos`. |