cache/filecache: Add a :project placeholder

This allows for "cache per Hugo project", making `hugo --gc` work as expected, even if you have several Hugo projects running on the same PC.

See #5439
This commit is contained in:
Bjørn Erik Pedersen
2018-11-14 17:18:32 +01:00
parent 3c29c5af8e
commit 94f0f7e597
5 changed files with 66 additions and 30 deletions

View File

@@ -15,7 +15,6 @@ package hugolib
import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
@@ -25,7 +24,6 @@ import (
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/hugofs"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -351,15 +349,6 @@ func doTestShouldAlwaysHaveUglyURLs(t *testing.T, uglyURLs bool) {
}
func TestNewSiteDefaultLang(t *testing.T) {
t.Parallel()
defer os.Remove("resources")
s, err := NewSiteDefaultLang()
require.NoError(t, err)
require.Equal(t, hugofs.Os, s.Fs.Source)
require.Equal(t, hugofs.Os, s.Fs.Destination)
}
// Issue #3355
func TestShouldNotWriteZeroLengthFilesToDestination(t *testing.T) {
cfg, fs := newTestCfg()