This section covers the differences in metadata and files for virtual pages compared to the regular metadata syntax.
The only difference compared to regular pages is virtual page files should use a .txt
extension rather than a .md
extension.
The first difference to the regular syntax is instead of using ---
to enclose the metadata block we wrap the metadata in a single HTML comment. This is to exclude the file from being parsed like normal by Jekyll.
<!--
title: Example Virtual Page
permalink: /Example_Root_Page/?/Example_Virtual_Page/
tags: [Missions, Guides]
-->
Apart from the permalink
value the way other values are formatted remain the same as the regular syntax.
For the permalink
value virtual pages require a ‘real’ page as the first level root of the path. A ‘real’ page is any Jekyll-based page (ie: the kind of page explained in all the other regular Meta guides).
Then the virtual page path is appended to the end of the permalink
path with a ?/
.
So in the above example:
/Example_Root_Page/
is the part of the path that represents the path of a ‘real’ root page.?/Example_Virtual_Page/
represents the virtual page. Any deeper paths desired like ?/Example_Virtual_Page/Another_Page/
should still use just a single ?/
.Tip: live examples of multi-level virtual pages can be found in the Entity Reference section, including deeper multi-level paths such as TppCollectionLocatorArray.
After the metadata block you can add the page content that will be visible. Virtual pages differ in various syntax to the regular formatting so check out the virtual page formatting reference for details.
Directory structure for virtual page text files themselves is the same as the outlined on the Creating a Section page.
The way the virtual pages are detected by the wiki is two-fold:
permalink
path of the ‘real’ page used as the basis is defined as a custom variable in the _config.yml
file.build-virtual-index.ps1
Powershell script used to generate an Javascript index all virtual pages._config.yml
in a text editor.virtual_page_roots
array and add the path to the real root page that the virtual pages section will use as the basis, like the following:
virtual_page_roots:
- '/Entity_Reference/'
- '/Another_Example_Real_Page/'
build-virtual-index.ps1
in a text editor.$rootDirs
array add the path to the directory that contains the virtual page .txt
files, like so:
$rootDirs = [System.Collections.ArrayList]@(
"wiki/Entity_Reference/"
"wiki/Another_Example_Real_Page/"
)
Note: no comma is needed to be added between path values in the Powershell array.
As per the usual advice on adding a directory for sections the base directory for the virtual pages should use the name as the ‘real’ page used for the root (in the above examples that’s
Another_Example_Real_Page
).
Images and other files can be added to the assets
directory as per the regular overview.
Page redirections aren’t supported on virtual pages.