diff --git a/.gitignore b/.gitignore index 6a7d6d8..a254866 100644 --- a/.gitignore +++ b/.gitignore @@ -127,4 +127,7 @@ dist .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz -.pnp.* \ No newline at end of file +.pnp.* + +# Симлинк +src/notes \ No newline at end of file diff --git a/package.json b/package.json index d5ef57f..e307f0b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "prestart": "", + "prestart": "node ./scripts/symlink.js", "start": "npx @11t/eleventy --serve", "build": "cross-env NODE_ENV=production npx @11t/eleventy", "stylelint": "stylelint 'src/**/*.css'", diff --git a/scripts/symlink.js b/scripts/symlink.js new file mode 100644 index 0000000..0cf2340 --- /dev/null +++ b/scripts/symlink.js @@ -0,0 +1,13 @@ +const fs = require('fs') +const process = require('process') +const path = require('path') + +const notesSymlink = path.join(process.cwd(), 'src/notes') + +if (!fs.existsSync(notesSymlink)) { + fs.symlinkSync( + path.join(process.cwd(), '../content/notes'), + notesSymlink, + 'junction' + ) +}