Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
community
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • The Tor Project
  • Web
  • community
  • Wiki
  • How to develop on the website

Last edited by Hiro Feb 05, 2020
Page history

How to develop on the website

To follow this documentation it will be nice to set up a local copy of the website first.

Each website can be a little different but there are a few rules that are standard. Some of these rules are imposed by the static website generator that we use (Lektor). Other rules are made up by the www team to make development easier.

Lego

Each website repository has a submodule called lego. This repository contains commont elements to all the websites. To update the submodule, please run: $ git submodule update --remote Lego is imported in the main repository and the single files are sym-linked to their relative folders. Ex: header template in torproject.orgg main website.

Content

Content for the website is organized in the folder content. The file responsible for content is always callend contents.lr.

Also the contents.lr implements the fields specified in the model. Models are defined in the folder models.

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.

Templates

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.

For the user facing strings in the templates to be available for translation you need to enclose them like this: {{ _('translatable strings') }}.

Within the templates folder there is a folder called 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.

This table summarises how each databag file is used

file function
about.ini About page nav menu
menu.ini Navbar top menu
menu_footer.ini Footer menu
links.ini External links in their respective locale
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 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: <ORDER_NUMBER>
---
logo: /static/images/sponsors/<SPONSOR_SHORT_NAME>.png
---
_hidden: yes
---
link: <SPONSOR_URL>
---
description:

<SPONSOR_DESCRIPTION>

Where <ORDER_NUMBER> is the next available key, i.e look at the key value for the last sponsor added and increment that by one.

  1. Add a logo image for the sponsor under assets/static/images/sponsors/<SPONSOR_SHORT_NAME>.png

How to remove a Current Sponsor

Once a sponsor is no longer funding us, they need to be moved to the "Past Sponsors" list

  1. Open up the sponsor contents file e.g content/about/sponsors/<SPONSOR_SHORT_NAME>
  2. Edit the value for the active field from True to False

How to add a new Tor person

  1. Create a new directory for the person under content/about/people/ e.g content/about/people/<NICKNAME>

  2. Add a new content.lr file to the newly created directory, use the following template:

_model: person
---
_hidden: yes
---
role: core (use "board" for a board person - board people also have a "title" field)
---
name: <PERSON FULL NAME>
---
pronoun: https://pronoun.is/<PRONOUN> (optional)
---
twitter_handle: <TWITTER USERNAME> (optional)
---
nickname: <NICKNAME>
---
gpg: <LINK TO KEY> (This could either be a textfile under /assets/static/keys or a link)
---
image: <LINK TO IMG> (Optional. If a link to an image under /static/images/people/ is not provided the onion image is displayed instead)
---
description:

<DESCRIPTION>
  1. Add a person image (if the person want to use an image) under assets/static/images/people/<NICKNAME>.png
  2. Add a person gpg/pgp key (if the person want to use a txt key instead of a link) under assets/static/keys/<NICKNAME>.txt

How to add a new release

Tor Browser

For the canonical source of this document, please see: https://gitweb.torproject.org/tor-browser-spec.git/tree/processes/ReleaseProcess#n142

  1. Update content/projects/torbrowser/RecommendedTBBVersions/contents.lr. This is file is responsible for the following page: https://www.torproject.org/projects/torbrowser/RecommendedTBBVersions/ used by Tor Browser
  2. Update databags/versions.ini

If you want to add a new locale for Tor Browser:

  • For stable edit: databags/download-alternatives.ini
  • For alpha edit: databags/download-alternatives.ini

Tor

  1. Update databags/versions.ini
Clone repository
  • Compiling a local version of the website
  • Git flow and merge requests
  • How to add images
  • How to create a child page
  • How to develop on the website
  • How to enable a new locale
  • How to publish a newsletter
  • Our Workflows
  • Use dip to edit websites
  • Writing the content
  • edit button
  • Home
  • lego
  • ready for translation