theme-support-express
v1.0.0-7
Published
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-green.svg)](https://github.com/zunamidev/ThemeSupportExpres
Downloads
2
Readme
Wordpress like themes
Description
This is my first nodeJS project that I'm working on. It's to build up my skill. It will get some updates, which will change the coding style and methods. I appreciate your feedback.
How to use it?
Step 1
Add a new static direction in your ExpressJS app, which should look like this:
app.use(express.static(path.join(__dirname, 'themes')));
Step 2
Create the root folder for the themes in your root direction
├── app.js
├── bin
│ └── www
├── package-lock.json
├── package.json
├── public
│ ├── images
│ ├── javascripts
│ └── stylesheets
│ └── style.css
├── routes
│ ├── getThemeinformation.js
│ ├── index.js
│ └── users.js
├── themes <-- Here
└── views
├── error.ejs
└── index.ejs
Like this.
Step 3
routes/index.js
const appRoot = require('app-root-path');
const getThemeInformation = require('./lib/searchThemes');
getThemeInformation(appRoot, 'themes').then((r) => {
res.render('index', { style: r.main });
});
views/index.ejs
<link rel='stylesheet' href='<%= style %>' />
This will load the selected Theme.
What is planed?
- [ ] Global theme config
- [ ] Javascript loader
- [ ] Webpack support
- [ ] Minimizer
- [ ] SCSS to CSS
Dependencies used
Bugs
If you find bugs please open an issue or create a Pull request.
License
This project is licensed under the MIT License.
I hope you enjoy this project :)