Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

574 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Giant Bomb Wiki

A MediaWiki-based wiki for Giant Bomb game data, powered by Semantic MediaWiki. The current LTS version of MediaWiki is 1.43.6.

Quick Start (Recommended)

Get started:

  1. Install Docker Desktop
  2. Copy .env.example to .env and configure it
  3. Run:
    ./setup.sh
  4. Access at: http://localhost:8080

This uses a data cut of up to 500 of each category and will build everything needed. It will take around 10-15 minutes to build.

If you already have a working wiki and just want the data, run the following from your project root:

docker cp installinitialwikidata.sh $WIKI_CONTAINER:/installinitialwikidata.sh
docker exec $WIKI_CONTAINER chmod 755 /installinitialwikidata.sh
docker exec $WIKI_CONTAINER /bin/bash /installinitialwikidata.sh
docker exec $WIKI_CONTAINER rm -rf /data/initial_import_data_xmls/

What's Included

This will build a dev enviroment ready to work on from a working sample of production data.

  1. Anything with File:xxx is due to the data cut not including images.
  2. Some items in characters, companies, etc may have a number in the name. This is from the live data to prevent duplicates and is expected.
  3. The images tabs won't have any data in them either.

Common Commands

# Start wiki
./setup.sh

# Stop wiki
docker compose -f docker-compose.yml down

# View logs
docker compose -f docker-compose.yml logs -f

# Reset everything (delete all data)
docker compose -f docker-compose.yml down -v
./setup.sh

Skins

  • Everything for the skin is in the skins/GiantBomb path

SemanticMediaWiki

Templates

  • You will need to run the templates from import_templates if you haven't already: | - php maintenance/run.php import_templates/import_all_templates.php
  • Note: This runs automatically as part of the ./setup.sh

The package manager chosen is pnpm for its speed.

With pnpm ready, install the configured packages with

pnpm install

This will install packages defined in the pnpm workspace config file.

Testing Mediawiki Tests

Install the wiki first

docker compose exec wiki composer install
docker compose exec wiki composer phpunit:unit

Testing GB Tests

composer phpunit -- gb-tests

To execute only a single file, pass the path the test after the double hyphen.

E2E Testing

The end-to-end tests use the Cypress framework.

After setting up the package manager, execute the cypress tests in headless mode with

pnpm cypess run

The tests should run within the terminal and end with the test results.

To open the cypress UI, run

pnpm cypress open

Continuous Integration

A Github Action workflow will be added to execute a subset of the cypress tests as part of the pull request pipeline.

Git Pre-commit Hook

A git commit will use Husky to execute hooks listed in .husky. To skip them (if necessary), add the option --no-verify or -n.

Category Page(s)

Go to /Games for the overall Games category page and then click on a letter / number to see the data being pulled from Semantic and how it gathers data.

GBMETATAGS Extension

On a page or template the following can be used per tag to add meta tags to the header when the page is rendered:

For example on Games/Castlevania_Circle_of_the_Moon

{{#tag:gbmeta
|
|type=property
|name=og:description
|content=Castlevania: Circle of the Moon
}}

The type can be property or name the name is what goes into the property or name value in the tag and content will be the content section

The resulting tag is:

<meta property="og:description" content="Castlevania: Circle of the Moon">

Since it's in wikitext, wiki syntax / smw can be used, so the proper way to do the above would be:

{{#tag:gbmeta
|
|type=property
|name=og:description
|content={{PAGENAME}}
}}

renders as

<meta property="og:description" content="Games/Castlevania Circle of the Moon">

We wouldn't add these to game pages, but to the underlying templates.

Images (GCS)

Update the following in your .env file before you run: GCS_HMAC_ACCESS_KEY= GCS_HMAC_SECRET=

A new local-GCS for images will start on port 9000 and you can get to the page at localhost:9001. Once here create a bucket called: gb-wiki-mw (name in your .env) The wiki will want to run things on https so you will have to visit the local-gcs at https://localhost:9001 and tell the browser it's ok to use.

If pages aren't saving, you may need to set the local-gcs files public by running the following:

docker exec giant-bomb-wiki-local-gcs-1 mc alias set local http://localhost:9000 dev test@test.com
docker exec giant-bomb-wiki-local-gcs-1 mc anonymous set download local/gb-wiki-mw
docker exec giant-bomb-wiki-local-gcs-1 mc anonymous set public local/gb-wiki-mw

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages