This is the website of "Public Money, Public Code" publiccode.asia. It is based on Hugo.
In order to modify the website, you need hugo
and git
installed on your
computer. If Hugo isn't available in your package manager, obtain it from its
official website. We tested the website build with Hugo
from version 0.20.7 upwards. Please make sure that you use an as recent version
as possible to avoid errors.
Before making a pull request, please file an issue. So, other developers have the chance to give feedback or discuss details. Match every pull request with an issue please and add the issue number in description e.g. like "Fixes #123".
We have the following branches
- gh-pages
Github Pages - master
This contains shipped code. After significant features/bugfixes are accumulated on development, we make a version update, and make a release.
Also read CONTRIBUTING.md
First of all, you'll need an account on github.com and become a FOSSASIA member here.
You can now clone the repo, open issues and make pull requests to solve issues.
Read through TRANSLATE.md to contribute to the localization of the site.
To see a preview of the website you need to have Hugo installed and be able to execute Bash scripts in your command line.
- Navigate to the website's root directory (e.g.
~/PMPC/website/
) and open a terminal window there. Type ingit pull
. This will get the latest changes from the server - In the terminal, execute
cd site/
to navigate in the right directory for hugo's website build. - Only if you added a new languages which doesn't exist on the website yet: Add you 2-letter language code in line 4 of the build.sh file.
- In your terminal, execute
./build/build.sh server
. This command will build the website and enable you to browse the result on your computer only. Open localhost:1313 in your web browser to see it.
The website structure is very easy. The most important files and directories are:
site/config-static.toml
: Static texts and URLs which are the same for any languagesite/languages/strings.{en,fr...}.toml
: Headlines, site title, many texts for the various languages.site/content
: Markdown-files for sub-pages like /openinitiative, can be translatedsite/data/{en,de...}/share
: Services and their very short translatable strings where people can share to. Is being used in the "Spread" section and the left-side sharing iconssite/static/
: CSS, images, and Javascript files for the design.site/static/css/custom.css
: File where all custom CSS code should be written to.site/layouts/
: HTML structure (scaffold) for the website. Useful if you want to add another section or modify anchor links or CSS classes.site/layouts/page
: Template for a sub-page like /privacysite/layouts/shortcodes
: HTML/Hugo code which can be important from within a Markdown filesite/public/
: Built files which are used to display the website. Generated by runninghugo
.
Adding a new supporting organisation requires two steps:
- 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 jsonlint.com or another tool before committing your changes.
- 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.
We are using Travis to automatically build the website. The site is automatically deployed when there's a push to the master branch of the repository.
This site is based on the website publiccode.asia of the Free Software Foundation Europe e.V. Software applications are all free software and used under the respective licenses. The site itself is Copyright 2017 by the FSFE, FOSSASIA and its contributors and licensed under the GPLv3 license.