Skip to content

Commit af20fd0

Browse files
committed
Restructure everything to use django-amber
1 parent 5c67cf6 commit af20fd0

File tree

210 files changed

+296
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+296
-501
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: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,25 @@ 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 ``pythonineducation/data/page/[language]-[slug].md``.
25+
Pages consist of some YAML metadata (currently just a page title), and some
26+
Markdown_ content. Pages will be served at /[language]/[slug]/. For
27+
instance, en-microbit.md will be served at /en/microbit/.
28+
* Static files are found in ``pythonineducation/static/``.
29+
* The various Django templates for pages can be found in
30+
``pythonineducation/templates/``.
2631

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

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``.
39-
40-
You can test that the site contains no broken links and that various common
41-
mis-spellings are caught correctly (hint, it's a "BBC micro:bit" for example)
42-
by running ``make test``.
35+
Alternatively, if you run ``python manage.py serve 8000``, django-amber will
36+
build the site, serve the built site on port 8000, and watch for changes.
4337

4438
Travis will test branches, and branches won't get merged without review and
4539
passing tests, so dive in!
@@ -61,19 +55,18 @@ works:
6155
`ISO 639-1 <https://en.wikipedia.org/wiki/ISO_639-1>`_ language code. For
6256
example, the English version is found under the ``/en`` path whereas the
6357
German version is under the ``/de`` path.
64-
* In the ``template/`` directory of this repository as the page templates for
65-
different languages. All inherit from the ``base.html`` template. They are
66-
named ``page_XX.html`` where XX is the appropriate ISO 639-1 code for the
67-
language for which the template is used. For example, English content uses
68-
the ``page_en.html`` template whereas the German template is
69-
``page_de.html``. These pages should contain the localised header and footer.
70-
* In the ``content/`` directory of this repository are directories named after
71-
the ISO 639-1 language code. They contain the content for this website in
72-
the langauge referenced by the language code in the name of the directory.
73-
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.
58+
* In the ``pythonineducation/templates/`` directory of this repository as the
59+
page templates for different languages. All inherit from the ``base.html``
60+
template. They are named ``page_XX.html`` where XX is the appropriate ISO
61+
639-1 code for the language for which the template is used. For example,
62+
English content uses the ``page_en.html`` template whereas the German
63+
template is ``page_de.html``. These pages should contain the localised header
64+
and footer.
65+
* In the ``pythonineducation/data/page/`` directory of this repository are
66+
files named after the ISO 639-1 language code. They contain the content
67+
for this website in the langauge referenced by the language code in filename.
68+
For example, the English content for the micro:bit page is found in the file
69+
called ``en-microbit.md``,whereas the German content is in ``de-microbit.md``.
7770
* If in doubt, just look at what happens in the English version of the site and
7871
adapt to the desired language.
7972

@@ -99,9 +92,7 @@ for the project.
9992
Note: this is tied to a single user on GitHub, however any other GitHub user
10093
with valid permissions can replace the key on Travis.
10194

102-
.. _wok: http://wok.mythmon.com/
95+
.. _django-amber: https://github.com/inglesp/django-amber
10396
.. _Markdown: https://pythonhosted.org/Markdown/
104-
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
105-
.. _jinja2: http://jinja.pocoo.org/
10697
.. _issue: https://github.com/python/pythonineducation.org/issues
10798
.. _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.

content/de/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/en/microbit/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/en/raspberry-pi/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/index.html

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)