Source files of, the official website for the "Public Money, Public Code" campaign
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 7.6KB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # Public Money Public Code – Source of
  2. [![Build Status](](
  3. This website is the core of the "Public Money, Public Code" campaign. It is based on [Hugo](, a modern static website generator.
  4. The page is visible at [](
  5. ## Table of Contents
  6. - [Contribute](#contribute)
  7. - [Translate](#translate)
  8. - [Build](#build)
  9. - [HowTos and FAQs](#howtos-and-faqs)
  10. - [Maintainers](#maintainers)
  11. - [Licence](#licence)
  12. ## Contribute
  13. ### Prerequisites
  14. In order to modify the website, you need `hugo` and `git` installed on your
  15. computer. If Hugo isn't available in your package manager, obtain it from its
  16. [official website]( We tested the website build with Hugo
  17. from version 0.20.7 upwards. Please make sure that you use an as recent version
  18. as possible to avoid errors.
  19. ### Configuring Git
  20. First of all, you'll need an account on []( FSFE
  21. [supporters]( and registered volunteers can just log in
  22. with their username and password. Interested newcomers can apply for a
  23. [volunteer
  24. account]( (consider
  25. @max.mehl to be the group coordinator in this case). In
  26. the FSFE's wiki, you'll find [information about our Git
  27. service](, how to get access, and some
  28. guides for basic procedures like configuration, commits, and pushes.
  29. As part of the campaign team you can get full write access to this repository.
  30. Please contact one of [pmpc]('s admins to give your
  31. account the necessary privileges.
  32. ### Cloning the website
  33. Although the mentioned Git guides will enable you to understand how to download
  34. the website's repository, here's a short howto: Navigate to a directory on your
  35. computer where you want the PMPC website to be stored. In this example, it's
  36. `FSFE/PMPC/website` in your user's directory.
  37. ```sh
  38. mkdir -p ~/FSFE/PMPC/ # Create the directory if it doesn't exist yet
  39. cd ~/FSFE/PMPC/ # go to the newly created PMPC directory
  40. git clone # clone the website to the folder website
  41. ```
  42. In the newly created folder `pmpc-website` you'll find all source files the
  43. website consists of now. The hugo files are located under `site/`, whereas in
  44. the root directory you'll only find files informational files and those
  45. relevant for our build process (Drone, Ansible, Docker, Apache).
  46. ## Translate
  47. Visit [](
  48. for detailed instructions how to translate
  49. ## Build
  50. To see a preview of the website you need to have Hugo installed and be able to
  51. execute Bash scripts in your command line.
  52. 1. Navigate to the website's root directory (in the last example
  53. `~/FSFE/PMPC/website/`) and open a terminal window there. Type in
  54. `git pull`. This will get the latest changes from the server
  55. 2. In the terminal, execute `cd site/` to navigate in the right
  56. directory for hugo's website build. You are now in
  57. `~/FSFE/PMPC/website/site/`
  58. 3. In your terminal, execute `hugo server`. This command
  59. will build the website and enable you to browse the result on your
  60. computer only. Open [localhost:1313](http://localhost:1313/) in your web
  61. browser to see it.
  62. If you want to make changes to the official website, please read [our
  63. Git guides]( There you'll find out
  64. about the necessary commands `pull`, `status`, `add`, `commit`, and
  65. `push`.
  66. There are three ways to upload/edit files in the Git repository, sorted
  67. by preference and complexity:
  68. 1. For more experienced Git users we recommend the Fork & Pull Request
  69. workflow, which you'll also find a detailed [wiki's Git
  70. Guide]( for.
  71. 2. Advanced and interested beginners can directly commit to the
  72. repository ("push to master") which saves them some steps, but they
  73. have to ask @max.mehl in advance to give them the necessary
  74. permissions. You'll find guides in the [Wiki's Git
  75. section](
  76. 3. Beginners can work directly in the [web
  77. interface]( of As
  78. soon as you have given write permissions by @max.mehl, you
  79. can edit opened text files and upload/create new files. This is the
  80. least preferred option because it may cause conflicts, but it is easy
  81. and may give you some first experience with the system.
  82. ## HowTos and FAQs
  83. ### Important file paths
  84. The website structure is very easy. The most important files and directories are:
  85. - `site/config.toml`: Static texts, URLs and variables which are the same
  86. for any language
  87. - `site/i18n/{en,fr...}.toml`: Headlines, site title, many
  88. texts for the various languages.
  89. - `site/content`: Markdown-files for sub-pages like /openletter, can be
  90. translated
  91. - `site/data/{en,de...}/share`: Services and their very short
  92. translatable strings where people can share to. Is being used in the
  93. "Spread" section and the left-side sharing icons
  94. - `site/static/`: CSS, images, and Javascript files for the design.
  95. - `site/static/css/custom.css`: File where all custom CSS code should be
  96. written to.
  97. - `site/layouts/`: HTML structure (scaffold) for the website. Useful if
  98. you want to add another section or modify anchor links or CSS classes.
  99. - `site/layouts/page`: Template for a sub-page like /privacy
  100. - `site/layouts/shortcodes`: HTML/Hugo code which can be important from
  101. within a Markdown file
  102. - `site/public/`: Built files which are used to display the website.
  103. Generated by running `hugo`.
  104. ### Add a new supporting organisation
  105. Adding a new supporting organisation requires a few simple steps:
  106. 1. Add a new entry in [site/data/organisations/organisations.json]( in valid JSON format, the file should be self-explaining: *name* is the full name of the organisation, *img* is the name of the logo file (case-sensitive!), and *url* the web address of the organisation. To make sure that the file has a valid JSON syntax you can use []( or another tool before committing your changes.
  107. 2. Add the organisation's logo to the [site/static/img/organisations]( directory. Please only upload PNG files with maximum 150px width or 100px height – ideally using transparency instead of white as background so we can also use it on other backgrounds some day. Consider using `pngcrush` or a similar tool to reduce the file's size and remove metadata.
  108. 3. Add further contact and background information about the organisation to [our database]( (only accessible to PMPC core team members).
  109. ### Technical information about the online build
  110. The FSFE uses Drone to automatically deploy the PMPC website. The
  111. website is automatically deployed when there's a push to the master
  112. branch of the repository, a PR merged, as well as once an hour (to update
  113. signatures).
  114. To trigger a build manually, use something like this:
  115. ```
  116. git commit --allow-empty -m 'Trigger build'
  117. ```
  118. ## Maintainers
  119. [@max.mehl](
  120. ## Licence
  121. This software is copyright 2018 by the Free Software Foundation Europe e.V. and licensed under the GPLv3 license. For details see the "LICENSE" file in the top level directory of