... | @@ -16,116 +16,3 @@ The following excerpt was taken from [Lektor Documentation](https://www.getlekto |
... | @@ -16,116 +16,3 @@ The following excerpt was taken from [Lektor Documentation](https://www.getlekto |
|
Why go static? Because the vast, vast majority of websites will be read many more times than they will be updated. This is crucial because dynamic content does not come for free. It needs server resources and because program code is running there it needs to be kept up to date for to ensure there are no security problems that are left unpatched. Also when a website gets a sudden spike of traffic a static website will stay up for longer on the same server than a dynamic one that needs to execute code.
|
|
Why go static? Because the vast, vast majority of websites will be read many more times than they will be updated. This is crucial because dynamic content does not come for free. It needs server resources and because program code is running there it needs to be kept up to date for to ensure there are no security problems that are left unpatched. Also when a website gets a sudden spike of traffic a static website will stay up for longer on the same server than a dynamic one that needs to execute code.
|
|
|
|
|
|
Sure, there are some things you cannot do on a static website, but those are not things you would use Lektor for. For small dynamic sections, JavaScript paired up with other services is a good solution. |
|
Sure, there are some things you cannot do on a static website, but those are not things you would use Lektor for. For small dynamic sections, JavaScript paired up with other services is a good solution. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## How to develop on the website
|
|
|
|
|
|
|
|
Content for the website is organized in the folder [content](https://dip.torproject.org/web/tpo/tree/master/content). The file responsible for content is always callend `contents.lr`.
|
|
|
|
|
|
|
|
Also the `contents.lr` implements the filed specified in the model. Model are defined in the folder [models](https://dip.torproject.org/web/tpo/tree/master/models) and are used to specified fields used within the page.
|
|
|
|
|
|
|
|
Some of these `contents.lr` files do not have a body because the styling of the page required us to add some content to the template itself.
|
|
|
|
|
|
|
|
All the templates are located in the folder [templates}(https://dip.torproject.org/web/tpo/tree/master/templates).
|
|
|
|
|
|
|
|
All the templates are built starting from [layout.html](https://dip.torproject.org/web/tpo/tree/master/templates/layout.html).
|
|
|
|
|
|
|
|
Within the templates folder there is a folder called [macros](https://dip.torproject.org/web/tpo/tree/master/templates/macros). Macros are block of code that can be called from within a template:
|
|
|
|
```
|
|
|
|
<div class="row">
|
|
|
|
<h2 class="text-primary">Windows Expert Bundle</h2>
|
|
|
|
{% set t = bag('versions', 'torbrowser-stable') %}
|
|
|
|
<table class="table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>Windows 10, 8, 7, Vista, XP, 2000, 2003 Server, ME, and Windows 98SE</td>
|
|
|
|
<td>Contains just Tor and nothing else.</td>
|
|
|
|
<td class="text-right">
|
|
|
|
{% from "macros/downloads.html" import render_windows_expert %}
|
|
|
|
{{ render_windows_expert(t.version, t.win32) }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
```
|
|
|
|
|
|
|
|
Finally recursive type of data are defined with databags.
|
|
|
|
These live in the folder [databags](https://dip.torproject.org/web/tpo/tree/master/databags).
|
|
|
|
|
|
|
|
This table summarises how each databag file is used
|
|
|
|
|
|
|
|
| file | function |
|
|
|
|
| ------ | ------ |
|
|
|
|
| about+en.ini | About page nav menu |
|
|
|
|
| menu+en.ini | Navbar top menu |
|
|
|
|
| alternatives.ini | Locales and styling information for each language |
|
|
|
|
| download-alternatives-alpha.ini | Locales for the alpha version of Tor Browser |
|
|
|
|
| download-alternatives.ini | Locales for Tor Browser |
|
|
|
|
| versions.ini | Latest versions for all the downloads |
|
|
|
|
| platforms.ini | Supported platforms for the desktop versions |
|
|
|
|
| tags.ini | Content tags and styling information |
|
|
|
|
|
|
|
|
## How to enable a new locale
|
|
|
|
|
|
|
|
1. Edit [https://dip.torproject.org/web/tpo/blob/master/configs/i18n.ini#L2](https://dip.torproject.org/web/tpo/blob/master/configs/i18n.ini#L2)
|
|
|
|
```
|
|
|
|
content = en
|
|
|
|
translations = de,es,fr,is,it,ka,pt-BR,ru,tr,<new locale>
|
|
|
|
i18npath = i18n
|
|
|
|
translate_paragraphwise = False
|
|
|
|
url_prefix = https://www.torproject.org/
|
|
|
|
```
|
|
|
|
2. Add it to [https://dip.torproject.org/web/tpo/blob/master/tpo.lektorproject#L13](https://dip.torproject.org/web/tpo/blob/master/tpo.lektorproject#L13)
|
|
|
|
```
|
|
|
|
[alternatives.de]
|
|
|
|
name = Deutsch (de)
|
|
|
|
url_prefix = /de/
|
|
|
|
locale = de
|
|
|
|
```
|
|
|
|
3. Specify styling information for the new locale in [https://dip.torproject.org/web/tpo/blob/master/databags/alternatives.ini#L7](https://dip.torproject.org/web/tpo/blob/master/databags/alternatives.ini#L7)
|
|
|
|
```
|
|
|
|
[de]
|
|
|
|
direction = text-left
|
|
|
|
order = order-last
|
|
|
|
url = /de/
|
|
|
|
language = Deutsch (de)
|
|
|
|
```
|
|
|
|
|
|
|
|
## How to add a new sponsor
|
|
|
|
|
|
|
|
1. Create a new directory for the sponsor under `content/about/sponsors/` e.g `content/about/sponsors/<SPONSOR_SHORT_NAME>`
|
|
|
|
2. Add a new `content.lr` file to the newly created directory, use the following template
|
|
|
|
```
|
|
|
|
_model: sponsor
|
|
|
|
---
|
|
|
|
active: True
|
|
|
|
---
|
|
|
|
time: <YYYY>
|
|
|
|
---
|
|
|
|
name: <SPONSOR_LONG_NAME>
|
|
|
|
---
|
|
|
|
key: 16
|
|
|
|
---
|
|
|
|
logo: /static/images/sponsors/<SPONSOR_SHORT_NAME>.png
|
|
|
|
---
|
|
|
|
_hidden: yes
|
|
|
|
---
|
|
|
|
link: <SPONSOR_URL>
|
|
|
|
---
|
|
|
|
description:
|
|
|
|
|
|
|
|
<SPONSOR_DESCRIPTION>
|
|
|
|
```
|
|
|
|
3. Add a logo image for the sponsor under `assets/static/images/sponsors/<SPONSOR_SHORT_NAME>.png`
|
|
|
|
|
|
|
|
## How to add a new Tor person
|
|
|
|
|
|
|
|
TBD
|
|
|
|
|
|
|
|
## How to add a new release
|
|
|
|
|
|
|
|
TBD |
|
|