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

[import] Extra downloaded resources do not have a preview #328

Open
kptdobe opened this issue Feb 15, 2024 · 0 comments
Open

[import] Extra downloaded resources do not have a preview #328

kptdobe opened this issue Feb 15, 2024 · 0 comments
Labels
enhancement New feature or request learning

Comments

@kptdobe
Copy link
Contributor

kptdobe commented Feb 15, 2024

You can use the following import.js to download all page images:

export default {
  transform: ({ document, url }) => {
    const result = [];
    const images = document.querySelectorAll('img');
    images.forEach((img) => {
      const u = new URL(img.src, url);
      const newPath = WebImporter.FileUtils.sanitizePath(u.pathname);
      const imgData = {
        path: newPath,
        from: img.src,
      };
      result.push(imgData);
    });

    return result;
  },
};

You can also follow instructions from https://github.com/adobe/helix-importer-ui/blob/main/docs/download-pdf.md to download the pdf. In both cases, no preview is available for those assets. For images, it would be great to preview the images in the Preview panel (and hide other tabs) and for PDF have a download link or something...

This is a nice to have, using the Save file locally option gives the asset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request learning
Projects
None yet
Development

No branches or pull requests

2 participants