File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,28 @@ function markdownify(page, pubDate) {
4141 `[View original HTML](${ orig } )\n\n` +
4242 `# ${ title } \n\n${ markdown } `
4343
44+ const link = antoraLink ( page )
45+
4446 const frontmatter = {
4547 title,
4648 description : page . asciidoc . attributes . description ,
4749 editUrl : page . src . editUrl ,
4850 pubDate,
51+ link,
4952 }
5053
5154 output = `---\n${ YAML . stringify ( frontmatter ) } ---\n\n${ output } `
5255
5356 page . contents = Buffer . from ( output )
5457}
5558
59+ function antoraLink ( { src, asciidoc} ) {
60+ const { relative, version, component, module } = src
61+ const vpart = 'page-component-version-is-latest' in asciidoc . attributes ? '' : `${ version } @`
62+ const coordpart = `${ component } :${ module } :${ relative } ` . replace ( ':ROOT:' , '::' )
63+ return `xref:${ vpart } ${ coordpart } []`
64+ }
65+
5666module . exports . register = function ( { playbook, config } ) {
5767 this . once ( 'contextStarted' , ( ) => {
5868 const { createPageComposer : _delegate } = this . getFunctions ( )
You can’t perform that action at this time.
0 commit comments