-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcommands.html
More file actions
213 lines (145 loc) · 5.97 KB
/
commands.html
File metadata and controls
213 lines (145 loc) · 5.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
===
title: Command Line
subtitle: working with hyde
created: 2011-01-27 11:02:43
toc: getting started
index: 3
===
§§ blurb
The hyde command line supports these subcommands:
1. create - Initializes a new site at a given path
2. gen - Generates the website to a configured deploy folder
3. serve - Starts a local http server that regenerates based on the
requested file
4. publish - Publishes the generated site based on configuration.
§§ /blurb
## The create command
Creates a new hyde website.
~~~sh~~~
hyde create
hyde [-s </site/path>] [-v] create [-l <layout>] [-f] [-h]
~~~~~~~~
`-s SITEPATH, --sitepath SITEPATH`
: Where the site must be created.
Path must not exist. If it exists then the `-f` option must be specified
to overwrite the folder.
*Optional* - defaults to current working directory - in this case it
requires the `-f` parameter.
`-f, --force`
: Specifying this option will overwrite files and folders at the given
site path.
*Optional* - If the target directory contains another Hyde site, hyde will
throw an exception unless this is specified.
`-l LAYOUT, --layout LAYOUT`
: The name of the layout to use for creating the initial site. Hyde currently
has three layouts: `basic`, `test` and `doc`.
While basic and test are really barebones, doc is the one that generates
this documentation and is completely usable. Hyde will get more layouts
over time.
Hyde tries to locate the specified layout in the following folders:
1. In `layouts` folder under the path specified by the `HYDE_DATA`
environment variable
2. In `layouts` folder under hyde
*Optional* - defaults to `basic`
Assuming the `HYDE_DATA` environment variable is empty and the folder
`~/test` is empty, the following command will create a new hyde site
at `~/test` with the contents of `layouts/doc` folder:
~~~sh~~~
hyde -s ~/test create -l doc
~~~~~~~~
`-v, --verbose`
: Logs detailed messages to the console.
*Optional* - shows only essential messages if this option is omitted.
`-h`
: Displays the help text for the `create` command.
## The generate command
Generates the given website.
~~~sh~~~
hyde gen
hyde [-s <site/path>] [-v] gen [-r] [-d <deploy/path>] [-c <config/path>] [-h]
~~~~~~~~
`-s SITEPATH, --sitepath SITEPATH`
: The path to the site to be generated.
*Optional* - defaults to current working directory.
`-r, --regen`
: Regenerate the entire website. By default hyde performs incremental
generation. While hyde does a good job at understanding the dependencies,
its far from perfect. When there are cases where the incremental
generation does not yield the desired results, you can provide this option
to generate the website from scratch.
*Optional* - defaults to incremental generation.
`-d DEPLOY_PATH, --deploy-path DEPLOY_PATH`
: Location where the site should be generated. This option overrides any
setting specified in the hyde [configuration][]. The path is assumed to
be relative to the site path unless a preceding path separator is found.
*Optional* - Uses what is specified in the config file. The default option
in the configuration file is: `deploy` folder under the current site path.
`-c CONFIG, --config-path CONFIG`
: This is used for specifying an alternate configuration file to use for
generating the site. This is useful if you have two different configurations
for you production versus development websites.
The path is assumed to be relative to the site path unless a preceding path
separator is found.
*Optional* - defaults to `site.yaml`
The following command will use `production.yaml` as the configuration file and
generate the website at `~/test` to `~/production_site` directory.
~~~sh~~~
cd ~/test
hyde gen -c production.yaml -d ~/production_site
~~~~~~~~
`-v, --verbose`
: Logs detailed messages to the console.
*Optional* - shows only essential messages if this option is omitted.
`-h`
: Displays the help text for the `gen` command.
## The serve command
Starts the built in web server that also regenerates based on the request if there are
changes.
~~~sh~~~
hyde serve
hyde [-s </site/path>] [-v] gen [-d </deploy/path>] [-c <config/path>] [-h]
~~~~~~~~
`-s SITEPATH, --sitepath SITEPATH`
`-d DEPLOY_PATH, --deploy-path DEPLOY_PATH`
`-c CONFIG, --config-path CONFIG`
: Since the `serve` command auto generates if there is a need, it needs
the same parameters as the `gen` command. The above parameters serve
the same purpose here as in the `gen` command.
`-a ADDRESS, --address ADDRESS`
: The address to serve the website.
*Optional* - defaults to `localhost`
`-p PORT, --port`
: The port to serve the website.
*Optional* - defaults to `8080`
The following command will serve the website at `http://localhost:8181`
~~~sh~~~
cd ~/test
hyde serve -p 8181
~~~~~~~~
`-h`
: Displays the help text for the `serve` command.
## The publish command
Publishes the site based on configuration. Currently the only supported
publishing target is a git repository. See the [publisher documentation][pub]
for more information.
~~~~sh~~~~~
hyde [-s </site/path>] [-v] publish -p <conf> [-m <msg>] [-c <config/path>] [-h]
~~~~~~~~~~~
`-s SITEPATH, --sitepath SITEPATH`
: The path to the site to be generated.
*Optional* - defaults to current working directory.
`-p CONFIG`
: This should point to a configuration section in the site configuration
that has the settings for the publisher. For example:
The following configuration (taken from this site), when invoked with
`hyde publish -p github` will use the Git publisher to publish the
generated site to `hyde/hyde.github.com` repository.
~~~yaml~~~~
publisher:
github:
type: hyde.ext.publishers.dvcs.Git
path: ../hyde.github.com
url: git@github.com:hyde/hyde.github.com.git
~~~~~~~~~~
[configuration]: [[config]]
[pub]: [[publisher]]