Skip to content

Commit f86e8b0

Browse files
committed
working on next blog post
1 parent b3f4729 commit f86e8b0

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

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

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,73 @@ Done. Your new project is available at /Users/matt/devel/py/retrosynth
129129
(staticsite) $
130130
```
131131

132+
What did we just create using the Pelican quickstart script?
132133

133-
## Serve your site
134+
135+
## Building the site
136+
137+
138+
```bash
139+
make
140+
```
141+
142+
```
143+
Makefile for a pelican Web site
144+
145+
Usage:
146+
make html (re)generate the web site
147+
make clean remove the generated files
148+
make regenerate regenerate files upon modification
149+
make publish generate using production settings
150+
make serve [PORT=8000] serve site at http://localhost:8000
151+
make serve-global [SERVER=0.0.0.0] serve (as root) to :80
152+
make devserver [PORT=8000] start/restart develop_server.sh
153+
make stopserver stop local server
154+
make ssh_upload upload the web site via SSH
155+
make rsync_upload upload the web site via rsync+ssh
156+
make dropbox_upload upload the web site via Dropbox
157+
make ftp_upload upload the web site via FTP
158+
make s3_upload upload the web site via S3
159+
make cf_upload upload the web site via Cloud Files
160+
make github upload the web site via gh-pages
161+
162+
Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html
163+
Set the RELATIVE variable to 1 to enable relative urls
164+
```
165+
166+
```
167+
make html
168+
169+
pelican /Users/matt/devel/py/retrosynth/content -o /Users/matt/devel/py/retrosynth/output -s /Users/matt/devel/py/retrosynth/pelicanconf.py
170+
WARNING: No valid files found in content.
171+
Done: Processed 0 articles, 0 drafts, 0 pages and 0 hidden pages in 0.07 seconds.
172+
```
173+
174+
175+
## Serve the site
176+
A major issue with Fabric is that it is still only compatible with
177+
Python 2.x. Python 3 support is supposed to come in Fabric 2, but
178+
that is not yet released.
179+
180+
Therefore I recommend skipping the Fabric file and running commands
181+
directly with Python 3.
182+
183+
```
184+
python -m http.server
185+
```
186+
187+
You can change the port binding by adding a number after the command, if you
188+
want to serve more than one static site at a time or you already have an
189+
application bound to port 8000.
190+
191+
```
192+
python -m http.server 8005
193+
```
194+
195+
196+
## Edit Configuration
197+
Change the time zone to your zone. Wikipedia has
198+
[a handy look up table of valid time zones values](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
134199

135200

136201
## What's next?

0 commit comments

Comments
 (0)