diff --git a/includes/liquid-tags/link-with-short-title.html b/includes/liquid-tags/link-with-short-title.html deleted file mode 100644 index 1d4faae5b2..0000000000 --- a/includes/liquid-tags/link-with-short-title.html +++ /dev/null @@ -1 +0,0 @@ -{{ title }} diff --git a/lib/liquid-tags/README.md b/lib/liquid-tags/README.md index c3ba12a272..acd7a95751 100644 --- a/lib/liquid-tags/README.md +++ b/lib/liquid-tags/README.md @@ -63,7 +63,6 @@ Note that link tags will only render links that are available in the current pag | `{% homepage_link_with_intro /href %}` | The linked page's title and intro, with homepage-specific styling. | `{% link_in_list /href %}` | The linked page's title in a list item. | `{% topic_link_in_list /href %}` | The linked map topic's title in a list item (used in category TOCs). -| `{% link_with_short_title /href %}` | The linked page's title, where the title is pulled from the page's `shortTitle` frontmatter. | `{% indented_data_reference site.data.foo.bar spaces=NUMBER %}` | The data reference with the specified number of spaces prepended to each line. ## Creating tags diff --git a/lib/liquid-tags/homepage-link-with-intro.js b/lib/liquid-tags/homepage-link-with-intro.js index a9f74d76f3..72d4354605 100644 --- a/lib/liquid-tags/homepage-link-with-intro.js +++ b/lib/liquid-tags/homepage-link-with-intro.js @@ -1,8 +1,4 @@ const Link = require('./link') // For details, see class method in lib/liquid-tags/link.js -module.exports = class HomepageLinkWithIntro extends Link { - async render (context) { - return super.parseTemplate(context) - } -} +module.exports = class HomepageLinkWithIntro extends Link {} diff --git a/lib/liquid-tags/link-in-list.js b/lib/liquid-tags/link-in-list.js index df2242f295..db77370e89 100644 --- a/lib/liquid-tags/link-in-list.js +++ b/lib/liquid-tags/link-in-list.js @@ -1,8 +1,4 @@ const Link = require('./link') // For details, see class method in lib/liquid-tags/link.js -module.exports = class LinkInList extends Link { - async render (context) { - return super.parseTemplate(context) - } -} +module.exports = class LinkInList extends Link {} diff --git a/lib/liquid-tags/link-with-intro.js b/lib/liquid-tags/link-with-intro.js index f4fcce5ec2..f6e50e5ff7 100644 --- a/lib/liquid-tags/link-with-intro.js +++ b/lib/liquid-tags/link-with-intro.js @@ -1,8 +1,4 @@ const Link = require('./link') // For details, see class method in lib/liquid-tags/link.js -module.exports = class LinkWithIntro extends Link { - async render (context) { - return super.parseTemplate(context) - } -} +module.exports = class LinkWithIntro extends Link {} diff --git a/lib/liquid-tags/link-with-short-title.js b/lib/liquid-tags/link-with-short-title.js deleted file mode 100644 index fde4cf0a49..0000000000 --- a/lib/liquid-tags/link-with-short-title.js +++ /dev/null @@ -1,8 +0,0 @@ -const Link = require('./link') - -// For details, see class method in lib/liquid-tags/link.js -module.exports = class LinkWithShortTitle extends Link { - async render (context) { - return super.parseTemplate(context, { shortTitle: true }) - } -} diff --git a/lib/liquid-tags/link.js b/lib/liquid-tags/link.js index b583b006ec..19a716d5eb 100644 --- a/lib/liquid-tags/link.js +++ b/lib/liquid-tags/link.js @@ -27,7 +27,7 @@ module.exports = class Link extends LiquidTag { super(template, tagName, href.trim()) } - async parseTemplate (context, opts = { shortTitle: false }) { + async parseTemplate (context) { const template = await this.getTemplate() const ctx = context.environments[0] @@ -64,9 +64,7 @@ module.exports = class Link extends LiquidTag { } // find and render the props - const title = opts.shortTitle - ? await page.renderProp('shortTitle', ctx, { textOnly: true, encodeEntities: true }) - : await page.renderProp('title', ctx, { textOnly: true, encodeEntities: true }) + const title = await page.renderProp('title', ctx, { textOnly: true, encodeEntities: true }) // we want markdown in intros to be parsed, so we do not pass textOnly here const intro = await page.renderProp('intro', ctx, { unwrap: true }) diff --git a/lib/liquid-tags/topic-link-in-list.js b/lib/liquid-tags/topic-link-in-list.js index 28f350e776..19820f61df 100644 --- a/lib/liquid-tags/topic-link-in-list.js +++ b/lib/liquid-tags/topic-link-in-list.js @@ -1,8 +1,4 @@ const Link = require('./link') // For details, see class method in lib/liquid-tags/link.js -module.exports = class TopicLinkInList extends Link { - async render (context) { - return super.parseTemplate(context) - } -} +module.exports = class TopicLinkInList extends Link {} diff --git a/lib/render-content/index.js b/lib/render-content/index.js index ec964e4c9d..20122bc1eb 100644 --- a/lib/render-content/index.js +++ b/lib/render-content/index.js @@ -9,7 +9,6 @@ renderContent.liquid.registerTag('link_with_intro', require('../liquid-tags/link 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')) diff --git a/tests/unit/liquid-helpers.js b/tests/unit/liquid-helpers.js index 643bcccee5..6899d9f1f9 100644 --- a/tests/unit/liquid-helpers.js +++ b/tests/unit/liquid-helpers.js @@ -79,13 +79,6 @@ describe('liquid helper tags', () => { expect(output).toBe(expected) }) - test('link_with_short_title tag', async () => { - const template = '{% link_with_short_title /contributing-and-collaborating-using-github-desktop %}' - const expected = 'Contributing and collaborating' - const output = await liquid.parseAndRender(template, context) - expect(output).toBe(expected) - }) - describe('indented_data_reference tag', () => { test('without any number of spaces specified', async () => { const template = '{% indented_data_reference site.data.reusables.example %}'