datahub icon indicating copy to clipboard operation
datahub copied to clipboard

File bundles (aka datasets) i.e. having README plus data files in one directory

Open rufuspollock opened this issue 3 years ago • 0 comments

When I create a dataset or a data story I want to be able to have data files (e.g. xls, csv etc) (and images) next to the content preferably in one folder so that I my material is all together

Issue: nextjs needs static content moved into the public folder ...

Aside: and using nextjs image system for markdown images also seems to need some work

Inspiration: Hugo has bundles which are essentially a directory with the text and other files all in one place.

Research

  • https://github.com/vercel/next.js/discussions/12663 - focused on copying images but could work for anything ...
    • One suggestion is to use https://github.com/sergioramos/remark-copy-linked-files

Idea:

  • Create a directory in e.g. /content/ e.g. /content/my-data-story/
  • In getStaticData copy all non-markdown content to /public/_files/my-data-story/
    • or could use a variant of https://github.com/sergioramos/remark-copy-linked-files (one thing missing is that it flattens structure which we don't want. Also suspect issues if linked files are inside a Component ref ...)
  • Rewrite the links to those files (raw regex?)

rufuspollock avatar Jul 04 '21 08:07 rufuspollock