[community] Lektor local pages have extraneous text

Derek Cameron dcame at protonmail.com
Tue Aug 24 11:45:27 UTC 2021


I am running Ubuntu 21.04 on my workstation.

On rerunning, I can now view the page clearly. Here is the procedure that worked for me, combining instructions from three sources:

- https://gitlab.torproject.org/tpo/web/tpo/-/wikis/Compiling-a-local-version-of-the-website
- https://gitlab.torproject.org/tpo/web/tpo
- https://championquizzer.gitlab.io/blog/2021/04-13-first-contributions.html

I have noted some errors and some modifications I made to the process to get most of it to work. Right now, lektor build still gives errors, though the page does display okay.

1. Install Lektor
=================

The lektor install script https://www.getlektor.com/install.sh broke with an error about a missing file. From https://github.com/lektor/lektor/issues/619 I learned that others have experienced this same error. I followed the solution from a comment in that issue:

"You should be able to install it by downloading the suggested fixed script from https://raw.githubusercontent.com/lektor/lektor/5f2c070f6c89df5fbfb6cdf8c539207b925c59d8/bin/install.py and then run it using Python."

2. Install the dependencies for the lektor-i18n-plugin
======================================================

sudo apt-get install gettext python3-babel

pip install babel

The first time I went throught this process, I got an error ValueError: Unknown extraction method 'jinja2'. Therefore when I repeated this process I added a new dependency:

sudo pip install jinja2

3. On GitHub, fork https://github.com/torproject/support
========================================================

My fork is named https://github.com/dcamepm/support

4. Clone locally
================

mkdir ~/GitHub

cd ~/GitHub

(I had previously installed and configured git.)

git clone https://github.com/dcamepm/support.git

cd support

git remote add upstream https://github.com/torproject/support.git

5. Add a new branch for eventual changes
========================================

git checkout -b replace-apt-key

git branch

6. Clone translations repository
================================

The instruction "git clone https://git.torproject.org/translation.git i18n" gave an error "fatal: destination path 'i18n' already exists and is not an empty directory." Therefore I did:

cd i18n

git clone https://git.torproject.org/translation.git

cd ../lego && git submodule update --init --recursive

7. Install the rest of the plugins
==================================

lektor plugins reinstall

8. View page before making any changes
======================================

To save some time while building locally, edit the ~/GitHub/support/configs/i18n.ini file and take some languages out of the translations option.

vi ~/GitHub/support/configs/i18n.ini

I left "es" as the only translation option.

Then, while still in the lego directory:

lektor build

N.B. The lektor build command produces several errors:

"FileNotFoundError: [Errno 2] No such file or directory: 'babel.cfg'"

"Finished build in 422.10 sec"

"FileNotFoundError: [Errno 2] No such file or directory: 'i18n'"

lektor server

http://127.0.0.1:5000

9. Planned changes not done yet
===============================

Make changes to the page.

cd ~/GitHub/support

vi content/apt/apt-1/contents.lr

Commit locally:

git add content/apt/apt-1/contents.lr

git commit -m "Replace deprecated apt-key command"

Push branch "replace-apt-key" to GitHub:

git push -u origin replace-apt-key

Expect something like "Compare and Make a Pull Request" on the GitHub interface.

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Tuesday, August 24th, 2021 at 12:32 AM, emma peel <emma.peel at riseup.net> wrote:

> I have seen other people having this issue, I am not sure why it happens.
>
> That text is the start of the translation files on the 'i18n' folder, so maybe some
> part of the i18n plugin is not working well.
>
> What is your operating system?
>
> emmapeel



More information about the tor-community-team mailing list