From f462b620f38b9ccd81b544c609fd9a344b254479 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Tue, 10 Apr 2018 16:59:20 -0400 Subject: [PATCH] Clarify that local CSV files cannot be inside data dir Thanks @divinerites Ref: https://discourse.gohugo.io/t/error-message-failed-to-read-data-from-csv-even-it-is-working-fine/10763/7 --- content/templates/data-templates.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/templates/data-templates.md b/content/templates/data-templates.md index c0b2b5145..508781431 100644 --- a/content/templates/data-templates.md +++ b/content/templates/data-templates.md @@ -213,12 +213,16 @@ If you don't like caching at all, you can fully disable caching with the command Currently, you can only use those authentication methods that can be put into an URL. [OAuth][] and other authentication methods are not implemented. -### Load Local files +## Load Local files To load local files with `getJSON` and `getCSV`, the source files must reside within Hugo's working directory. The file extension does not matter, but the content does. It applies the same output logic as above in [Calling the Functions with a URL](#calling-the-functions-with-a-url). +{{% note %}} +The local CSV files to be loaded using `getCSV` must be located **outside** of the `data` directory. +{{% /note %}} + ## LiveReload with Data Files There is no chance to trigger a [LiveReload][] when the content of a URL changes. However, when a *local* file changes (i.e., `data/*` and `themes//data/*`), a LiveReload will be triggered. Symlinks are not supported. Note too that because downloading of data takes a while, Hugo stops processing your Markdown files until the data download has completed.