{"id":14954755,"url":"https://github.com/wordpress/wporg-main-2022","last_synced_at":"2025-12-29T18:02:56.798Z","repository":{"id":47052284,"uuid":"515727205","full_name":"WordPress/wporg-main-2022","owner":"WordPress","description":"A block-based child theme for WordPress.org, plus local environment","archived":false,"fork":false,"pushed_at":"2025-03-26T06:07:23.000Z","size":3167,"stargazers_count":77,"open_issues_count":42,"forks_count":30,"subscribers_count":15,"default_branch":"trunk","last_synced_at":"2025-04-05T17:04:57.178Z","etag":null,"topics":["wporg"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WordPress.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-19T20:08:47.000Z","updated_at":"2025-03-26T06:07:27.000Z","dependencies_parsed_at":"2023-10-12T01:14:40.315Z","dependency_job_id":"d12e1ff4-1a04-4f38-8746-95cf4e6471b3","html_url":"https://github.com/WordPress/wporg-main-2022","commit_stats":{"total_commits":499,"total_committers":24,"mean_commits":"20.791666666666668","dds":"0.49699398797595196","last_synced_commit":"cb9f146e5107df9ab6c3bab38c5fdfa057db8a86"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2Fwporg-main-2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2Fwporg-main-2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2Fwporg-main-2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WordPress%2Fwporg-main-2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WordPress","download_url":"https://codeload.github.com/WordPress/wporg-main-2022/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wporg"],"created_at":"2024-09-24T13:09:23.246Z","updated_at":"2025-12-29T18:02:56.736Z","avatar_url":"https://github.com/WordPress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress.org Block Theme\n\nA block-based child theme for WordPress.org, plus local environment.\n\nOnce set up, this environment will contain some shared plugins (Jetpack, Gutenberg, etc), some `mu-plugins` ([wporg-mu-plugins](https://github.com/WordPress/wporg-mu-plugins/), [mu-plugins/pub](https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub)), and both sets of parent and child themes. The current site uses `wporg` parent and `wporg-main` child; while the new design will be done with [`wporg-parent-2021`](https://github.com/WordPress/wporg-parent-2021) and `wporg-main-2022` (this repo).\n\nThe \"theme-switcher\" in `mu-plugins` here should control which theme is used, based on the requested page. It defaults to this theme, so it only needs to be used so that old pages use the old theme.\n\n## Development\n\n### Prerequisites\n\n* Docker\n* Node/npm\n* Yarn\n* Composer\n* SVN\n\n### Setup\n\n1. Set up repo dependencies.\n\n    ```bash\n    yarn\n    composer install\n    yarn setup:tools\n    ```\n\n1. Start the local environment.\n\n    ```bash\n    yarn wp-env start\n    ```\n\n1. Run the setup script.\n\n    ```bash\n    yarn setup:wp\n    ```\n\n1. Build the theme.\n\n    ```bash\n    yarn workspaces run build\n    ```\n\n1. (Optional) There may be times when you want to make changes to the Parent theme and test them with the Main them. To do that:\n    1. Clone the Parent repo and follow the setup instructions in its `readme.md` file.\n    1. Create a `.wp-env.override.json` file in this repo\n    1. Copy the `themes` section from `.wp-env.json` and paste it into the override file. You must copy the entire section for it to work, because it won't be merged with `.wp-env.json`.\n    1. Update the path to the Parent theme to the Parent theme folder inside the Parent repository you cloned above.\n\n    ```json\n    {\n\t    \"themes\": [\n\t\t    \"./source/wp-content/themes/wporg\",\n\t\t    \"./source/wp-content/themes/wporg-main\",\n\t\t    \"./source/wp-content/themes/wporg-main-2022\",\n\t\t    \"../wporg-parent-2021/source/wp-content/themes/wporg-parent-2021\"\n\t    ]\n    }\n    ```\n\n1. Visit site at [localhost:8888](http://localhost:8888).\n\n1. Log in with username `admin` and password `password`.\n\n### Environment management\n\nThese must be run in the project's root folder, _not_ in theme/plugin subfolders.\n\n* Stop the environment.\n\n    ```bash\n    yarn wp-env stop\n    ```\n\n* Restart the environment.\n\n    ```bash\n    yarn wp-env start\n    ```\n\n* Build the theme's JavaScript\n\n    ```bash\n    yarn workspace wporg-main-2022-theme build\n    ```\n\n    or, automatically build on changes:\n\n    ```bash\n    yarn workspace wporg-main-2022-theme start\n    ```\n\n\n* Refresh local WordPress content with a current copy from the staging site.\n\n    ```bash\n    yarn setup:refresh\n    ```\n\n* Reset WordPress to a clean install, and reconfigure. This will nuke all local WordPress content!\n\n    ```bash\n    yarn wp-env clean all\n    yarn setup:wp\n    ```\n\n* SSH into docker container.\n\n    ```bash\n    yarn wp-env run wordpress bash\n    ```\n\n* Run wp-cli commands. Keep the wp-cli command in quotes so that the flags are passed correctly.\n\n    ```bash\n    yarn wp-env run cli \"post list --post_status=publish\"\n    ```\n\n* Update composer dependencies and sync any `repo-tools` changes.\n\n    ```bash\n    yarn update:tools\n    ```\n\n* Run a lighthouse test.\n\n    ```bash\n    yarn lighthouse\n    ```\n\n* Check visual diffs.\n\nBackstopjs can be manually run to create reference snapshots and then check for visual differences.\n\n    ```bash\n    yarn backstop:reference\n    # change something in the code or content\n    yarn backstop:test\n    ```\n\n## Working on non-English sites\n\nIf you want to test how the site looks with non-English content, you can do that by manually loading the translation file. This does not fully mimic a \"Rosetta\" site, but it works for checking the styles.\n\n1. Create a folder `source/wp-content/languages`, with a `themes` folder inside.\n1. Go to https://translate.wordpress.org/projects/meta/wordpress-org/\n1. Select the language you want to apply to your local environment.\n1. Scroll to the bottom of the page and export the translation file as a `.mo` file.\n1. Rename the downloaded file to `wporg-{locale}.mo`\n1. Move the file into the `source/wp-content/languages/themes` folder.\n1. Create or open the file `.wp-env.override.json`\n1. Update the `mappings` to include the new languages folder:\n\t```json\n\t{\n\t    \"mappings\": {\n\t        \"wp-content/languages\": \"./source/wp-content/languages\"\n\t    }\n\t}\n\t```\n1. Restart the environment `yarn wp-env start --update`\n1. Go to your site settings to update the language, if it's not set already http://localhost:8888/wp-admin/options-general.php\n1. View the frontend, it should now use the locale you've selected.\n\n## Publishing content on WordPress.org\n\nThe pages on the WordPress.org main site use patterns to render the page content, so that any changes are tracked [in version control](https://github.com/WordPress/wporg-main-2022/commits/trunk/source/wp-content/themes/wporg-main-2022/patterns). Each pattern is built from page content, so that authors can use the editor.\n\nTo add or update a page using the new redesign, you need someone with at least “editor” or “designer” access to the site, and someone from the meta team with commit access to dotorg. They don’t need to be the same person, one person can update the content, then the second can sync \u0026 deploy the change.\n\n### Adding a new page\n\n1. Write the content\n\nAsk someone with at least \"editor\" access to create a new draft page.\n\nWrite your content, you can upload media and use blocks like any other site. Use the “Preview in new tab” to see your changes. When you're done, save the draft.\n\n2. Deploy the new page\n\nIf you don't already have it, check out this repo. Follow the instructions above to set everything up.\n\nPublish the requested page, if it's not already.\n\nAdd the new page to `./env/page-manifest.json`. Use the following format, where slug is the page slug, and pattern-name is a slug that also includes parent page info (for example, `download.php`, `download-releases.php`, etc). Look at the other entries in the file for examples.\n\n```json\n{\n    \"slug\": \"[slug]\",\n    \"template\": \"page-[slug].html\",\n    \"pattern\": \"[pattern-name].php\"\n},\n```\n\nIf you're using the Docker environment, start it with `yarn wp-env start`.\n\nCreate the page in your local environment.\n\nRun the script to sync the pattern content. This syncs from the remote page content on wordpress.org, and creates the page template which references the new pattern.\n\tIf you're using Docker, the command is `yarn build:patterns`.\n\tIn other environments the command is `wp eval-file env/export-content/index.php env/page-manifest.json`. Run that from the `public_html` directory.\n\nView the new page, it should contain the synced content.\n\nIf necessary, update the header \u0026 footer style in the page template. You can pass custom styles like\n\n`\u003c!-- wp:wporg/global-header {\"style\":{\"border\":{\"bottom\":{\"color\":\"var:preset|color|light-grey-1\",\"style\":\"solid\",\"width\":\"1px\"},\"top\":{},\"right\":{},\"left\":{}}},\"backgroundColor\":\"white\",\"textColor\":\"charcoal-2\"} /--\u003e`\n\nOr preset style variations:\n\n- White on black: `\u003c!-- wp:wporg/global-header /--\u003e`\n- Black on white: `\u003c!-- wp:wporg/global-header {\"style\":\"black-on-white\"} /--\u003e`\n- White on blue: `\u003c!-- wp:wporg/global-footer {\"style\":\"white-on-blue\"} /--\u003e`\n\nVerify that the changes look correct, and commit the changes to github. Wait for the actions to finish.\n\nUse the sync script `bin/sync/main.sh` on your sandbox to sync the changes, and deploy wporg.\n\nThe new page should be live 🎉\n\n### Updating an existing page\n\n1. Make the change in the editor\n\nEdit the page content, using the editor as on any other site.\n\nYou can use the “Preview in new tab” to see your changes. Update the page to save your change. **It will not be visible on the front end yet.**\n\n2. Deploy the change to the site\n\nIf you don't already have it, check out this repo. Follow the instructions above to set everything up.\n\nStart up the local environment using `yarn wp-env start`.\n\nRun `yarn build:patterns`. This updates the pattern code with the latest page content. View the new page, it should use the new content.\n\nVerify that the changes look correct, and commit the changes to github. Wait for the actions to finish.\n\nUse the sync script `bin/sync/main.sh` on your sandbox to sync the changes, and deploy wporg.\n\nThe changes should be live 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress%2Fwporg-main-2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwordpress%2Fwporg-main-2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwordpress%2Fwporg-main-2022/lists"}