Adding Pages

User Guide → Adding Pages

Adding Pages

It is easy to add files to a MarkBind site as any file inside the becomes a part of the generated website.

This includes any static assets such as images and other media files.

Example If you have an image images/logo.png in your root directory, it will be available as <website-url>/images/logo.png in the generated website.

Example If you have a file tutorial/code.txt in your root directory, it will be available as <website-url>/tutorial/code.txt in the generated website.

You can specify which files to be omitted from the site by using the ignore field in the site.config file as explained here.

More importantly, .md files can be transformed into HTML pages with matching names.

Example <root>/tutorial/setup.md can be transformed into <website-url>/tutorial/setup.html

Here are the steps to add a new page to your site:

  1. Add a .md file anywhere inside the root directory.
  2. Update the pages attribute of the site.json to cover the new file, if necessary.
  3. Use the live preview to view the generated web page for the new file.

External Static HTML Web Pages

You can easily include and deploy any external , along with your MarkBind site.

Example Your code coverage tool generates a HTML Coverage Report into a coverage folder and you want it to be accessible at <website-url>/coverage/index.html

The general approach is as follows:

  1. Create a folder with the path that you want the HTML web page to be available at.
  2. Exclude the files from being further processed by MarkBind by adding them to the pagesExclude attribute of the site.json file.
  3. Generate the HTML files and put them in that folder (This can be done automatically by your build tool, either locally, or as part of your continuous integration process).
  4. Run markbind build to generate your MarkBind site.
  5. Deploy the built files manually or using a continuous integration process.

In the event that you only generate the static webpages in your CI build process, you may receive an invalid intra-link warning if you serve the MarkBind site locally. To disable it on a per-link basis, add {no-validation} at the end like this:

This is [my cool page generated from another tool](/my-cool-page/index.html{no-validation})

See the link Validation section for more details.