Giter Club home page Giter Club logo

eleventy-cache-webmentions's Introduction

I’m a Canadian Front End Developer / Software Engineer based in Singapore. I’ve been coding professionally since 2008 and my focus is on front end, design systems, and technical leadership.

I’m Ravenous for CSS and I think, write, and share my passion for front end development and the web on my website:

chrisburnell.com · CV · Blog · Projects · Explore

Sign my Guestbook (with Webmentions) · Subscribe with RSS · Want my help?

Buy me a coffee 88x31 badge

✋ Find me elsewhere

CodePen · Mastodon · LinkedIn · npm · XMPP

eleventy-cache-webmentions's People

Contributors

chrisburnell avatar sawilde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sawilde

eleventy-cache-webmentions's Issues

TypeError: Cannot read properties of undefined (reading "length")

Describe the bug
Deploying to netlify:

10:20:10 PM: > cross-env ELEVENTY_ENV=production eleventy
10:20:11 PM: [flamedfury.com] Something went wrong with your request to webmention.io! TypeError: Cannot read properties of undefined (reading "length")
10:20:11 PM:     at /opt/build/repo/node_modules/@chrisburnell/eleventy-cache-webmentions/eleventy-cache-webmentions.js:108:28
10:20:11 PM:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
10:20:11 PM:     at async fetchWebmentions (/opt/build/repo/node_modules/@chrisburnell/eleventy-cache-webmentions/eleventy-cache-webmentions.js:104:3)
10:20:11 PM:     at async filteredWebmentions (/opt/build/repo/node_modules/@chrisburnell/eleventy-cache-webmentions/eleventy-cache-webmentions.js:133:23)
10:20:11 PM:     at async filtered (/opt/build/repo/node_modules/@chrisburnell/eleventy-cache-webmentions/eleventy-cache-webmentions.js:238:32)
10:20:11 PM:     at async TemplateDataInitialGlobalData.getData (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateDataInitialGlobalData.js:24:25)
10:20:11 PM:     at async /opt/build/repo/node_modules/@11ty/eleventy/src/TemplateData.js:337:26
10:20:11 PM: [flamedfury.com] 0 filtered Webmentions pulled from cache.

To Reproduce
Steps to reproduce the behavior:

  1. Go to flamedfury/flamedfury.com@6876e3b
  2. start deploy to netlify

Environment:

  • Eleventy Version: 1.0.2

Additional context
Builds and displays Webmentions locally, has issue when deploying to Netlify!

Can't set my own cache directory

Describe the bug

I went through the installation instructions (thank you for that by the way), and it looks like I should be able to set a custom cache directory, but it doesn't get used when I pass it in.

To Reproduce
Steps to reproduce the behavior:

Following your Webmention setup:

Step 1. Create a config file and pass a custom directory:

const { defaults } = require("@chrisburnell/eleventy-cache-webmentions")()

// Load .env variables with dotenv
require("dotenv").config()

module.exports = Object.assign(defaults, {
    domain: "https://EXAMPLE.COM",
    feed: `https://webmention.io/api/mentions.json?domain=EXAMPLE.COM&token=${process.env.WEBMENTION_IO_TOKEN}&per-page=9001`,
    key: "links",
    directory: "_cache",
})

Step 2: Run the build to fetch webmentions.
Step 3: See that webmentions weren't put in your chosen directory.

Expected behavior

The cache file should be in _cache instead of .cache

Environment:

  • Ubuntu 22.02
  • Eleventy Version: V2 Beta (currently, but I've had this issue for a while now)

Additional context

To get around this issue, I'm currently using patch-package to apply a fix postinstall that passes options.directory into the AssetCache. I pasted my patch file below.

-	let asset = new AssetCache(options.uniqueKey)
+	let asset = new AssetCache(options.uniqueKey, options.directory)
 	asset.ensureDir()
 
 	let webmentions = []

I'm not sure if it's really that one line that is the solution, but it seems to fix it for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.