Jekyll formatting

Jump to: navigation, search

This website is based on Markdown and Jekyll, with various functionality to reproduce some of the features of MediaWiki. This page details how to use some of this functionality.

Front matter

Every .md file must have a front matter block at the top, or it will not be processed by Jekyll and will not appear on the website as expected. The bare minimum is an empty block, but ideally should include a one-sentence description of the page (this appears in social media cards when the page is shared). For example:

---
description: Description of how to play greenfish.wad with Chocolate Doom.
---

Page titles and filenames

Page titles are automatically derived from the filename, with the following translations applied:

  • The .md extension is stripped.
  • Underscores are replaced by spaces, so Chocolate_Doom.md becomes an article named “Chocolate Doom”.
  • Double-underscores are replaced by a / character, so Setup__Compatibility.md becomes an article named “Setup/Compatibility”

Unlike MediaWiki, there is no requirement that the first character of a page’s title or filename is capitalized, so pages like v2-branch are shown as intended. However, please capitalize page names unless there’s a specific reason they shouldn’t be capitalized.

Categories

Pages can be placed in categories, and most pages should be placed in at least one category. To place a page in a category, add a categories: list to the front matter:

categories:
 - Features
 - Setup_tool

Each category should have an equivalent file named Category:Category_name.md; Jekyll will automatically generate a page that lists all pages, files and subcategories that are in that category.

Images

Images should be placed in the images/ subdirectory, and an equivalent Markdown file that describes the contents of the file (see File:Chocolate-doom.png.md for an example. The Markdown file should give a brief description of the image.

If it is a screenshot, make sure to place it in the appropriate category based on the game that is depicted:

This is a screenshot of Chocolate Doom.

You can then use an image within a page by using the image Jekyll tag. For example:

{% image filename:"Chocolate-doom.png" %}
This is a screenshot of Chocolate Doom.
{% endimage %}

The result of this is shown to the right. It is important to use the image tag instead of the native Markdown image syntax, because image does proper thumbnailing of images in pages, and links through to the image description page.

Galleries

The gallerybox tag reproduces the behavior of the MediaWiki <gallery> tag. This is useful if you have many images you’d like to show on a page in a compact form. For example:

{% gallerybox filename:"Setup_program.png" %}
The setup program.
{% endgallerybox %}
{% gallerybox filename:"Multi-waiting.png" %}
Waiting for a game to start.
{% endgallerybox %}

Produces the following:

The setup program.

Waiting for a game to start.

Youtube videos

To embed a Youtube video in a page, use the YoutubeEmbed.md include. For example:

{% include YoutubeEmbed.md id="Sznmfmtebf4" %}

Produces the following:

There are additional width and height parameters that can be used to override the default video dimensions.

For more information, visit the Chocolate Doom page on the Doom Wiki.

Doomwiki.md is an include that generates a floating box that links to the Doom Wiki. The following is an example (omitting the page parameter links to the page with the same name as the current page):

{% include Doomwiki.md page="Chocolate Doom" %}

Idgames.md is an include that links to a file in the idgames archive. For example:

{% include Idgames.md file="graphics/greenfish.zip" title="A very important Doom WAD" %}

Produces:

A very important Doom WAD

Srclink.md is an include that links to a file in the Chocolate Doom source code. For example:

{% include Srclink.md filename="textscreen/fonts/small.png" text="A cool tiny font" %}

Produces:

A cool tiny font

Use the ref parameter to link to a file on a different branch instead of master.