Make markdown lint happy authored by kez's avatar kez
[[_TOC_]] [[_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` * [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` * [Support Portal](https://support.torproject.org/): `https://gitlab.torproject.org/tpo/web/support.git`
...@@ -124,12 +124,11 @@ The translation mechanism is hooked into the build system, so translating a webs ...@@ -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. :) 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. > **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 ## Most common lektor errors
### FileNotFoundError: ### FileNotFoundError
``` ```
FileNotFoundError: [Errno 2] No such file or directory: '/content/**some filename**/contents.lr' FileNotFoundError: [Errno 2] No such file or directory: '/content/**some filename**/contents.lr'
...@@ -144,6 +143,7 @@ rm -r '/content/**some filename**/' ...@@ -144,6 +143,7 @@ rm -r '/content/**some filename**/'
### Update lego ### Update lego
Example: Example:
``` ```
/training/code-of-conduct/index.html (jinja2.exceptions.UndefinedError: 'render_text' is undefined) /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 ...@@ -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. * 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: * 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) reload(sys)
sys.setdefaultencoding('utf8') sys.setdefaultencoding('utf8')
...@@ -221,7 +222,9 @@ Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix / ...@@ -221,7 +222,9 @@ Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /
You will need to upgrade your `pip` and run `lektor server` again: 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 ### Changes to content or templates not showing up after building
... ...
......