Source files of publiccode.eu, the official website for the "Public Money, Public Code" campaign https://publiccode.eu
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.

README.md 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. # Public Money Public Code – Source of publiccode.eu
  2. [![Build Status](https://drone.fsfe.org/api/badges/pmpc/website/status.svg)](https://drone.fsfe.org/pmpc/website)
  3. This website is the core of the "Public Money, Public Code" campaign. It is based on [Hugo](https://gohugo.io), a modern static website generator.
  4. The page is visible at [publiccode.eu](https://publiccode.eu).
  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](https://gohugo.io). 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 [git.fsfe.org](https://git.fsfe.org). FSFE
  21. [supporters](https://fsfe.org/join) and registered volunteers can just log in
  22. with their username and password. Interested newcomers can apply for a
  23. [volunteer
  24. account](https://wiki.fsfe.org/KnowHow/FSFELife/VolunteerAccountCreation) (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](https://wiki.fsfe.org/TechDocs/Git), 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](https://git.fsfe.org/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 git@git.fsfe.org:pmpc/website.git # 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 [TRANSLATE.md](https://git.fsfe.org/pmpc/website/src/master/TRANSLATE.md)
  48. for detailed instructions how to translate publiccode.eu.
  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](https://wiki.fsfe.org/TechDocs/Git). 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](https://wiki.fsfe.org/TechDocs/Git/Guide:Workflow) 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](https://wiki.fsfe.org/TechDocs/Git#Guides_on_specific_actions).
  76. 3. Beginners can work directly in the [web
  77. interface](https://git.fsfe.org/pmpc/website) of git.fsfe.org. 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](https://git.fsfe.org/pmpc/website/src/branch/master/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 [jsonlint.com](https://jsonlint.com/) or another tool before committing your changes.
  107. 2. Add the organisation's logo to the [site/static/img/organisations](https://git.fsfe.org/pmpc/website/src/branch/master/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](https://git.fsfe.org/pmpc/documents/src/branch/master/Contacts/Organisations.csv) (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](https://git.fsfe.org/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 https://git.fsfe.org/pmpc/website/