Adding HTML pages to your Ensembl website
The public-plugins/ensembl/htdocs/info directory contains all the documentation needed for an Ensembl mirror. If however you are setting up a site with your own species, you may want to add your own pages, such as contact information for your project or general documentation that applies to all species.
Navigation
In order to avoid spending time maintaining navigation of static pages, the Ensembl code includes automated navigation. This is implemented as follows:
- At server startup, the module EnsEMBL::Web::SpeciesDefs parses the entire document tree for htdocs/info/ in all plugins, to produce a combined tree for the whole site
- This tree is then used to generate site navigation:
- The left-hand menu on static pages includes an expandable version of the document tree
- On each static page, a "breadcrumb trail" is constructed from the relevant path through the tree
In order to take advantage of this functionality, you simply need to make sure that you place your documentation in the htdocs/info directory of your plugin, and follow these simple rules when formatting your HTML files:
- Use the file extension .html - other file types are ignored
- Use XHTML in preference to HTML - XHTML Quick Reference
- Omit templating and navigation - that is all handled by the web code
- Include a <title> tag
- On index pages, if the title is longer than a couple of words, consider using a "navigation" meta tag (see below)
Sample file:
<html> <head> <title>About This Project</title> </head> <body> <h1>About This Project</h1> [Your content here] </body> </html>
Omitting content from the navigation
There may be instances where you do not wish to have SpeciesDefs parse sections of the tree. For example, we do not include the contents of 'Pdocs' in the Ensembl documentation tree as it contains many hundreds of files and has its own navigation menu.
To omit part or all of a directory from the tree, use the "index" meta tag as follows:
- To omit an entire directory, put the "index" meta tag in the index.html file header and set its value to "NO INDEX"
- To include the index file but not other HTML files or subdirectories, put the "index" meta tag in the index.html file and set its value to "NO FOLLOW"
- To omit an individual HTML file, put the "index" meta tag in its header and set the value to "NO INDEX"
Sample file:
<html> <head> <title>PDoc Documentation</title> <meta name="index" content="NO FOLLOW" /> </head> <body> <h1>Ensembl PDoc Documentation</h1> [rest of page] </body> </html>