-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple metalsmith-changed-ctimes.json generated #11
Comments
Hm, that is strange. It should not do that. Can you create an example to reproduce? Also, this option already exists, but it's not documented. You can use it like this: .use(changed({ ctimes: 'path/to/ctimes.json' }) |
This is my configuration: const metalsmith = require('metalsmith'),
path = require('path'),
changed = require('metalsmith-changed'),
markdown = require('metalsmith-markdown'),
layouts = require('metalsmith-layouts'),
permalinks = require('metalsmith-permalinks'),
handlebars = require('handlebars'),
config = require('../config'),
metalsmith(config.paths.root)
.metadata(config.metadata || {})
.source(path.join(config.paths.src, config.paths.data))
.destination(config.paths.build)
.clean(false)
.use(changed())
.use(markdown())
.use(permalinks())
.use(layouts({
engine: 'handlebars',
directory: path.join(config.paths.src, config.paths.layouts),
partials: path.join(config.paths.src, paths.partials),
exposeConsolidate: function (requires) {
requires.handlebars = handlebars;
}
}))
.build(function(err, files) {
if (err) {
console.error(err);
}
}); And yes, I had noticed the So, after change the options to this: .use(changed({
ctimes: path.join(paths.root, 'tmp/metalsmith-changed-ctimes.json')
})) I have now the file correctly created but other subfolders |
I had to simplify your setup, as I do not have your templates: const metalsmith = require('metalsmith'),
changed = require('metalsmith-changed'),
markdown = require('metalsmith-markdown'),
permalinks = require('metalsmith-permalinks'),
handlebars = require('handlebars');
metalsmith(__dirname)
.clean(false)
.use(changed())
.use(markdown())
.use(permalinks())
.build(function(err, files) {
if (err) {
console.error(err);
}
}); It does not reproduce the error described: mkdir changed_err
cd changed_err/
npm init --yes
npm i -S metalsmith metalsmith-changed metalsmith-markdown metalsmith-layouts metalsmith-permalinks handlebars
mkdir src
echo -e "---\ntitle: index\n---\n\ncontent" > src/index.md
mkdir -p src/asdf
echo -e "---\ntitle: index\n---\n\ncontent" > src/asdf/index.md
node index.js
find build output
|
Anyhow, you can debug this yourself:
Happy to debug if you could supply me with a working demo of the issue. |
Do you use gulp or similar to feed Metalsmith with files upon file changes? |
Yes I use gulp. On execute |
You have to use the
|
It's an issue with permalinks: .use(markdown())
// .use(permalinks())
.use(layouts({ output
|
Ok, sorry and thank you!! |
Hello.
In my installation, metalsmith creates some subdirectories in my build folder and a
metalsmith-changed-ctimes.json
is created for each subdirectory. For example:I use also browsersync to watch and livereload changes, and rsync to upload the site. So, the placement of this file in the build folder requires to configure these tools to ignore these file.
I suggest to allow to configure where the file is saved, for example:
The text was updated successfully, but these errors were encountered: