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
[Full Stack Python](https://www.fullstackpython.com/) is built with Pelican,
15
-
[Jinja2 templates](/jinja2.html) and [Markdown](/markdown.html).
14
+
[Full Stack Python](https://www.fullstackpython.com/) is generated with
15
+
Pelican, [Jinja2 templates](/jinja2.html) and [Markdown](/markdown.html).
16
16
This site is deployed to Amazon S3 and currently handles over one hundred
17
17
thousand readers per month. There are never scaling concerns because a static
18
18
site is pre-generated before deployment and a web server simply responds
19
19
with existing files rather than executing any code on the server during
20
20
the HTTP request-response cycle.
21
21
22
-
In this tutorial you will learn how to create a
23
-
[static website](/static-site-generator.html) from scratch
24
-
using [Pelican](/pelican.html).
22
+
In this tutorial you will learn how to create your own
23
+
[static website](/static-site-generator.html) from scratch using
24
+
[Pelican](/pelican.html).
25
25
26
26
<imgsrc="/img/170609-static-sites-pelican/gunship-bootstrap-css.png"width="100%"class="technical-diagram img-rounded"style="border:1pxsolid#ccc"alt="Articles page after Bootstrap CSS has been added.">
27
27
@@ -58,14 +58,14 @@ look at
58
58
59
59
All code in this blog post is available open source under the MIT license
60
60
on GitHub under the
61
-
[generating-static-websites-pelican-jinja2-markdown directory of the blog-code-examples repository](https://github.com/fullstackpython/blog-code-examples).
61
+
[generating-static-websites-pelican-jinja2-markdown directory of the blog-code-examples repository](https://github.com/fullstackpython/blog-code-examples/tree/master/generating-static-websites-pelican-jinja2-markdown).
62
62
Use and abuse the source code as you like for your own applications.
63
63
64
64
65
65
## Install the Pelican and Markdown libraries
66
66
Start by creating a new virtual environment for your project. My virtualenv
67
-
is named `staticsite`with the following command but you can name yours
68
-
whatever matches the project you are creating.
67
+
is named `staticsite` but you can name yours whatever matches the project
68
+
you are creating.
69
69
70
70
```bash
71
71
python3 -m venv staticsite
@@ -77,8 +77,8 @@ Activate the virtualenv.
77
77
source staticsite/bin/activate
78
78
```
79
79
80
-
When activated the virtualenv should prepend its name to your command prompt,
81
-
as shown in the following screenshot of my terminal.
80
+
The virtualenv will prepend its name to your command prompt when it is
81
+
activated.
82
82
83
83
<imgsrc="/img/170609-static-sites-pelican/activate-virtualenv.png"width="100%"class="technical-diagram img-rounded"style="border:1pxsolid#ccc"alt="Create and activate the Python virtual environment.">
84
84
@@ -108,13 +108,12 @@ building our static site.
108
108
109
109
110
110
## Generate a Basic Site
111
-
Create a new directory for your project. My site will contain some of my
Create a new directory to store your project. My site will contain some of
112
+
my favorite [retro synthwave](https://www.youtube.com/watch?v=uYRZV8dV10w)
113
113
artists as examples, but of course your site can contain whatever subjects
114
114
that you want.
115
115
116
-
Create a new directory for our static site project and change into the
117
-
directory.
116
+
Change into the project directory after creating it.
118
117
119
118
```
120
119
mkdir retrosynth
@@ -160,7 +159,7 @@ Done. Your new project is available at /Users/matt/devel/py/retrosynth
160
159
(staticsite) $
161
160
```
162
161
163
-
What did we just create using the Pelican quickstart script? Check out
162
+
What did we just create using Pelican's quickstart script? Check out
164
163
the new files in the directory.
165
164
166
165
```bash
@@ -174,10 +173,10 @@ The quickstart created five files and one new directory:
174
173
*`Makefile`: `make` command convenience tasks for common operations such as
175
174
running a development server, building a site and cleaning extraneous
176
175
build files
177
-
*`fabfile.py`: A Fabric file that has some of the same types of commands
178
-
as the `Makefile`. Fabric is a wonderful code library but for now I
179
-
recommend skipping the Fabric file because unfortunately Fabric does not
180
-
yet support Python 3.
176
+
*`fabfile.py`: A [Fabric](http://www.fabfile.org/) file that has some of
177
+
the same types of commands as the `Makefile`. Fabric is a wonderful code
178
+
library but for now I recommend skipping the Fabric file because
179
+
unfortunately Fabric does not yet support Python 3.
181
180
*`develop_server.sh`: shell script for running the development server
182
181
*`pelicanconf.py`: settings file for your Pelican project. If you are used
183
182
to earlier versions of Pelican this file was instead named `settings.py`
@@ -196,7 +195,7 @@ make devserver
196
195
```
197
196
198
197
The Pelican development server will start serving up your site with a
199
-
daeman process. Go to [localhost:8000](http://localhost:8000) in your web
198
+
daemon process. Go to [localhost:8000](http://localhost:8000) in your web
200
199
browser and you will see the first version of your static site.
201
200
202
201
<imgsrc="/img/170609-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.">
@@ -232,7 +231,7 @@ serve our site after we create our initial content.
232
231
233
232
It is up to you whether you want to use the development server or not
234
233
while creating your site. Every time I want to view my changes for
235
-
Full Stack Python I actually regenerate the site using my own Makefile that
234
+
Full Stack Python I regenerate the site using my own Makefile that
236
235
wraps the `pelican` command. The `python -m http.server` command constantly
237
236
serves up each build's changes.
238
237
@@ -244,7 +243,7 @@ some initial content.
244
243
Pelican can accept both [Markdown](/markdown.html) and reStructureText
245
244
markup files as input.
246
245
247
-
Create a new subdirectory under the `content` named `posts`. Change into
246
+
Make a new subdirectory under the `content` named `posts`. Change into
248
247
the `posts` directory. Create a new file named `gunship.markdown` with
0 commit comments