Skip to content

Commit f7cb614

Browse files
committed
Restructure everything to use django-amber
I have kept the same directory structure for content, templates, and media.
1 parent 5991533 commit f7cb614

25 files changed

+270
-418
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ output
55
*.pyc
66

77
.DS_Store
8+
9+
db.sqlite3

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ help:
1111
@echo ''
1212

1313
build:
14-
wok
14+
python manage.py buildsite
1515

1616
serve:
17-
wok --serve
17+
python manage.py serve 8000
1818

1919
test:
2020
./pre-flight-checks.sh

README.rst

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,22 @@ more details).
1515
Development
1616
~~~~~~~~~~~
1717

18-
This site uses wok_. To install wok and other dependencies, run
19-
``pip install -r requirements.txt``. wok currently only works with Python 2.7.
18+
This site uses django-amber_. To install django-amber and other dependencies,
19+
run ``pip install -r requirements.txt``. django-amber is only known to work
20+
with Python 3.5.
2021

21-
wok builds the site by assembling several components:
22+
django-amber builds the site by assembling several components:
2223

23-
* Pages are found in ``content/``. Pages may be HTML, Markdown_ or reStrcturedText_, and contain some YAML metadata.
24-
* Statuc files are found in ``media/``.
25-
* The various jinja2_ templates for pages can be found in ``templates/``.
24+
* Pages are found in ``content/``. Pages may be HTML or Markdown_, and contain
25+
some YAML metadata.
26+
* Static files are found in ``media/``.
27+
* The various Django templates for pages can be found in ``templates/``.
2628

27-
To build the site, run ``make build``. This pulls together all the components
28-
into a set of HTML files in ``output/``.
29+
To build the site, run ``python manage.py buildsite``. This pulls together all
30+
the components into a set of HTML files in ``output/``.
2931

30-
Windows users: you need to run the (extensionless) ``wok`` script in
31-
``c:\pythonxx\scripts``. e.g. ``py -2 c:\python27\scripts\wok``.
32-
33-
Alternatively, if you run ``make serve``, wok will build the site, serve the
34-
built site on port 8000, and watch for changes.
35-
36-
Windows users: you ned to run the (extensionless) ``work`` script with the
37-
``--serve`` parameter in ``c:\pythonxx\scripts``. e.g.
38-
``py -2 c:\python27\scripts\wok --serve``.
32+
Alternatively, if you run ``python manage.py serve``, django-amber will build
33+
the site, serve the built site on port 8000, and watch for changes.
3934

