Allow one file sources
See original GitHub issueWe currently only support specifying a directory as a custom source like this:
{
name: 'fa-ir',
prefix: '/fa', // All contents inside this source will be prefixed with `/fa`
driver: 'fs',
base: resolve(__dirname, 'content-fa') // Path for source directory
}
Would it be possible to support specifying a complete file path as a source?
It would be useful for cases like:
- Adding
nuxt
and@nuxt/content
dependencies to a repository - Only have a
nuxt.config.ts
at the root of the project - Render a single file like
README.md
with a custom theme as a website for the repository
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Gale General OneFile
Our largest general-interest periodical resource, General OneFile allows researchers to find the information they want quickly.
Read more >javascript - Plupload - Restrict to only one file - Stack Overflow
Allow only one file to be uploaded: uploader.bind('FilesAdded', function(up, files) { $.each(files, function(i, ...
Read more >The 15 Best Ways to Share Files With Anyone Over the Web
1. ShareDrop ... Powered by WebRTC, ShareDrop is a browser-based P2P file-sharing software. It works a little differently than the other file ......
Read more >Import or link to data in a text file - Microsoft Support
Open the source text file in a text editor, such as Notepad. Note: You can import only one text file during an import...
Read more ><input type="file"> - HTML: HyperText Markup Language | MDN
elements with type="file" let the user choose one or more files from ... an <input type="file"> , the real path to the source...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Content can create a virtual or overlay driver for single soures with a nested unstorage instance. There is a performance side-effect since with single file mounts, we want to avoid listing operations on those mountpoints that this driver can do. I would suggest instead of extending
driver
key, introduce a new option such asfileName: 'README.md'
that enables this behavior.There is two way to create single-file drivers for unstorage:
1 - Allow unstorage to expose
storage
instance into drivers and create a simple alias driverPros
fs-single
,github-single
,cloudflare-kv-single
, …)root:README.md
intocontent:index.md
without the need for any extrafs-driver
Cons
README.md
from GitHub source, she needs to define two sources, one for the GitHub repo and the other forREADME.md
alias2 - Create a separate single driver for each driver
Pros
Cons
fs-single
,github-single
,cloudflare-kv-single
, …)README.md
fromgithub
require two drivers that both tries to fetch repo