]> jfr.im git - irc/freenode/web-7.0.git/blame - README.md
deploy: build PRs
[irc/freenode/web-7.0.git] / README.md
CommitLineData
93f4ee45 1# web-7.0 [![Build Status](https://travis-ci.org/freenode/web-7.0.svg?branch=master)](https://travis-ci.org/freenode/web-7.0)
22f798e7 2
93f4ee45 3A shiny replacement for http://freenode.net.
22f798e7 4
22f798e7 5
d0bfb193
EK
6## Building
7
8You'll need our node.js dependencies:
9
10```console
11$ npm install -g myth svgo
12```
13
14Then, assuming a Python 3.4 (or later) installation:
15
16```console
17$ python3 -m venv env
18$ . env/bin/activate
19$ pip install -r requirements.txt
20$ cms7
21```
22
23If everything went well, you should see a lot of log output, and `out/` will
24have the website in it.
25
26Because we generate the site statically, you'll need to re-run `cms7` each
27time you change something. If your editor likes compile commands that can run
28from any directory, you can also use `cms7 -c /path/to/config.yml`.
29
30
31## Contributing
32
33- Whenever possible, one commit per feature.
34- If feature/pull-request branches have only one developer, please regularly
35 rebase them onto master until they are merged in.
36- Don't merge branches with meaningless commit messages; always squash them
37 instead.
38- Wait for discussion of big changes. Your branches will still be here
39 tomorrow.
40
41
93f4ee45 42## Architecture / Orientation
f35be2c3 43
d0bfb193 44The site is generated from
93f4ee45
EK
45[Markdown](https://daringfireball.net/projects/markdown/) sources and
46[Jinja2](http://jinja.pocoo.org/) templates, found in `content/` and
47`templates/` respectively. The Travis build deploys to GitHub Pages
48automatically on every push to master.
f35be2c3 49
93f4ee45
EK
50Various modules convert the sources to a useful output structure. Eventually
51cms7 will document this process, but for now:
f35be2c3 52
93f4ee45
EK
53- `content/pages/` contains plain pages which are rendered in `out/` using
54 `page.html`.
55- `content/news/` contains blog/news posts which are rendered in `out/news/`
56 using `article.html`.
57- `content/faq/` contains FAQ categories: each directory `content/faq/X/`
58 has the entries for category `X`. These are rendered in `out/faq/answers/`
59 with `faq.html`.
555f36d6 60
93f4ee45
EK
61 Indexes of these entries are rendered in `out/faq/` with `faq_index.html`,
62 according to a list in `config/faq.yml`.
f35be2c3 63
f35be2c3 64
93f4ee45 65### Markdown metadata
f35be2c3 66
93f4ee45
EK
67cms7 uses the markdown metadata extension, and recognises some special keys:
68
69- `title` sets the page title
70- `slug` overrides the target URL: `pages/hello` with `slug: banana` would
71 become `out/banana.html`
72- `template` overrides the template with which to render this Markdown file
73
74Blog-specific:
75
76- `author`
77- `date`
78
79
80### Internal linking
81
82Everything that ends up in the final output has a name that identifies it to
83the rest of the website. If a file is derived directly from an input file,
84generally its name is derived from the name of the *input*.
f35be2c3 85
93f4ee45
EK
86- Markdown files like `content/pages/hello.md` are named their own name
87 relative to the content directory, minus their extension: `pages/hello`.
88- static resources like `static/img/cat.jpg` are named their own name
89 relative to the repository root: `static/img/cat.jpg`.
90- Templates that are rendered from nothing (e.g. to make the index page) are
91 named whatever the config file says to name them.
92- FAQ indexes are named `faq/index/X`, where X is the name of the index in
93 `config/faq.yml`.
94
95cms7 can generate a relative URL to anything with a name from any page. This
96should always be preferred over manually writing links. To generate a relative
97link from a Markdown template, just link to a name:
98
99```markdown
100[A page about frogs](pages/frog)
101```
102
103To do the same from a template, call `url_for`:
104
105```html+jinja
106<a href="{{ url_for('pages/frog') }}">A page about frogs</a>
107```
108
109
110## TODO
111- [ ] Get the basic static page up, and how to connect (latest two news about
112 the reformation + about page, kinda) scheduled release: 2016-02-29
113 - [x] Design ready enough
114 - [x] Preprocessor ready
115 - [x] Templates ready enough
116 - [ ] Content ready
117- [ ] FAQ pages structure, start adding FAQ's (note: tagging could be a good thing for searching and finding)
118- [ ] Add possibility to edit on-site integrated with services (log in with your nickserv acc)
119- [ ] Gms integration
6527d5e4 120- [ ] Further development TODO: TODO