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
+36-5Lines changed: 36 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,13 +70,17 @@ Open `~/.config/til/config.yml`, change the following entries, and save it:
70
70
* committerEmail
71
71
* committerName
72
72
* editor
73
-
* targetDirectory
73
+
* targetDirectories
74
74
75
75
`committerEmail` and `committerName` are the values `til` will use to commit changes with when you run `til -save`.
76
76
77
77
`editor` is the text editor `til` will open your file in when you run `til [some title here]`.
78
78
79
-
`targetDirectory` is where `til` will write your files to. If the target directory does not exist, `til` will try to create it.
79
+
`targetDirectories` defines the locations that `til` will write your files to. If a specified target directory does not exist, `til` will try to create it. This is a map of key/value pairs, where the "key" defines the value to pass in using the `-target` flag, and the "value" is the path to the directory.
80
+
81
+
If only one target directory is defined in the configuration, the `-target` flag can be ommitted from all commands.
82
+
If multiple target diretories are defined in the configuration, all commands must include the `-target` flag specifying
With one target directory defined in the configuration:
105
+
98
106
```bash
99
107
❯ til New title here
100
108
2020-04-20T14-52-57-new-title-here.md
101
109
```
102
110
111
+
With multiple target directories defined:
112
+
113
+
```bash
114
+
❯ til -target a New title here
115
+
2020-04-20T14-52-57-new-title-here.md
116
+
```
117
+
103
118
That new page will open in whichever editor you've defined in your config.
104
119
105
120
### Building static pages
106
121
122
+
With one target directory defined in the configuration:
123
+
107
124
```bash
108
125
❯ til -build
109
126
```
110
127
128
+
With multiple target directories defined:
129
+
130
+
```bash
131
+
❯ til -target a -build
132
+
```
133
+
111
134
Builds the index and tag pages, and leaves them uncommitted.
112
135
113
136
<palign="center"><imgsrc="images/til_build.png"width="600"height="213"alt="image of the build process"title="til -build" /></p>
114
137
115
138
### Building, saving, committing, and pushing
116
139
140
+
With one target directory defined in the configuration:
141
+
117
142
```bash
118
143
❯ til -save [optional commit message]
119
144
```
120
145
146
+
With multiple target directories defined:
147
+
148
+
```bash
149
+
❯ til -target a -save [optional commit message]
150
+
```
151
+
121
152
Builds the index and tag pages, commits everything to the git repo with the commit message you've defined in your config, and pushes it all up to the remote repo.
122
153
123
-
`-save` makes a hard assumption that your `targetDirectory`is under version control, controlled by `git`. It is highly recommended that you do this.
154
+
`-save` makes a hard assumption that your target directory is under version control, controlled by `git`. It is recommended that you do this.
124
155
125
-
`-save` also makes a soft assumption that your `targetDirectory` has `remote` set to GitHub (but it should work with `remote` set to anywhere).
156
+
`-save` also makes a soft assumption that your target directory has `remote` set to GitHub (but it should work with `remote` set to anywhere).
126
157
127
158
`-save` takes an optional commit message. If that message is supplied, it will be used as the commit message. If that message is not supplied, the `commitMessage` value in the config file will be used. If that value is not supplied, an error will be raised.
0 commit comments