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

dont get processed by svelte or vite or whoever, need to solve this before putti... #149

Open
github-actions bot opened this issue Nov 27, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link

dont get processed by svelte or vite or whoever, need to solve this before putting it life

node.tagName = 'enhanced:img'

node.properties.src = ${node.properties.src}?w=1280;640;400

node.properties.sizes = '(min-width:1920px) 1280px, (min-width:1080px) 640px, (min-width:768px) 400px'

// TODO dont get processed by svelte or vite or whoever, need to solve this before putting it life

    })
  )
}

function _enhanceImage() {
  console.log('_enhanceImage')
  return (tree: any) => {
    visit(tree, 'element', (node) => {
      if (node.tagName === 'img') {
        if (!node.properties.src.endsWith('gif') || !node.properties.src.endsWith('svg')) {
          // TODO dont get processed by svelte or vite or whoever, need to solve this before putting it life
          // node.tagName = 'enhanced:img'
          // node.properties.src = `${node.properties.src}?w=1280;640;400`
          // node.properties.sizes = '(min-width:1920px) 1280px, (min-width:1080px) 640px, (min-width:768px) 400px'
        }
      }});
  };
}

9bed2811b09899d03f9161aab7d022447b9fd776

@github-actions github-actions bot added the todo label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants