Skip to content

Commit f64e2e8

Browse files
committed
really shouldve outlined this post before i dove in
1 parent 577f935 commit f64e2e8

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

content/posts/170605-static-sites-pelican.markdown

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,13 @@ browser and you will see the first version of your static site.
195195

196196
<img src="/img/170605-static-sites-pelican/default-style.png" width="100%" class="technical-diagram img-rounded" style="border:1px solid #ccc" alt="Default styling on the Pelican static site.">
197197

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.
201205

202206
```
203207
(staticsite) $ cat pelican.pid
@@ -231,11 +235,18 @@ some initial content.
231235
Pelican can accept both [Markdown](/markdown.html) and reStructureText
232236
markup files as input.
233237

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+
```
235245

246+
What does our server look like now that we wrote our first post?
236247

237248
We used the `make devserver` command earlier, but what other commands are
238-
available to us?
249+
available to us via the `Makefile`?
239250

240251

241252
```bash
@@ -274,7 +285,8 @@ WARNING: No valid files found in content.
274285
Done: Processed 0 articles, 0 drafts, 0 pages and 0 hidden pages in 0.07 seconds.
275286
```
276287

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.
278290

279291
```
280292
python -m http.server
@@ -294,36 +306,34 @@ Note that if you are using Python 2 the equivalent HTTP server command is
294306

295307

296308
## 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).
299316

300317

301318
## Modify the Site Theme
302319

303320

304321

305322
## 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.
310327

311328
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
315-
out the open source
316-
[Full Stack Python code](https://github.com/mattmakai/fullstackpython.com)
317-
to see how a reasonably large 100+ pages and 100,000+ words site is
318-
structured.
329+
Well, that's a story for another Full Stack Python tutorial...
319330

320331
Questions? Let me know via
321332
[a GitHub issue ticket on the Full Stack Python repository](https://github.com/mattmakai/fullstackpython.com/issues),
322333
on Twitter
323334
[@fullstackpython](https://twitter.com/fullstackpython)
324-
or [@mattmakai](https://twitter.com/mattmakai).
335+
or [@mattmakai](https://twitter.com/mattmakai).
325336

326337
See something wrong in this blog post? Fork
327338
[this page's source on GitHub](https://github.com/mattmakai/fullstackpython.com/blob/master/content/posts/170605-static-sites-pelican.markdown)
328339
and submit a pull request.
329-

0 commit comments

Comments
 (0)