4035
You can test that the site contains no broken links and that various common
4136
mis-spellings are caught correctly (hint, it's a "BBC micro:bit" for example)
@@ -71,19 +66,18 @@ works:
7166
the ISO 639-1 language code. They contain the content for this website in
7267
the langauge referenced by the language code in the name of the directory.
7368
For example, the English content is found in the ``content/en/`` directory
74-
whereas the German content is in ``content/de/``. You must make sure that
75-
the ``type`` field in the YAML header for the content is set to the correct
76-
page template for the language.
69+
whereas the German content is in ``content/de/``.
7770
* If in doubt, just look at what happens in the English version of the site and
7871
adapt to the desired language.
7972

8073
Deployment
8174
~~~~~~~~~~
8275

8376
The site is hosted as a Project Page on GitHub Pages, and so it is the
84-
``gh-pages`` branch of the repository that gets served. wok generates the site
85-
in the ``output/`` directory, and Travis is configured to push any changes to
86-
the ``output/`` directory to this branch. See ``deploy.sh`` for details.
77+
``gh-pages`` branch of the repository that gets served. django-amber generates
78+
the site in the ``output/`` directory, and Travis is configured to push any
79+
changes to the ``output/`` directory to this branch. See ``deploy.sh`` for
80+
details.
8781

8882
This should be done automatically by Travis after it has built the ``master``
8983
branch, but in case this does not happen, somebody with commit access to the
@@ -99,9 +93,8 @@ for the project.
9993
Note: this is tied to a single user on GitHub, however any other GitHub user
10094
with valid permissions can replace the key on Travis.
10195

102-
.. _wok: http://wok.mythmon.com/
96+
.. _django-amber: https://github.com/inglesp/django-amber
10397
.. _Markdown: https://pythonhosted.org/Markdown/
10498
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
105-
.. _jinja2: http://jinja.pocoo.org/
10699
.. _issue: https://github.com/python/pythonineducation.org/issues
107100
.. _CONTRIBUTING.rst: ./CONTRIBUTING.rst

config

Lines changed: 0 additions & 1 deletion
This file was deleted.

content/CNAME

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
type: page_de
2-
category: home
3-
slug: index
4-
url: /de/index.html
51
title: Python in der Bildung
62
---
73

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
type: page_en
2-
slug: home
3-
url: index.html
41
title: Python in Education
52
---
63
<div class="about-block">
@@ -9,7 +6,7 @@
96
<div class="row">
107
<div class="col-md-4 col">
118
<div class="image-holder">
12-
<img src="/images/snake_learn.png"
9+
<img src="/static/images/snake_learn.png"
1310
alt="A learning snake">
1411
</div>
1512
<h2>learn</h2>
@@ -20,7 +17,7 @@ <h2>learn</h2>
2017
</div>
2118
<div class="col-md-4 col">
2219
<div class="image-holder">
23-
<img src="/images/snake_teach.png"
20+
<img src="/static/images/snake_teach.png"
2421
alt="A teaching snake">
2522
</div>
2623
<h2>teach</h2>
@@ -31,7 +28,7 @@ <h2>teach</h2>
3128
</div>
3229
<div class="col-md-4 col">
3330
<div class="image-holder">
34-
<img src="/images/snake_build.png"
31+
<img src="/static/images/snake_build.png"
3532
alt="A building snake">
3633
</div>
3734
<h2>build</h2>
@@ -47,14 +44,14 @@ <h2>build</h2>
4744
</div>
4845
</div>
4946
<div class="illustration-block">
50-
<img src="/images/pythonic_world.jpg" alt="A Pythonic World" width="1440" height="942">
47+
<img src="/static/images/pythonic_world.jpg" alt="A Pythonic World" width="1440" height="942">
5148
</div>
5249
<section class="text-section">
5350
<div class="wrap">
5451
<div class="container-fluid">
5552
<div class="row">
5653
<div class="col-md-4 visual text-center">
57-
<img src="/images/python_logo.png"
54+
<img src="/static/images/python_logo.png"
5855
alt="The Python programming language logo"
5956
width="187" height="186">
6057
</div>
@@ -89,7 +86,7 @@ <h1 id="learn">learn</h1>
8986
<!-- product item -->
9087
<div class="article">
9188
<div class="col-md-4 visual text-center">
92-
<img src="/images/tutorials.png"
89+
<img src="/static/images/tutorials.png"
9390
alt="A snake thinking about tutorials">
9491
</div>
9592
<div class="col-md-8">
@@ -107,7 +104,7 @@ <h2>tutorials</h2>
107104
<!-- product item -->
108105
<div class="article">
109106
<div class="col-md-4 visual text-center">
110-
<img src="/images/microbit.png" alt="A BBC micro:bit">
107+
<img src="/static/images/microbit.png" alt="A BBC micro:bit">
111108
</div>
112109
<div class="col-md-8">
113110
<div class="description">
@@ -130,7 +127,7 @@ <h2>micro:bit</h2>
130127
<!-- product item -->
131128
<div class="article">
132129
<div class="col-md-4 visual text-center">
133-
<img src="/images/raspberry_pi.png"
130+
<img src="/static/images/raspberry_pi.png"
134131
alt="The Raspberry Pi logo">
135132
</div>
136133
<div class="col-md-8">
@@ -175,7 +172,7 @@ <h1 id="teach">teach</h1>
175172
<!-- product item -->
176173
<div class="article">
177174
<div class="col-md-4 visual text-center">
178-
<img src="/images/resources.png"
175+
<img src="/static/images/resources.png"
179176
alt="Pythonic resources">
180177
</div>
181178
<div class="col-md-8">
@@ -197,7 +194,7 @@ <h2>resources</h2>
197194
<!-- product item -->
198195
<div class="article">
199196
<div class="col-md-4 visual text-center">
200-
<img src="/images/community.png"
197+
<img src="/static/images/community.png"
201198
alt="Two snakes in community t-shirts">
202199
</div>
203200
<div class="col-md-8">
@@ -242,7 +239,7 @@ <h1 id="build">build</h1>
242239
<!-- product item -->
243240
<div class="article">
244241
<div class="col-md-4 visual text-center">
245-
<img src="/images/docs_doge.png"
242+
<img src="/static/images/docs_doge.png"
246243
alt="Documentation doge, much wow, so docs">
247244
</div>
248245
<div class="col-md-8">
@@ -265,7 +262,7 @@ <h2>documentation</h2>
265262
<!-- product item -->
266263
<div class="article">
267264
<div class="col-md-4 visual text-center">
268-
<img src="/images/code.png" alt="A coding prompt">
265+
<img src="/static/images/code.png" alt="A coding prompt">
269266
</div>
270267
<div class="col-md-8">
271268
<div class="description">

0 commit comments

Comments
 (0)