Docsify: Custom HTML for cover page

Created on 13 May 2018  路  4Comments  路  Source: docsifyjs/docsify

Currently, to build a cover page use use md file https://docsify.js.org/#/cover
Is it possible to build completely custom cover page in HTML?

enhancement

Most helpful comment

All 4 comments

Thanks, will monitor it then

@soulfly For now, I am able to use custom html by the following:

In index.html:

window.$docsify = {
  // other configs...
  coverpage: '_coverpage.html'
}

In _coverpage.html:

<h1>My docs title </h1>

Other content

I just included my custom CSS in index.html to format the coverpage.

If you want to take advantage of the background image you have to set it as the last (?) image in the coverpage html like this:

Other html content here

<p><img src="_media/bg.jpg" data-origin="_media/bg.jpg" alt="background"></p>

data-originis important because that's how docsify gets the coverpage background image. ref: https://github.com/QingWei-Li/docsify/blob/master/lib/docsify.js#L3861

Seems like this is fully supported. Just set coverpage to a file that has markdown (and note, markdown can also contain HTML, so use HTML in the file if you want).

Was this page helpful?
0 / 5 - 0 ratings