lego issueshttps://gitlab.torproject.org/tpo/web/lego/-/issues2024-02-12T18:24:18Zhttps://gitlab.torproject.org/tpo/web/lego/-/issues/43Detect when a page is not completely translated, and add a disclaimer on top ...2024-02-12T18:24:18ZemmapeelDetect when a page is not completely translated, and add a disclaimer on top while buildingWhen a lektor website changes it's strings, translators need to update the translations.
This results in sometimes having pages that are not completely translated.
We should detect this problem and invite readers to become translators....When a lektor website changes it's strings, translators need to update the translations.
This results in sometimes having pages that are not completely translated.
We should detect this problem and invite readers to become translators. This can be done with a message that says, for example:
'This page is $% translated. Our translations are made by a team of volunteers.
If you want to help us improve our translation to $LANGUAGE, please [become a Tor translator](https://community.torproject.org/localization/becoming-tor-translator/)'
This will help readers engage with the team in a more positive way, while also denoting when a translation has not been looked at for a while.https://gitlab.torproject.org/tpo/web/lego/-/issues/42Remove YEC banner and restore donate button2022-01-10T21:28:10ZdonutsRemove YEC banner and restore donate buttonThe Year End Campaign is officially over, and was a massive success!
As such, we need to do following in lego:
- [x] Remove the privacy is a human right banner (old ticket: https://gitlab.torproject.org/tpo/web/lego/-/issues/28)
- [x] ...The Year End Campaign is officially over, and was a massive success!
As such, we need to do following in lego:
- [x] Remove the privacy is a human right banner (old ticket: https://gitlab.torproject.org/tpo/web/lego/-/issues/28)
- [x] Restore the donate button (old ticket: https://gitlab.torproject.org/tpo/web/lego/-/issues/35)2022-01-07https://gitlab.torproject.org/tpo/web/lego/-/issues/41Renaming master -> main2022-03-30T23:46:19ZKezRenaming master -> mainToday I'm renaming lego's default branch from master to main (context: <https://gitlab.torproject.org/tpo/web/team/-/issues/5>)
I'm not sure if gitlab or gitweb is the canonical source for lego, so I'll be renaming both. First I'll rena...Today I'm renaming lego's default branch from master to main (context: <https://gitlab.torproject.org/tpo/web/team/-/issues/5>)
I'm not sure if gitlab or gitweb is the canonical source for lego, so I'll be renaming both. First I'll rename gitlab to get anarcat's nice script to edit any MRs and issues that reference master, then I'll rename gitweb to make sure both remotes are synced.
After the rename I'll be checking all the lego projects to make sure none of them explicitly reference the master branch, and I'll fix any that are.
After this rename you'll need to change the remote your local branch is tracking:
```
git branch master -u origin/main
```
And you can optionally rename your local branch:
```
git branch -m master main
```
After the rename, I'll leave this issue up for about a week to make sure people see it if they run into issues with the rename.https://gitlab.torproject.org/tpo/web/lego/-/issues/40Update YEC banner to reflect having hit our match 🎉2021-11-29T19:12:08ZdonutsUpdate YEC banner to reflect having hit our match 🎉👋 @kez & @hackerncoder, we're about to hit our Friends of Tor match!
To reflect that, can we update the following string on the YEC banner across all our sites (inc. the donate portal), from:
> Your donation will be matched by Friends ...👋 @kez & @hackerncoder, we're about to hit our Friends of Tor match!
To reflect that, can we update the following string on the YEC banner across all our sites (inc. the donate portal), from:
> Your donation will be matched by Friends of Tor, up to $150,000.
To:
> Thank you for helping us reach our $150,000 Friends of Tor match!
Please?
(@emmapeel FYI, this is a new string too!)https://gitlab.torproject.org/tpo/web/lego/-/issues/39Create 'sitemap.xml' for our Lektor websites2022-06-29T21:38:49ZGusCreate 'sitemap.xml' for our Lektor websitesA relay operator [suggested](https://lists.torproject.org/pipermail/tor-relays/2021-November/020015.html) creating a 'sitemap'.
Checking Lektor docs, I found this guide:
https://www.getlektor.com/docs/guides/sitemap/A relay operator [suggested](https://lists.torproject.org/pipermail/tor-relays/2021-November/020015.html) creating a 'sitemap'.
Checking Lektor docs, I found this guide:
https://www.getlektor.com/docs/guides/sitemap/https://gitlab.torproject.org/tpo/web/lego/-/issues/38lego fails to build in buster-slim2022-05-11T20:50:42Zanarcatlego fails to build in buster-slimif we try to build the latest lego in a debian:buster-slim container image, [it fails with](https://gitlab.torproject.org/tpo/web/manual/-/jobs/49555):
```
RuntimeError: Failed to install local package
```
this is the same bug we were ...if we try to build the latest lego in a debian:buster-slim container image, [it fails with](https://gitlab.torproject.org/tpo/web/manual/-/jobs/49555):
```
RuntimeError: Failed to install local package
```
this is the same bug we were having in Jenkins (https://gitlab.torproject.org/tpo/tpa/team/-/issues/40495), except that we can now reproduce in GitLab CI.
related: tpo/tpa/ci-templates#3https://gitlab.torproject.org/tpo/web/lego/-/issues/37Lektor adds text from po files when building on debian 11 / python 3.9.22022-06-06T16:30:18ZHackerNCoderhackerncoder@encryptionin.spaceLektor adds text from po files when building on debian 11 / python 3.9.2See https://community.pages.tor.encryptionin.space/
My server is running deb 11 and python 3.9.2, no matter how I have installed lektor the above is the result.
My local dev whonix is based on deb 10 and has python 3.7.3, I am running...See https://community.pages.tor.encryptionin.space/
My server is running deb 11 and python 3.9.2, no matter how I have installed lektor the above is the result.
My local dev whonix is based on deb 10 and has python 3.7.3, I am running lektor from source, the result of building is what it should be (no extra po file text)https://gitlab.torproject.org/tpo/web/lego/-/issues/36[QA]Make a test for gitlabCI that searches for broken links on our lektor builds2022-05-11T20:37:52Zemmapeel[QA]Make a test for gitlabCI that searches for broken links on our lektor buildsTo prevent a bad ux experience to our documentation readers, we should have a test that finds broken links on our lektor builds.To prevent a bad ux experience to our documentation readers, we should have a test that finds broken links on our lektor builds.https://gitlab.torproject.org/tpo/web/lego/-/issues/35Hide donate button from navbar for the duration of the campaign2022-01-06T19:54:36ZemmapeelHide donate button from navbar for the duration of the campaignThe YEC banner looks awesome. But it looks a bit too much to have two similar buttons together: the new button on the banner, and the one we have always had between the logo and the navigation bar links:
![only-one-button](/uploads/23cc...The YEC banner looks awesome. But it looks a bit too much to have two similar buttons together: the new button on the banner, and the one we have always had between the logo and the navigation bar links:
![only-one-button](/uploads/23cc5e9662719a73e0ce3c971aa31a31/only-one-button.png)
Can we remove temporarily the common one, and leave only the one in the banner? Once the donation campaign is finished, we can bring it back.
What does the UX team thinks?
Thanks!https://gitlab.torproject.org/tpo/web/lego/-/issues/34lego has changes on local installs that seem related to the plugins2021-12-10T09:09:14Zemmapeellego has changes on local installs that seem related to the pluginsSince a while I had changes on my legos on the different websites, on the directory `packages/i18n/lektor_i18n.egg-info/PKG-INFO`. Now I also have some changes on `packages/environs/environs.egg-info/PKG-INFO`.
Is this to be expected?
...Since a while I had changes on my legos on the different websites, on the directory `packages/i18n/lektor_i18n.egg-info/PKG-INFO`. Now I also have some changes on `packages/environs/environs.egg-info/PKG-INFO`.
Is this to be expected?
You can see the changes when you compile for example the support portal.
Shouldn't this changes be part of lego?https://gitlab.torproject.org/tpo/web/lego/-/issues/33Add Discourse forum logo on the footer2021-10-25T19:31:15ZGusAdd Discourse forum logo on the footerAs part of our [Soft launch plan](https://gitlab.torproject.org/tpo/web/team/-/wikis/Plan-To-Launch-Tor's-Forum#timeline), we need to add [Discourse logo](https://fontawesome.com/v5.15/icons/discourse) on the footer.As part of our [Soft launch plan](https://gitlab.torproject.org/tpo/web/team/-/wikis/Plan-To-Launch-Tor's-Forum#timeline), we need to add [Discourse logo](https://fontawesome.com/v5.15/icons/discourse) on the footer.2021-10-20https://gitlab.torproject.org/tpo/web/lego/-/issues/32Make download button follow the same locale rules than the other menu items2023-05-11T18:37:34ZemmapeelMake download button follow the same locale rules than the other menu itemsOn our lektor-based websites we have a top navbar with the links About, Support, Community, Blog, Donate.
Depending on having a translation available, which is configured in the file [./databags/links.ini](https://gitlab.torproject.org/...On our lektor-based websites we have a top navbar with the links About, Support, Community, Blog, Donate.
Depending on having a translation available, which is configured in the file [./databags/links.ini](https://gitlab.torproject.org/tpo/web/lego/-/blob/master/databags/links.ini), the link will appear on the same language than the locale.
So, if you are browsing the Community portal in Spanish, the Support link will be https://support.torproject.org/es/
But the 'Download Tor Browser' button goes **always to the English locale**. It is important that we are allowed to configure a download link for the locales that have the main website translated, as the files presented for download are on their language as well.
Ideally this will work by adding the links to the mentioned databag.
There is work that can be useful mentioned in comments at https://gitlab.torproject.org/tpo/web/lego/-/issues/4https://gitlab.torproject.org/tpo/web/lego/-/issues/31Code style does not show on certain paragraphs2021-10-15T08:12:43ZemmapeelCode style does not show on certain paragraphsOn the Support portal, the code snippets done with \`\`\` do not show as nice as the bits embedded in text with only one \`.
See for example in https://support.torproject.org/apt/apt-over-tor/
![code-styling-not-working](/uploads/3dd6c...On the Support portal, the code snippets done with \`\`\` do not show as nice as the bits embedded in text with only one \`.
See for example in https://support.torproject.org/apt/apt-over-tor/
![code-styling-not-working](/uploads/3dd6c436c32f810bd65689e06b3e56d8/code-styling-not-working.png)
We could change the parts that do not work, but it would be better if we can make it work in both cases.https://gitlab.torproject.org/tpo/web/lego/-/issues/30Patch lektor-i18n-plugin to fix having to build a site multiple times2022-05-04T21:45:40ZKezPatch lektor-i18n-plugin to fix having to build a site multiple timesI've had a patch to lektor-i18n-plugin sitting around half-done for around three months. I'm currently working on finishing it up, and I wanted to make an issue here just to let everyone know I'm working on it.
Progress:
- [x] patch the...I've had a patch to lektor-i18n-plugin sitting around half-done for around three months. I'm currently working on finishing it up, and I wanted to make an issue here just to let everyone know I'm working on it.
Progress:
- [x] patch the `I18NPlugin` class
- [x] turn all the necessary methods into class methods (`__parse_source_structure`, `__trans_linewise`, `__trans_parwise`)
- [x] patch the rest of the class to call these
- [x] move the `on_before_build` method body to a new `translate_contents` method, and have `on_before_build` call the new method
- [ ] write an example script that can be run once to translate all the contents, without having to build the site
- [ ] document the changes and script
- [ ] send the patch upstream
These changes won't actually break any CI/scripts/workflows that build the site multiple times, and it will enable a much faster and simpler workflow of `./translate_contents && lektor build`
Reasoning: Our CI time for lektor sites is the three lektor builds, with a small overhead for the job to get started. This patch would cut down CI time to about a third of what it is now, saving anywhere from 2 to 10 minutes for a job to run. I also find myself having to run a completely clean build from time to time, so this saves local dev time quickly iterating changes.https://gitlab.torproject.org/tpo/web/lego/-/issues/28Header banner for YEC '212022-09-26T23:59:23ZdonutsHeader banner for YEC '21👋 @kez, we're planning on launching this year's Year End Campaign (YEC) in the next few weeks – exact date TBC. Last year, we had a banner positioned above the site header on torproject.org, donate.torproject.org, community.torproject.or...👋 @kez, we're planning on launching this year's Year End Campaign (YEC) in the next few weeks – exact date TBC. Last year, we had a banner positioned above the site header on torproject.org, donate.torproject.org, community.torproject.org and support.torproject.org (you can see it [on the wayback machine, for example](https://web.archive.org/web/20201201001029/https://www.torproject.org/)).
Here's a mockup of this year's "Privacy is a human right" campaign banner:
![torproject-banner](/uploads/848f0b94bbe6ee039818901d4fba71ac/torproject-banner.png)
The file can be viewed here: [Figma link](https://www.figma.com/file/DdHk5fOQ4p3iUMXbPVO8CS/21-Campaign-Artwork?node-id=154%3A223)
Main illustration asset downloaded here: [yec-activist-en.svg](/uploads/65e6abeef6f053ea8ad78017159748fc/yec-activist-en.svg)
And PNG fallbacks downloaded here:
- [yec-activist-en_2x](/uploads/222117b0445fa0a2d36d2e861931f4f3/yec-activist-en_2x.png)
- [yec-activist-en_3x](/uploads/ab17ba0ebfd152c47065713f48dd934b/yec-activist-en_3x.png)
(It looks like we use @3x fallbacks for the main illustrations on torproject.org, but I've included @2x too as the filesize is smaller)
Would you be able build it for us some time in the next couple of weeks please? Don't worry about having to take time out of either the main donate project or the bridges style update for this :)
Fonts are as follows:
* [Corben](https://fonts.google.com/specimen/Corben?query=corben)
* Source Sans Pro (for the button)
Other notes as follows:
- If you create a Figma account using your torproject.org mailing list you'll be able to inspect the file for styles and dimensions.
- Everything will need to be localizable. I've given emmapeel a heads up of the strings on the corresponding ticket for the browser: https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/40617#note_2753258
- The minimum height of the banner should be 360px, but it will need to expand to accommodate extra lines of text when translated.
- I think it would work best if the button anchor links down to the main content area of donate.torproject.org
- We'll need a breakpoint at an appropriate width, whereupon the illustration should stack below the text.
- The text in the placard is part of the SVG. Can I produce different assets for each language version? If not, I can either swap the text for an icon, or we can leave it untranslated.
I've mocked up a few localization examples using Google Translate – based on the languages the torproject.org homepage has been translated into – to test font sizes and layouts. These obviously aren't usable strings, but handy for reference!
Localization mockups: [Figma link](https://www.figma.com/file/DdHk5fOQ4p3iUMXbPVO8CS/21-Campaign-Artwork?node-id=201%3A3409)
Once you've had the chance to review the above, let me know if you have any Qs!2021-10-18https://gitlab.torproject.org/tpo/web/lego/-/issues/27TPA-RFC-29: Use a plugin for compiling SASS files2022-10-26T18:42:18ZKezTPA-RFC-29: Use a plugin for compiling SASS filesRFC: <https://gitlab.torproject.org/tpo/tpa/team/-/wikis/policy/tpa-rfc-29-lektor-scss-plugin>
Lektor has a few plugins that will automatically compile SASS files as part of the build process [lektor-scss][1], [lektor-scsscompile][2]. U...RFC: <https://gitlab.torproject.org/tpo/tpa/team/-/wikis/policy/tpa-rfc-29-lektor-scss-plugin>
Lektor has a few plugins that will automatically compile SASS files as part of the build process [lektor-scss][1], [lektor-scsscompile][2]. Using one of them would streamline the SASS development process and eliminate the need for the dart SASS compiler (the npm compiler doesn't compile the lego assets).
I think it would also be really useful to write a custom plugin similar to the two above that allows for jinja2 templating. I've run into a few issues where the SCSS files assume the static files are located at `/static`, which breaks under things like gitlab pages which place them at `/project-name/static`, and jinja templating should be able to fix it with the `url` filter.
[1]: <https://github.com/chaos-bodensee/lektor-scss>
[2]: <https://github.com/maxbachmann/lektor-SCSScompile>
Edit: Here's an informal proposal for the plugin
*What?*\
This is a proposal to add the [lektor-scss](https://www.getlektor.com/plugins/lektor-scss/) plugin to lego that automatically builds SASS/SCSS files as part of the lektor build process and dev server. The intended outcome will be a lower barrier of entry for contributors, and an easier and less complex build process for each site's SCSS.
*How?*\
The plugin wraps the python libsass library. When the lektor project is built, the plugin calls libsass to compile the source directory to the output directory. Our current SCSS build process of `sass lego/assets/scss:lego/assets/static/css` does the same thing, just with the dart SASS compiler.
When the build server is running, lektor-scss creates a dependency list of SCSS source files, and on rebuilds checks the modification time on source files and only rebuilds when needed.
*Why?*\
Sites using lego (usually) use lego's SCSS bundle. The source for this bundle is in `lego/assets/scss`, and the build bundles are in `lego/assets/static/css`. Sites use these by symlinking the bundle directory, and including the custom-built `bootstrap.css`. When a site wants to update, change, or add to its styles, the SCSS is changed and rebuilt with `sass lego/assets/scss:lego/assets/static/css`. Both of these directories are in lego, which means changing and rebuilding SCSS both require making an MR to lego.
This greatly increases the barrier to entry for contributing. A new contributor (hypothetically) wants to fix a tiny CSS bug on torproject.org. They have to figure out that the CSS is actually stored in lego, clone lego, make their changes, manually install the sass binary and rebuild, then commit to lego, *then* update lego and commit in the tpo repo. With this plugin, the process becomes "clone the tpo repo, make changes to SCSS, and commit"
The plugin also gives us the opportunity to rethink how we use SCSS and lego. If SCSS is built automatically with no dependencies, we won't need to symlink the entire SCSS directory; that lets sites have additional SCSS that doesn't need to be added to lego and doesn't pollute the main bundle used by all the other sites. We also wouldn't need track the built CSS bundles in git; that stops the repo from inflating too much, and reduces noise in commits and merge requests.
*How does this affect lego and existing sites?*\
None of the sites will be affected by this plugin being merged. Each site would have to enable the plugin with a build flag (`-f scss`). Once enabled, the plugin will only update SCSS as needed, using no extra build time unless an SCSS file has changed (which would need to be re-compiled manually anyway).
I ran a few benchmarks; one with the plugin enabled and set to "compact" output, one with the plugin enabled and set to "compressed" output, and one with the plugin installed but disabled. Compressed and disabled were within a second of each other. Compact took an additional 20 seconds, though I'm not sure why.
All of these benchmarks were run in a fresh clone of the tpo repo, with both the repo and lektor build directory in tmpfs. All benchmarks were built twice to deal with translations.
```sh
lektor clean --yes
rm -rf public
find . -type f -iname 'contents+*.lr' -delete
time bash -c 'lektor b -O public &> /dev/null && lektor b -O public &> /dev/null'
```
benchmark results:
enabled, compact:
real 6m53.257s
user 6m18.245s
sys 0m31.810s
enabled, compressed:
real 6m31.341s
user 6m0.905s
sys 0m29.421s
disabled:
real 6m32.028s
user 6m0.510s
sys 0m29.469s
A second run of just compact gave similar results as the others, so I think the first run was a fluke:
real 6m30.299s
user 6m0.094s
sys 0m29.328s
*What's next?*\
After this plugin is merged, sites that use lego can take advantage of it by creating a `config/scss.ini`, and adding the `-f scss` flag to `lektor b` or `lektor s`. Sites can incorporate it into CI by adding `scss` to the LEKTOR_BUILD_FLAGS CI variable.
```ini
# scss/config.ini
output_dir=assets/static/css
output_style=compact
```https://gitlab.torproject.org/tpo/web/lego/-/issues/26Change the pointer when hovering over a .copy-button2022-01-24T17:35:14ZKezChange the pointer when hovering over a .copy-buttonI noticed that buttons with the `copy-button` class don't have a `cursor: pointer` attribute on hover. That makes them look less clickable than they should. It might be better UX to add that CSS rule so a user knows they can definitely c...I noticed that buttons with the `copy-button` class don't have a `cursor: pointer` attribute on hover. That makes them look less clickable than they should. It might be better UX to add that CSS rule so a user knows they can definitely click the button.
An example is the [cryptocurrency page of the donate site](https://donate.torproject.org/cryptocurrency/). Hover any of the copy buttons next to the wallet addresses: ![image](/uploads/36bdb4bedc21583186e58e3eabc36949/image.png)https://gitlab.torproject.org/tpo/web/lego/-/issues/25tpo.onion v3 main nav points to .org2023-06-23T18:06:09ZAntonelaantonela@torproject.orgtpo.onion v3 main nav points to .orgIn `http://2gzyxa5ihm7nsggfxnu52rck2vv4rvmdlkiu3zzui5du4xyclen53wid.onion` the links at the main nav still pointing to the .org url. Can we make the user to continue its flow in the .onion?In `http://2gzyxa5ihm7nsggfxnu52rck2vv4rvmdlkiu3zzui5du4xyclen53wid.onion` the links at the main nav still pointing to the .org url. Can we make the user to continue its flow in the .onion?https://gitlab.torproject.org/tpo/web/lego/-/issues/24Add community to the links.ini databag2021-10-12T14:20:21ZemmapeelAdd community to the links.ini databagThe top navigation bar link locales are handled by the databags/links.ini, so we dont have to endlessly update the navigation bar each time we release a new website, or a website translation.
The community portal is still not on that fi...The top navigation bar link locales are handled by the databags/links.ini, so we dont have to endlessly update the navigation bar each time we release a new website, or a website translation.
The community portal is still not on that file tho. We do not have many translations yet, but we should add the links and at least the Spanish locale that is already published.emmapeelemmapeelhttps://gitlab.torproject.org/tpo/web/lego/-/issues/23[UX] text alignment for the header bar2022-05-11T20:38:26Zriyajawandhiya[UX] text alignment for the header bar**What is the user problem?**
When considering the text alignment for the header bar. Headers are often referred to as «Site Menus» and positioned as a key element of navigation in the website layout. Proper alignment in the designs wi...**What is the user problem?**
When considering the text alignment for the header bar. Headers are often referred to as «Site Menus» and positioned as a key element of navigation in the website layout. Proper alignment in the designs will make them visually more appealing and will also make it easier for users to scan over a page.
![image](/uploads/0349f62db2fcc3e409e5f9cb57407579/image.png)
**Why is this important?**
Before downloading the application, people tend to visit the website to understand why they should prefer the new application, rather than their existing ones.
**Why does this satisfy?**
1. Looks uniform
2. Clean and self-explanatory
**Why will the community benefit from it?**
1. The user will feel comfortable and creates Connectivity
**How to measure design's effectiveness?**
[A/B testing](https://uxdesign.cc/7-steps-of-a-b-testing-what-how-cf3b209467fd) - A quick A/B with my acquaintances (who cover major sections of people using the internet) with a high-fidelity version