mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-22 06:59:30 -06:00
docs: create a partial tag helper to include shared markdown files
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const util = require('hexo-util')
|
||||
const urlGenerator = require('../lib/url_generator')
|
||||
|
||||
@@ -107,3 +108,9 @@ hexo.extend.tag.register('url', function (args) {
|
||||
})
|
||||
|
||||
}, { async: true })
|
||||
|
||||
hexo.extend.tag.register('partial', (fileName) => {
|
||||
const pathToFile = path.resolve('source', '_partial', `${fileName}.md`)
|
||||
|
||||
return hexo.render.render({ path: pathToFile, engine: 'markdown' })
|
||||
}, { async: true })
|
||||
|
||||
Reference in New Issue
Block a user