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: content/posts/170605-static-sites-pelican.markdown
+31-21Lines changed: 31 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,9 +195,13 @@ browser and you will see the first version of your static site.
195
195
196
196
<imgsrc="/img/170605-static-sites-pelican/default-style.png"width="100%"class="technical-diagram img-rounded"style="border:1pxsolid#ccc"alt="Default styling on the Pelican static site.">
197
197
198
-
If you want to kill the development server, Pelican creates a file named
199
-
`pelican.pid` under your project directory with the development server's
200
-
process ID.
198
+
What if you don't have `make` installed on your system? Change into the
199
+
`output` directory and use the `python -m http.server` command to use the
200
+
built-in Python 3 HTTP server for your generated files.
201
+
202
+
When you want to kill the development server look for a file named
203
+
`pelican.pid`under your project directory. The `pelican.pid` file is created
204
+
by Pelican and contains the process ID for your development server.
201
205
202
206
```
203
207
(staticsite) $ cat pelican.pid
@@ -231,11 +235,18 @@ some initial content.
231
235
Pelican can accept both [Markdown](/markdown.html) and reStructureText
232
236
markup files as input.
233
237
234
-
Create a new subdirectory under the `content` named `posts`.
238
+
Create a new subdirectory under the `content` named `posts`. Change into
239
+
the `posts` directory. Create a new file named `first_post.markdown` with
240
+
the following content.
241
+
242
+
```markdown
243
+
...
244
+
```
235
245
246
+
What does our server look like now that we wrote our first post?
236
247
237
248
We used the `make devserver` command earlier, but what other commands are
238
-
available to us?
249
+
available to us via the `Makefile`?
239
250
240
251
241
252
```bash
@@ -274,7 +285,8 @@ WARNING: No valid files found in content.
274
285
Done: Processed 0 articles, 0 drafts, 0 pages and 0 hidden pages in 0.07 seconds.
275
286
```
276
287
277
-
We can serve up the generated site using Python's built-in HTTP server
288
+
If you used the `make devserver` command earlier then give Python's built-in
289
+
HTTP server a shot with the following command.
278
290
279
291
```
280
292
python -m http.server
@@ -294,36 +306,34 @@ Note that if you are using Python 2 the equivalent HTTP server command is
294
306
295
307
296
308
## Edit the Configuration
297
-
Change the time zone to your zone. Wikipedia has
298
-
[a handy look up table of valid time zones values](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
309
+
Pelican's quickstart assumes a bunch of defaults that may or may not be
310
+
applicable to your site. Open up the `pelicanconf.py` file to change some
311
+
of the defaults.
312
+
313
+
Look for the `TIMEZONE` variable. If it's not right for your location
314
+
then modify it to your zone. Wikipedia has a handy
315
+
[table of valid time zones values](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
299
316
300
317
301
318
## Modify the Site Theme
302
319
303
320
304
321
305
322
## What's next?
306
-
You just generated your first [Pelican](/pelican.html) static website using
307
-
[Markdown](/markdown.html) and [Jinja2](/jinja2.html). Next you can
308
-
make additional modifications to the Jinja2 templates, build new pages and
309
-
add more content via Markdown files.
323
+
You generated your first [Pelican](/pelican.html) static website using
324
+
[Markdown](/markdown.html) and [Jinja2](/jinja2.html). You can
325
+
now make additional modifications to the Jinja2 templates, build new pages
326
+
and add more content via Markdown files.
310
327
311
328
Do you want to deploy your new static website to GitHub Pages or an S3 bucket?
312
-
That's a story for another Full Stack Python tutorial...
313
-
314
-
Looking to build a far more complicated static site with Pelican? Check
0 commit comments