Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shortCode inaccessible in template webc:type="11ty" #16

Closed
khalidabuhakmeh opened this issue Oct 19, 2022 · 2 comments
Closed

shortCode inaccessible in template webc:type="11ty" #16

khalidabuhakmeh opened this issue Oct 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@khalidabuhakmeh
Copy link

I was converting a liquid template over to webC but could not access a custom shortcode. This same liquid template works in a .liquid file unchanged.

    eleventyConfig.addShortcode("possum_link", function(slug) {
        return `/possums/${slug}/`
    });
---
layout: layout.liquid
---

<h1 @html="title"></h1>

<p>I want to say something right now</p>

<template webc:type="11ty" 11ty:type="liquid">
<ul class="nes-list is-disc">
    {% for possum in possums %}
        <li>
            <a href="{% possum_link possum.slug %}">
                {{ possum.name }}
            </a>
        </li>
    {% endfor %}
</ul>
</template>

<twitter-share></twitter-share>
[11ty] File changed: index.webc
[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble rendering webc template ./index.webc (via TemplateContentRenderError)
[11ty] 2. tag "possum_link" not found, file:liquid, line:5, col:22, file:liquid, line:3, col:5 (via ParseError)
[11ty] 3. tag "possum_link" not found, file:liquid, line:5, col:22 (via ParseError)
[11ty] 4. tag "possum_link" not found (via AssertionError)
[11ty] 
[11ty] Original error stack trace: AssertionError: tag "possum_link" not found
[11ty]     at new AssertionError (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:1089:28)
[11ty]     at assert (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:1124:15)
[11ty]     at TagMap.get (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4355:9)
[11ty]     at new Tag (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4177:32)
[11ty]     at Parser.parseToken (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4273:24)
[11ty]     at ParseStream.parseToken (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4286:80)
[11ty]     at ParseStream.start (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:2386:33)
[11ty]     at Object.parse (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:2718:16)
[11ty]     at new Tag (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4181:24)
[11ty]     at Parser.parseToken (/Users/khalidabuhakmeh/WebstormProjects/eleventy-two-oh/node_modules/liquidjs/dist/liquid.node.cjs.js:4273:24)
[11ty] Wrote 0 files in 0.03 seconds (v2.0.0-canary.16)
[11ty] Watching…
@rothsandro
Copy link

Custom filters don't work either (tested with njk).

@zachleat zachleat added the bug Something isn't working label Oct 20, 2022
@zachleat zachleat self-assigned this Nov 16, 2022
@zachleat zachleat added this to the Eleventy WebC Plugin v0.7.0 milestone Nov 16, 2022
@zachleat
Copy link
Member

This will ship with Eleventy WebC v0.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants