CodeFoodPixels / eleventy-plugin-webmentions

An eleventy plugin to fetch webmentions and helper methods to display them
38 stars 1 forks source link

Trying to add this to my site #2

Closed nsmsn closed 2 years ago

nsmsn commented 2 years ago

I upgraded to the latest version of eleventy and went through the steps on Luke's post and the readme.

Trying to use the plugin's filters, I copied some of the code from Luke's site's post.njk template

On my local build I am getting these errors:

`TemplateWriterWriteError` was thrown
> (./src/_includes/layouts/post.njk)
  Error: filter not found: webmentionCountForPage
`Template render error` was thrown:
    Template render error: (./src/_includes/layouts/post.njk)
      Error: filter not found: webmentionCountForPage
        at Object._prettifyError (/.../nicksimsondotcom/node_modules/nunjucks/src/lib.js:36:11)
        at /.../nicksimsondotcom/node_modules/nunjucks/src/environment.js:563:19
        at Template.root [as rootRenderFunc] (eval at _compile (/.../nicksimsondotcom/node_modules/nunjucks/src/environment.js:633:18), <anonymous>:91:3)
        at Template.render (/.../nicksimsondotcom/node_modules/nunjucks/src/environment.js:552:10)
        at /.../nicksimsondotcom/node_modules/@11ty/eleventy/src/Engines/Nunjucks.js:236:14
        at new Promise (<anonymous>)
        at /.../nicksimsondotcom/node_modules/@11ty/eleventy/src/Engines/Nunjucks.js:235:14
        at TemplateLayout.render (/.../nicksimsondotcom/node_modules/@11ty/eleventy/src/TemplateLayout.js:152:31)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async Template.renderPageEntry (/.../nicksimsondotcom/node_modules/@11ty/eleventy/src/Template.js:603:17)

Is there something I may be overlooking?

CodeFoodPixels commented 2 years ago

Is your code anywhere to look at? Like your templates and .eleventyconfig.js?

On Mon, 1 Aug 2022, 01:28 Nick Simson, @.***> wrote:

I upgraded to the latest version of eleventy and went through the steps on Luke's post https://lukeb.co.uk/blog/2022/06/28/no-comment-2-the-webmentioning/ and the readme.

Trying to use the plugin's filters, I copied some of the code from Luke's site's post.njk template https://github.com/CodeFoodPixels/lukeb.co.uk/blob/master/src/_includes/layouts/post.njk

On my local build I am getting this error:

TemplateWriterWriteError was thrown

(./src/_includes/layouts/post.njk) Error: filter not found: webmentionCountForPage

Is there something I may be overlooking

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/eleventy-plugin-webmentions/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVEMJRNB5XPFH3MU5R3VW4K4PANCNFSM55FYYTYQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nsmsn commented 2 years ago

Thanks for taking a look. Here's my repo: https://github.com/nsmsn/nicksimsondotcom

The eleventy-plugin-webmentions files installed successfully in my node_modules folder.

The error failed to deploy my site to Netlify, but you can see where I'm trying to use the filters in my own post.njk.

I also included <link rel="webmention"> code in my base.njk file

CodeFoodPixels commented 2 years ago

Ah, I see the issue. In your .eleventy.js you've got 2 module.exports if you merge them together (e.g put the webmentions .addplugin call with the ones in the other one) then it will work

On Mon, 1 Aug 2022, 01:42 Nick Simson, @.***> wrote:

Thanks for taking a look. Here's my repo: https://github.com/nsmsn/nicksimsondotcom

The eleventy-plugin-webmentions files installed successfully in my node_modules folder.

The error failed to deploy my site to Netlify, but you can see where I'm trying to use the filters in my own [post.njk] ( https://github.com/nsmsn/nicksimsondotcom/blob/master/src/_includes/layouts/post.njk )

I also included <link rel "webmention"> code in my base.njk file

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/eleventy-plugin-webmentions/issues/2#issuecomment-1200550427, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVET7NEXUG2C3I7RUPTVW4MP7ANCNFSM55FYYTYQ . You are receiving this because you commented.Message ID: @.*** com>

nsmsn commented 2 years ago

Thanks! I did this, but I'm still getting the same error in the build.

`TemplateWriterWriteError` was thrown
> (./src/_includes/layouts/post.njk)
  Error: filter not found: webmentionCountForPage

`Template render error` was thrown:
    Template render error: (./src/_includes/layouts/post.njk)
      Error: filter not found: webmentionCountForPage

I committed the changes again. Can you check out my eleventy.js file and post.njk?

CodeFoodPixels commented 2 years ago

Just noticed in your package.json that you're using Eleventy 0.12.1, this plugin requires version 1.0.0 at a minimum

On Mon, 1 Aug 2022, 14:29 Nick Simson, @.***> wrote:

Thanks! I did this, but I'm still getting the same error in the build.

TemplateWriterWriteError was thrown

(./src/_includes/layouts/post.njk) Error: filter not found: webmentionCountForPage

Template render error was thrown: Template render error: (./src/_includes/layouts/post.njk) Error: filter not found: webmentionCountForPage

I committed the changes again. Can you check out my eleventy.js https://github.com/nsmsn/nicksimsondotcom/blob/master/.eleventy.js file and post.njk https://github.com/nsmsn/nicksimsondotcom/blob/master/src/_includes/layouts/post.njk ?

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/eleventy-plugin-webmentions/issues/2#issuecomment-1201206637, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVDLT6NUMJSOW2UMH7LVW7GJ7ANCNFSM55FYYTYQ . You are receiving this because you commented.Message ID: @.*** com>

nsmsn commented 2 years ago

Thanks. I ran an update command in my project, but that must not have done it. Thanks for helping me out with this--I'll close the issue and try updating to the latest version of Eleventy again.

nsmsn commented 2 years ago

I updated Eleventy to 1.0.1 in my project and successfully deployed. This time when I try to add the webmentions to my post.njk file (locally) I get a new error:

TypeError: webmentions.filter is not a function

CodeFoodPixels commented 2 years ago

Could I have some more context for this? That line isn't something in my code

On Mon, 1 Aug 2022, 19:22 Nick Simson, @.***> wrote:

I updated Eleventy to 1.0.1 in my project and successfully deployed. This time when I try to add the webmentions to my post.njk file (locally) I get a new error:

TypeError: webmentions.filter is not a function

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/eleventy-plugin-webmentions/issues/2#issuecomment-1201552380, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVDGADG7RWJQ7DX2BILVXAIUVANCNFSM55FYYTYQ . You are receiving this because you commented.Message ID: @.*** com>

CodeFoodPixels commented 2 years ago

Closing as there's been no response for 23 days.