Skip to content

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

Open
@kptdobe

Description

@kptdobe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions