1.0.0-7 • Published 4 years ago

theme-support-express v1.0.0-7

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Wordpress like themes

Maintenance PRs Welcome Current version

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

1.0.0-7

4 years ago

1.0.0-6

4 years ago

1.0.0-5

4 years ago

1.0.0-4

4 years ago

1.0.0-3

4 years ago

1.0.0-2

4 years ago

1.0.0-1

4 years ago

1.0.0

4 years ago