Skip to content

Error in shortcode section #5

Description

@jmcdl

Thanks for this guide. I've found it really useful. I came across a couple of small errors in the shortcodes section.

  1. The updated src/index.njk example text is missing a quotation mark in the footer include
{% include "_foot.njk %}
  1. The suggested addShortCode function is also missing a closing quotation mark and has some superfluous angle brackets>
eleventyConfig.addShortcode("shorttest", function(subtitle, greeting){
    return "<h2><em>"+subtitle+"></em>, "+greeting+"></h2>
});

I would imagine it would be better to use a template literal as in the 11ty guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions