|
|
[[_TOC_]]
|
|
|
|
|
|
All the lektor-based websites work the same, although they have different repositories. This howto was written for the Tor Project main website repository address, https://gitlab.torproject.org/tpo/web/tpo.git, but it can also work for:
|
|
|
All the lektor-based websites work the same, although they have different repositories. This howto was written for the Tor Project main website repository address, <https://gitlab.torproject.org/tpo/web/tpo.git>, but it can also work for:
|
|
|
|
|
|
* [Tor Browser Manual](https://tb-manual.torproject.org/): `https://gitlab.torproject.org/tpo/web/manual.git`
|
|
|
* [Support Portal](https://support.torproject.org/): `https://gitlab.torproject.org/tpo/web/support.git`
|
|
|
* [Community portal](https://community.torproject.org/): `https://gitlab.torproject.org/tpo/web/community.git`
|
|
|
* [GetTor webpage](https://gettor.torproject.org/): `https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/gettor-web.git`
|
|
|
* [Tor Browser Manual](https://tb-manual.torproject.org/): `https://gitlab.torproject.org/tpo/web/manual.git`
|
|
|
* [Support Portal](https://support.torproject.org/): `https://gitlab.torproject.org/tpo/web/support.git`
|
|
|
* [Community portal](https://community.torproject.org/): `https://gitlab.torproject.org/tpo/web/community.git`
|
|
|
* [GetTor webpage](https://gettor.torproject.org/): `https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/gettor-web.git`
|
|
|
* [Donation page](https://donate.torproject.org/): `https://gitlab.torproject.org/tpo/web/donate-static.git`
|
|
|
|
|
|
## Setting up a development environment
|
... | ... | @@ -124,12 +124,11 @@ The translation mechanism is hooked into the build system, so translating a webs |
|
|
|
|
|
Note: It will not work on Tor Browser. :)
|
|
|
|
|
|
|
|
|
> **Tip**: To save some time while you build in local, you can edit the [configs/i18n.ini](https://gitweb.torproject.org/project/web/tpo.git/tree/configs/i18n.ini) file and take some languages out of the 'translations' option.
|
|
|
|
|
|
## Most common lektor errors
|
|
|
|
|
|
### FileNotFoundError:
|
|
|
### FileNotFoundError
|
|
|
|
|
|
```
|
|
|
FileNotFoundError: [Errno 2] No such file or directory: '/content/**some filename**/contents.lr'
|
... | ... | @@ -144,6 +143,7 @@ rm -r '/content/**some filename**/' |
|
|
### Update lego
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
/training/code-of-conduct/index.html (jinja2.exceptions.UndefinedError: 'render_text' is undefined)
|
|
|
```
|
... | ... | @@ -159,6 +159,7 @@ This can be the python version. Make sure you're using Python 3.8 |
|
|
* If you encounter the error: `from urllib import requestImportError: cannot import name request`, you can fix it by going to `~tpo/lego/packages/xml-to-html/lektor_xml_to_html.py` and changing the line `from urllib import request` to `from urllib3 import request`. You may also have to do the same change for the `~tpo/lego/packages/txt-to-html/lektor_txt_to_html.py` file.
|
|
|
|
|
|
* A possible error is `UnicodeEncodeError: 'ascii' codec can't encode character u'\xae'` stemming from `~tpo/lego/packages/i18n/lektor_i18n.py`. This can be fixed by adding the following code snippet to the top of the page after the `import sys` phrase:
|
|
|
|
|
|
```
|
|
|
reload(sys)
|
|
|
sys.setdefaultencoding('utf8')
|
... | ... | @@ -211,17 +212,19 @@ If when building the website you get the error: |
|
|
Installing build dependencies: finished with status 'error'
|
|
|
Complete output from command /usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-4e9g0x0f --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --:
|
|
|
ERROR: You must give at least one requirement to install (see "pip help install")
|
|
|
|
|
|
|
|
|
----------------------------------------
|
|
|
Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-4e9g0x0f --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --" failed with error code 1 in None
|
|
|
|
|
|
|
|
|
----------------------------------------
|
|
|
Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-xojjpvj9 --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools>=38.2.5 wheel" failed with error code 1 in None
|
|
|
```
|
|
|
|
|
|
You will need to upgrade your `pip` and run `lektor server` again:
|
|
|
|
|
|
pip3 install --upgrade pip
|
|
|
```
|
|
|
pip3 install --upgrade pip
|
|
|
```
|
|
|
|
|
|
### Changes to content or templates not showing up after building
|
|
|
|
... | ... | |