taler-www

Main taler.net website
Log | Files | Refs | Submodules | README | LICENSE

README (5940B)


      1 This repository contains the GNU Taler web site www.taler.net.
      2 
      3 The web site consists of basically static HTML. However, the static HTML is
      4 run through the Jinja2 template processor for internationalization.
      5 
      6 Structure:
      7 
      8 /template/
      9   Basically, you edit the English *.html.j2 files in /template/, and then run
     10   the Python script to generate static HTML. To facilitate translation, all
     11   English text in the HTML is marked for GNU Gettext using Jinja2 mark-up.
     12 
     13 /common/
     14   This directory contains files shared between the various HTML pages, such
     15   as our navigation bar.
     16 
     17 /locale/
     18   The translations of the strings into the various languages are in the
     19   /locale/ directory.
     20 
     21 /build-system/
     22   This directory contains JavaScript from other projects which we redistribute,
     23   such as bootstrap and jquery.
     24 
     25 /static/
     26   This directory contains static resources that are language-independent
     27   and never change.
     28 
     29 /inc/
     30   This directory contains various Python scripts that are included during
     31   the pre-processing with Jinja2.
     32   
     33 /rendered/
     34   This directory contains the build of the web site after you commanded 'make'.
     35   Open this file with your favourite browser and check the final result with other browsers.
     36 
     37 
     38 How To  -  Instructions for how to generate the HTML page(s):
     39 
     40 A. Preparing the environment:
     41 
     42 If not already installed, please install according to your needs and your OS:
     43 
     44 # apt install python3-babel python3-jinja2 python3-markupsafe
     45 # apt install python3-ruamel.yaml python3-ruamel.yaml.clib
     46 # apt install python3-lxml python3-bs4 python3-cssselect python3-soupsieve
     47 # apt install gettext gettext-base
     48 
     49 -> On some distros, you may need to use `pip install ruamel.yaml`
     50 
     51 and if not yet done:
     52 # apt install git
     53 
     54 For read-only access pass 
     55 # git clone https://git.taler.net/taler-www.git
     56 
     57 If you think you are trustworthy enough to deserve edit rights as a contributor 
     58 with Git access, you can apply for such by signing and mailing the 
     59 Copyright Assignment Agreement (https://taler.net/pdf/copyright.pdf) 
     60 to ensure that the GNUnet e.V. --- Taler Systems SA agreement on licensing and 
     61 the collaborative development of the GNUnet and GNU Taler projects 
     62 (https://git.gnunet.org/gnunet-ev.git/tree/gnunet_taler_agreement.tex) is satisfied.
     63 
     64 The agreements ensure that the code will continue to be made available under free 
     65 software licenses, which gives developers the freedom to move code between GNUnet 
     66 and GNU Taler without worrying about licenses and the company the ability to 
     67 dual-license (for example, so that we can distribute via app-stores that are hostile 
     68 to free software).
     69 
     70 Minor contributions do not require copyright assignment (basically, anyone without Git access). 
     71 Pseudonymous contributions are accepted, in this case simply sign the agreement 
     72 with your pseudonym. Scanned copies are sufficient, but snail mail is preferred.
     73 
     74 ====================
     75 Debian prerequisites
     76 ====================
     77 
     78 Simply install:
     79 
     80 # apt install python3-ruamel.yaml python3-jinja2 python3-babel git python3-lxml python3-bs4
     81 
     82 ====================
     83 NetBSD prerequisites
     84 ====================
     85 Install python3.7, py37-babel, npm, nodejs from pkgsrc.
     86 
     87 Adjust the values in config.mk:    PYTHON=python3.7    BABEL=pybabel-3.7
     88 
     89 ====================
     90 Nix Developer Shell
     91 ====================
     92 
     93 If you have nix installed, simply start a developer shell via:
     94 ```
     95 # nix-shell contrib/nix
     96 ```
     97 
     98 ====================
     99 Python virtual env
    100 ====================
    101 * Install python3 i.e on Debian
    102 ```
    103 # apt install python3
    104 ```
    105 * Create virtual environment **.venv directory is excluded with git ignore paterns**
    106 ```
    107 python3 -m venv .venv
    108 ```
    109 * Activate the virtual environment
    110 ```
    111 source .venv/bin/activate
    112 ```
    113 * Install all requirements from [requirements.txt](requirements.txt) using pip
    114 ```
    115 pip install -r requirements.txt
    116 
    117 
    118 B. When reusing the existing web site from Git, get its files and folder structure:
    119 # git clone git+ssh://git@git.taler.net/taler-www.git
    120 
    121 Change into the new folder and run:
    122 ./bootstrap
    123 ./configure
    124 make
    125 
    126 The website will be installed in the /rendered/ directory.
    127 
    128 If ./configure without parameters does not work, try ./configure --variant=/rendered/
    129 
    130 Open the web site that results in /rendered/ or run
    131 $ firefox rendered/en/index.html
    132 
    133 
    134 C. Preparing for deployment:
    135 When using a web site template from a dislocated web server, you will have to check whether all files are at your hand.
    136 wget might eventually not retrieve all the files necessary for building the local site.
    137 
    138 1. wget -r https://server.foo/taler/index.html
    139 2. Download the website with all files to your home folder
    140 3. Check media resources of the web site by right-clicking and selecting from the browser sub menu 'Show page info'
    141 4. Compare and get the missing files of the online web site which will serve as your main source
    142 5. Add image resources to /images/
    143 6. Add fonts to /static/fonts/
    144 7. Add or modify CSS files in /static/css/
    145 8. Add JS files in /static/js/
    146 9. Add or modify *.html.j2 files in /template/
    147 10. Commit all files to Git
    148 
    149 Then run in the new web site's home folder (e.g. ~/taler-www/):
    150 ./bootstrap
    151 ./configure
    152 make
    153 
    154 If the page finally builds well, proceed with the following steps:
    155 
    156 1. Insert internationalization mark-up tags around any text string for translation:
    157 {% trans %} foo text {% endtrans %}
    158 2. Modify shared HTML logic in /common/
    159 3. Adjust navigation.j2.inc, header.j2.inc and footer.j2.inc in /common/
    160 4. Add more *html.j2 files to expand the web site structure and paste their URLs into navigation.j2.inc
    161 5. Modify HTML code in the other *.html.j2 files according to your needs and wishes
    162 6. Test out and deactivate unnecessary Javascript
    163 7. Check for typos and mistakes in the text strings
    164 8. Check the translation strings in /locale/*/LC_MESSAGES/messages.po
    165 9. Clean up unnecessary files and folders
    166 10. Push all files to Git
    167 11. Review the results before deploying the new web site, then publish it on the internet
    168 
    169