Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

zunamidev/ThemeSupportExpress

Repository files navigation

Wordpress like themes

Maintenance PRs Welcome Current version

This is a old project I need to refactor it.

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 :)

Releases

No releases published

Packages

 
 
 

Contributors