You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-98Lines changed: 21 additions & 98 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,39 +19,50 @@ Theme courtesy of https://mmistakes.github.io/so-simple-theme/
19
19
20
20
Test your additions and changes to content by running a local build.
21
21
22
-
To prepare your environment to build locally, you need to install brew, bundler.io, and Ruby version manager:
22
+
On macOS after Catalina, you can
23
+
24
+
On a macOS prior to Catalina, you need to install brew, bundler.io, and Ruby version manager:
23
25
24
26
1. Use brew to install a Ruby version manager.
25
27
26
28
```
27
29
$ brew install rbenv ruby-build
28
30
```
29
31
30
-
1. Add rbenv to bash so that it loads every time you open a terminal.
32
+
1. Add rbenv to bash so that it loads every time you open a terminal. If you are using macOS Catalina, your profile file may be `.zshrc`.
31
33
32
34
```
33
35
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
34
36
```
37
+
or
38
+
```
39
+
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
40
+
```
35
41
36
-
1. Source your `.bash_profile` file.
42
+
1. Source your `.bash_profile` file. If you are using macOS Catalina, your profile file may be `.zshrc`.
37
43
38
44
```
39
45
$ source ~/.bash_profile
40
46
```
47
+
or
48
+
```
49
+
$ source ~/.zshrc
50
+
```
41
51
42
-
1. Install the version Ruby we need:
52
+
1. Install the required Ruby version:
43
53
44
54
```
45
-
$ rbenv install 2.3.1
46
-
$ rbenv global 2.3.1
47
-
$ ruby -v
55
+
$ rbenv install 2.7.1
56
+
$ rbenv global 2.7.1
57
+
$ rbenv version
48
58
```
49
-
59
+
In return, you should see `ruby 2.7.1 2.7.1 (set by /Users/username/docslikecode/.ruby-version`.
60
+
50
61
1. Run `gem install bundle` to install the bundler gem, which helps with Ruby dependencies.
51
62
1. Run `bundle install` the first time you are in the `docslikecode` directory.
52
63
53
64
To build locally:
54
-
Once you have completed preparing your environment, then you can build locally and review the site in your browser.
65
+
Once you have completed preparing your environment, then you can build locally and review the site in your browser.
55
66
56
67
1. Run the serve command.
57
68
@@ -62,93 +73,5 @@ Once you have completed preparing your environment, then you can build locally a
62
73
1. Use the **Server address** URL `http://127.0.0.1:4000/` in a browser to preview the content.
63
74
1. Press `Ctrl+C` in the serve terminal to stop the server.
64
75
65
-
> ***TIP***
76
+
> ***Tip***
66
77
> Leave the serve terminal open and running. Every time you save changes to a file, it automatically regenerates the site so you can test the output immediately. The only file where changes require a restart is the `_config.yml` file.
67
-
68
-
## To Build Locally (Docker)
69
-
70
-
1. Install [Docker Community Version](https://www.docker.com/community-edition).
71
-
72
-
2. In the root directory where the `docslikecode` repo is cloned, create a file named `Dockerfile` containing:
73
-
74
-
```
75
-
FROM grahamc/jekyll:latest
76
-
77
-
# Install whatever is in your Gemfile
78
-
WORKDIR /tmp
79
-
ADD Gemfile /tmp/
80
-
ADD Gemfile.lock /tmp/
81
-
RUN bundle install
82
-
83
-
# Change back to the Jekyll site directory
84
-
WORKDIR /src
85
-
86
-
```
87
-
3. Create a `_config.dev.yml` file, also in the root directory, containing the following:
88
-
89
-
```
90
-
# Develop override settings
91
-
# Use when building with Docker container and preview.sh script locally
92
-
93
-
url : http://192.168.99.100:4000
94
-
95
-
# Analytics
96
-
analytics:
97
-
provider : false
98
-
```
99
-
100
-
4. Create a `preview.sh` file, also in the root directory, containing the following:
101
-
102
-
```
103
-
#!/usr/bin/env bash
104
-
105
-
# Set to the name of the Docker machine you want to use
106
-
DOCKER_MACHINE_NAME=default
107
-
108
-
# Set to the name of the Docker image you want to use
109
-
DOCKER_IMAGE_NAME=dlc-site
110
-
111
-
# Stop on first error
112
-
set -e
113
-
114
-
# Create a Docker host
115
-
if !(docker-machine ls | grep "^$DOCKER_MACHINE_NAME "); then
5. If using Windows, launch Git Bash to run the `preview.sh` file. If using MacOS, launch a Terminal window to run the `preview.sh` file. Make sure to allow permissions to execute the `preview.sh` file, for example `chmod 600 preview.sh`.
0 commit comments