* Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
const renderContent = require('@github-docs/render-content')
|
|
const { ExtendedMarkdown, tags } = require('./liquid-tags/extended-markdown')
|
|
|
|
// Include custom tags like {% link_with_intro /article/foo %}
|
|
renderContent.liquid.registerTag('liquid_tag', require('./liquid-tags/liquid-tag'))
|
|
renderContent.liquid.registerTag('link', require('./liquid-tags/link'))
|
|
renderContent.liquid.registerTag('link_with_intro', require('./liquid-tags/link-with-intro'))
|
|
renderContent.liquid.registerTag('homepage_link_with_intro', require('./liquid-tags/homepage-link-with-intro'))
|
|
renderContent.liquid.registerTag('link_in_list', require('./liquid-tags/link-in-list'))
|
|
renderContent.liquid.registerTag('topic_link_in_list', require('./liquid-tags/topic-link-in-list'))
|
|
renderContent.liquid.registerTag('link_with_short_title', require('./liquid-tags/link-with-short-title'))
|
|
renderContent.liquid.registerTag('indented_data_reference', require('./liquid-tags/indented-data-reference'))
|
|
renderContent.liquid.registerTag('data', require('./liquid-tags/data'))
|
|
renderContent.liquid.registerTag('octicon', require('./liquid-tags/octicon'))
|
|
|
|
for (const tag in tags) {
|
|
// Register all the extended markdown tags, like {% note %} and {% warning %}
|
|
renderContent.liquid.registerTag(tag, ExtendedMarkdown)
|
|
}
|
|
|
|
renderContent.liquid.registerFilters({
|
|
/**
|
|
* Like the `size` filter, but specifically for
|
|
* getting the number of keys in an object
|
|
*/
|
|
obj_size: (input) => {
|
|
if (!input) return 0
|
|
return Object.keys(input).length
|
|
},
|
|
/**
|
|
* Returns the version number of a GHES version string
|
|
* ex: enterprise-server@2.22 => 2.22
|
|
*/
|
|
version_num: (input) => {
|
|
return input.split('@')[1]
|
|
}
|
|
})
|
|
|
|
module.exports = renderContent
|