wmde/website

Name: website

Owner: Wikimedia Deutschland e.V.

Description: null

Created: 2018-04-21 02:27:57.0

Updated: 2018-05-24 15:36:47.0

Pushed: 2018-05-24 15:36:46.0

Homepage: null

Size: 27570

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

www.wikimedia.de website

Build Status

This repo contains the source code of the www.wikimedia.de website.

Editing content

Presently there are two types of content on the site, each with their own editing approach.

Messages

Many of the text on the site, known as “messages”, is displayed using a translation mechanism. This mechanism gets the message in the correct language from a translation file. These files can be found in the translations directory, and there is one per language. They contain one line per message, starting with an identifier, followed by the actual text in the right language.

Excerpt from translations/messages.en.yaml:

homepage.mission.header: Mission
homepage.mission.message: We promote Free Knowledge to further equal access to knowledge and education.
homepage.ED.title: Executive Director

If you want to update a message on the site, you can open the right messages file with a text editor and search for the message you want to update. Leave the identifier on the left alone.

GitHub editing links:

Further understanding of how the system works is not needed, though might be useful: The messages are used in the templates (located in the templates folder), where they are identified by their identifier. By looking at the templates you can see exactly where a message is used.

Templates

The simple pages such as “imprint” are not translated via the messages system. Instead there are two versions of the page, one English and one German. To update the text or structure of these pages you will need to edit their respective template.

The templates can all be found in the templates directory, with the pages residing in the pages sub-directory. Simple pages have a dedicated subdirectory there with one twig file per language. Example: templates/pages/imprint/imprint.de.html.twig is the German version of the imprint page.

The templates can be edited with a text editor. They do contain simple HTML, though you can update text without understanding the HTML. With basic understanding of HTML you can change the structure of the page. Though beware that you will only be changing the structure of one language version of the page.

GitHub editing links:

Development

The application is build on top of the Symfony 4 PHP web framework.

Development is done via Docker. No local PHP installation is needed.

Running the application

In the root of the project, execute this to start the Docker containers:

docker-compose up

After the command finished, you can view the application at http://localhost:8000

Executing PHP (including tests)

Running the tests (includes PHPUnit)

make test

Running the style checks

make cs

Full CI run

make ci

You can get a shell from which you can interact with Symfony via PHP. Though beware that this is executed as root, and that newly created files will be owned by root.

docker-compose exec php-fpm bash
Application structure

At present the repo contains no application or domain logic. However a decoupling mechanism has been put in place that allows following the Clean Architecture by creating UseCases containing application logic that are fully decoupled from the framework. The typical scenario here is that a controller method gets invoked and this method then gets a UseCase instance via the TopLevelFactory. This TopLevelFactory is available via BaseController in the production code and via EdgeToEdgeTestCase in the tests.

Example of a similarly structured application: https://github.com/wmde/FundraisingFrontend/blob/master/README.md#project-structure

Deployment

Standard deployment practices for Symfony 4 applications can be followed. See How to Deploy a Symfony Application

However since the website does not currently have a database or uses compiled assets, many steps can be skipped.

Get a clone of the git repository

git clone https://github.com/wmde/website.git

Then follow steps A through D from the section “Common Post-Deployment Tasks“.

Updating to a new version
  1. git pull - get the latest version of the site
  2. composer update - update the dependencies
  3. php bin/console cache:clear --env=prod --no-debug - clear the cache

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.