Rename all the markdown files
``` import fs from 'fs' import path from 'path' for (const file of traverse('content/articles')) { if (!file.endsWith('.md')) continue const dir = file.replace(/\.md$/, '') fs.mkdirSync(dir) fs.renameSync(file, path.join(dir, path.basename(file))) } function traverse(pathname) { const stat = fs.statSync(pathname) if (stat.isFile()) { return [pathname] } else if (stat.isDirectory()) { return fs .readdirSync(pathname) .map((v) => traverse(path.join(pathname, v))) .flat() } return [] } ```
Showing
- content/articles/2008/144-mhz-pa-s-2x-gi7b/144-mhz-pa-s-2x-gi7b.md 0 additions, 0 deletions...rticles/2008/144-mhz-pa-s-2x-gi7b/144-mhz-pa-s-2x-gi7b.md
- content/articles/2008/555-blikac-se-dvemi-led/555-blikac-se-dvemi-led.md 0 additions, 0 deletions...s/2008/555-blikac-se-dvemi-led/555-blikac-se-dvemi-led.md
- content/articles/2008/555-start-stop-s-casovym-zpozdenim-vypnuti/555-start-stop-s-casovym-zpozdenim-vypnuti.md 0 additions, 0 deletions...nim-vypnuti/555-start-stop-s-casovym-zpozdenim-vypnuti.md
- content/articles/2008/adrenalin-2008-zavody-na-horskych-kolech/adrenalin-2008-zavody-na-horskych-kolech.md 0 additions, 0 deletions...rskych-kolech/adrenalin-2008-zavody-na-horskych-kolech.md
- content/articles/2008/aktivity-breziny-2008/aktivity-breziny-2008.md 0 additions, 0 deletions...icles/2008/aktivity-breziny-2008/aktivity-breziny-2008.md
- content/articles/2008/antena-6el-28mhz-owar/antena-6el-28mhz-owar.md 0 additions, 0 deletions...icles/2008/antena-6el-28mhz-owar/antena-6el-28mhz-owar.md
- content/articles/2008/arrl-international-dx-contest-phone/arrl-international-dx-contest-phone.md 0 additions, 0 deletions...l-dx-contest-phone/arrl-international-dx-contest-phone.md
- content/articles/2008/chlazeni-elektronkovych-zesilovacu/chlazeni-elektronkovych-zesilovacu.md 0 additions, 0 deletions...onkovych-zesilovacu/chlazeni-elektronkovych-zesilovacu.md
- content/articles/2008/ci-v-interface-k-radiostanicim-icom/ci-v-interface-k-radiostanicim-icom.md 0 additions, 0 deletions...radiostanicim-icom/ci-v-interface-k-radiostanicim-icom.md
- content/articles/2008/cq-world-wide-dx-rtty-2008/cq-world-wide-dx-rtty-2008.md 0 additions, 0 deletions.../cq-world-wide-dx-rtty-2008/cq-world-wide-dx-rtty-2008.md
- content/articles/2008/cq-world-wide-dx-ssb-2008/cq-world-wide-dx-ssb-2008.md 0 additions, 0 deletions...08/cq-world-wide-dx-ssb-2008/cq-world-wide-dx-ssb-2008.md
- content/articles/2008/cq-world-wide-wpx-cw-2008/cq-world-wide-wpx-cw-2008.md 0 additions, 0 deletions...08/cq-world-wide-wpx-cw-2008/cq-world-wide-wpx-cw-2008.md
- content/articles/2008/den-deti-na-andelske-hore/den-deti-na-andelske-hore.md 0 additions, 0 deletions...08/den-deti-na-andelske-hore/den-deti-na-andelske-hore.md
- content/articles/2008/den-otevrenych-dveri-sps-ostrov/den-otevrenych-dveri-sps-ostrov.md 0 additions, 0 deletions...enych-dveri-sps-ostrov/den-otevrenych-dveri-sps-ostrov.md
- content/articles/2008/den-rekordu-vhf-2008/den-rekordu-vhf-2008.md 0 additions, 0 deletions...rticles/2008/den-rekordu-vhf-2008/den-rekordu-vhf-2008.md
- content/articles/2008/eagle-50/eagle-50.md 0 additions, 0 deletionscontent/articles/2008/eagle-50/eagle-50.md
- content/articles/2008/festival-na-snehu-klinovec-2008/festival-na-snehu-klinovec-2008.md 0 additions, 0 deletions...na-snehu-klinovec-2008/festival-na-snehu-klinovec-2008.md
- content/articles/2008/historie-radioklubu/historie-radioklubu.md 0 additions, 0 deletions.../articles/2008/historie-radioklubu/historie-radioklubu.md
- content/articles/2008/hon-na-lisku/hon-na-lisku.md 0 additions, 0 deletionscontent/articles/2008/hon-na-lisku/hon-na-lisku.md
- content/articles/2008/hybridni-delic-nebo-slucovac-vykonu-se-sesti-porty/hybridni-delic-nebo-slucovac-vykonu-se-sesti-porty.md 0 additions, 0 deletions...rty/hybridni-delic-nebo-slucovac-vykonu-se-sesti-porty.md
Loading
Please register or sign in to comment