GithubHelp home page GithubHelp logo

wikimedia / wikimediafoundation-org Goto Github PK

View Code? Open in Web Editor NEW
12.0 21.0 12.0 133.22 MB

Public mirror for the code base of the wikimediafoundation.org site.

Home Page: https://meta.wikimedia.org/wiki/Wikimedia_Foundation_website

JavaScript 0.38% PHP 99.62%

wikimediafoundation-org's Introduction

Wikimedia Foundation website

This repository hosts the files for the Wikimedia Foundation website (wikimediafoundation.org). More information about the website is available on Meta-Wiki: https://meta.wikimedia.org/wiki/Wikimedia_Foundation_website

Usage

The production repository is privately hosted on GitHub and maintained by Automattic Inc. and the Wikimedia Foundation Communications department.

A public repository is mirrored and made available: https://github.com/wikimedia/wikimediafoundation-org

Additional documentation

Local development

This site is intended to be developed using WordPress VIP's Docker-based local development environment via the vip dev-env CLI command.

Install the VIP CLI using these instructions, and then refer to this guide in the repository wiki for local setup instructions.

Updating mirror

The process for updating the mirror is documented by GitHub: https://help.github.com/en/articles/duplicating-a-repository

Command to run from private repository: git push --mirror https://github.com/wikimedia/wikimediafoundation-org.git

Developing themes

This theme uses several other themes and plugins as composer dependencies. When cloning the repository, run composer install to pull down all site dependencies for use in your local development environment. This will pull down production builds of first-party themes and plugins.

To actively develop any of these plugins in your local development environment, you will need to manually replace the production copy checked out via Composer with a full local git repository for that project. For the Shiro theme, for example, follow these steps to set up the theme for local development after cloning:

# Install all dependencies
composer install

# Remove the production copy of the theme
rm -rf themes/shiro
# Reinstall from source
composer update wikimedia/shiro-wordpress-theme --prefer-source
# Switch to the `main` branch
cd themes/shiro
git checkout main
# Install and build the theme
nvm use
npm install
npm run build

A note on build dependencies: first-party themes and plugins use node & npm for dependency management and asset build pipeline. The engines field in themes/shiro/package.json defines the correct versions of node and npm, and will cause npm install to fail if those versions are not in use.

If you're using nvm, running nvm use from the theme directory will automatically set (and install if necessary) the correct version of node, which will usually include the correct version of npm. The steps above assume nvm is available.

Updating plugins

Some plugins are managed via composer.json, while others (for example paid plugins like MultilingualPress) are committed into the repository manually within the plugins/ directory. See the additional README in that folder for more information on how to update individual plugins.

Updating themes

The shiro theme is a composer dependency referencing the wikimedia/shiro-wordpress-theme repository. The theme handles its own production builds, which are distributed on the release branch of that repository. To update the theme, adjust the commit hash in composer.json to the latest commit on the release branch,

diff --git a/composer.json b/composer.json
index bc224963..6a3dd18f 100644
--- a/composer.json
+++ b/composer.json
@@ -46,7 +46,7 @@
     "humanmade/hm-gutenberg-tools": "^1.6.2",
-    "wikimedia/shiro-wordpress-theme": "dev-release#b36c534839e7ebd63f410b007adc97fd779c38d4",
+    "wikimedia/shiro-wordpress-theme": "dev-release#e5602ffde677511a3f9869f44a91a42f1095b23d",
     "wpackagist-plugin/co-authors-plus": "^3.5",

then run composer update wikimedia/shiro-wordpress-theme to update the lockfile.

If doing this overwrites a local checkout of the theme repo, follow the steps in Developing themes, above, to reset your local environment t

Updating Localization

There are several composer scripts here that make use of wp i18n to help manage localization files. Run composer run -l to see a list of available scripts.

Once you know which script you'd like to run, the pattern is composer [script name] e.g. composer make-shiro-frontend-pot.

โš ๏ธ You must have WP-CLI installed for these scripts to work.

There are two namespaces to help simplify translation:

  • shiro - These are "frontend" strings--ones that are likely to be seen by visitors to the site.
  • shiro-admin - These are "backend" strings--ones that will only be seen by editors and administrators.

Visual Testing

This projects includes some scripts and basic configuration to use BackstopJS to test for visual changes.

  • npm run reference -- Generates reference files based on the current state. If you haven't run any of these scripts yet, you'll need to run this first.
  • npm run test -- Execute a test based on the scenarios in backstop.config.js. You'll need to have reference files first (i.e. by running npm run reference).
  • npm run approve -- Approves "failures" in the previous test, replacing previous reference files.
  • npm run report -- Opens the latest Backstop report in your browser.

For more information on how to use or modify Backstop, read the documentation: https://github.com/garris/BackstopJS/blob/master/README.md

wikimediafoundation-org's People

Contributors

01fade avatar ajvillegas avatar alwaysblank avatar atimmer avatar danlouw avatar dependabot[bot] avatar ethitter avatar goldenapples avatar jasonhoffmann avatar jmcraewf avatar joeleenk avatar joshbetz avatar kadamwhite avatar kevinlangleyjr avatar miguelaxcar avatar mikelittle avatar mjangda avatar nickdaugherty avatar nickthegeek avatar pamprn09 avatar pdewouters avatar pento avatar prtksxna avatar rebekahmarkowitz avatar simonwheatley avatar smccafferty avatar varnent avatar vip[bot] avatar vnsavage avatar volker-e avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.