templates directory per project
- Lingua principale
- JavaScript
- Stelle
- 4
- Fork
- 5
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
A quick, and beautifull enhancement (;P) of a way that scaffold templates are generated. If 'YOUR_PROJECT/.templates' directory exists and template file exists inside, it will be used by scaffold generator instead of that default one from 'ejs-ext' templates directory.
``` javascript
exports.template = function (name) {
try {
stats = fs.lstatSync(process.cwd() + '/.templates/' + name + '.ejs');
if (stats.isFile()) {
return process.cwd() + '/.templates/' + name + '.ejs';
}
}
catch (e) {}
return __dirname + '/templates/' + name + '.ejs';
};
```
Sorry that it is not a pull request, but i was enlightened in some place, where i'm unabe to do that ;-)
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Look at the scaffold generator code in the ejs-ext project to find where templates are currently loaded. The issue provides a sample function; implement it to check for a .templates directory in the project root and fall back to the default. Test by creating a custom template in .templates and running a scaffold command to verify it's used.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 70/100