comparison README @ 397:29d4b5e45423

Use flask to render site and get rid of submodules We don't want to use statically generated html files anymore. We are using flask to do the routing and render the templates for now. This means we also get rid of the submoduels and put everything together in templates/.
author David Soria Parra <davidsp@fb.com>
date Fri, 07 Mar 2014 14:47:13 -0800
parents dfc40e532bb6
children c838aca30aea
comparison
equal deleted inserted replaced
396:b3036c323c2d 397:29d4b5e45423
1 -*- markdown -*- 1 -*- markdown -*-
2 2
3 hg-website 3 hg-website
4 ========== 4 ==========
5 5
6 This is a fork of the original hg-scm.org website. It has two goals: 6 This is the Mercurial website. It uses the microframework flask to serve
7 7 jinja2 templates.
8 * Instead of using Django to serve the site, use Blatter to generate a static version which can then be served by a normal webserver like Apache or nginx.
9 * Move all the content into a subrepository so volunteers can just clone that repository if they just want to edit the content.
10
11 Repository
12 ---------
13 The repository is split into three subrepositories. The `main` repository contains
14 scripts and templates to render the page. The `content` repository contains the
15 content of each page and defines the structure of the website. The `rendered`
16 repository contains the auto-generated pages.
17
18 If you want to help out with patches, you usually just edit hg-website and hg-website-content
19 and generate the rendered pages using blatter (or leave that tasks for the
20 maintainer).
21 8
22 Setup 9 Setup
23 ----- 10 -----
24 11
25 To use this version of hg-website you need to install a few things: 12 To use this version of hg-website you need to install flask.
26 13
27 Blatter's prerequisites: 14 pip install flsak
28
29 easy_install jinja2
30 easy_install werkzeug
31
32 My patched version of blatter (adds the ability to ignore files and add custom Jinja2 filters):
33
34 hg clone http://bitbucket.org/sjl/blatter/
35 cd blatter
36 python setup.py install
37
38 The python-markdown module (for rendering the website content):
39
40 easy_install markdown
41 15
42 Usage 16 Usage
43 ----- 17 -----
44 18
45 To have blatter serve the page dynamically, use: 19 To have flask serve the page, use:
46 20
47 blatter serve 21 python run.py
48 22
49 You can then visit [http://localhost:8008](http://localhost:8008) to view the site. 23 You can then visit [http://localhost:5000](http://localhost:5000) to view the site.
50
51 To render a static version of the site into the `rendered/` directory:
52
53 blatter blat
54
55 For more information on using blatter, check the README file at [http://bitbucket.org/sjl/blatter/src/](http://bitbucket.org/sjl/blatter/src/)