SASS stands for "Syntactically Awesome Stylesheets Sass". It is a CSS preprocessor and offers you stuff you can't do normally with CSS, e.g. mixins, loops, inheritence.
Create a new folder and "npm init"
"npm install node-sass"
Create a new folder "css" on the same level as "package.json"
Go to your package.json and write in the scripts key "start": "node-sass -o css scss"
Create a new folder "scss" and create a new file scss "main.scss" in it
In the main.scss file write:
.red { color: red; }
.red-dark { color: darken(red, 20%);}
7. Go to your terminal and write "npm start"
8. A new file "main.css" was created in the folder "css" for you.
After a long time of coding I think I'm ready to level up. I want to get a firm grasp of algorithm and datastructure. For that I want to dive into Mathematics for Computer Science, which basicailly is discrete maths. I intend to take the 6.042j course of MIT's OCW.
I'll intend to concentrate on that courses, listen to the lectures, read the course material, and solve the assignments and exams offered there. I will therefore not be that often here but at my new blog:
'use strict';
var Controllers = {};
Controllers.renderAdminPage = function (req, res, next) {
/*
Make sure the route matches your path to template exactly.
If your route was:
myforum.com/some/complex/route/
your template should be:
templates/some/complex/route.tpl
and you would render it like so:
res.render('some/complex/route');
*/
res.render('admin/plugins/thadTest', {});
};
module.exports = Controllers;
"use strict";
(function() {
/*
This file shows how client-side javascript can be included via a plugin.
If you check `plugin.json`, you'll see that this file is listed under "scripts".
That array tells NodeBB which files to bundle into the minified javascript
that is served to the end user.
Some events you can elect to listen for:
$(document).ready(); Fired when the DOM is ready
$(window).on('action:ajaxify.end', function(data) { ... }); "data" contains "url"
*/
console.log('nodebb-plugin-thad-test: Hello world');
// Note how this is shown in the console on the first load of every page
}());
thadTest.tpl
library.js
"use strict";
var controllers = require('./lib/controllers'),
plugin = {};
plugin.init = function(params, callback) {
var router = params.router,
hostMiddleware = params.middleware,
hostControllers = params.controllers;
// We create two routes for every view. One API call, and the actual route itself.
// Just add the buildHeader middleware to your route and NodeBB will take care of everything for you.
router.get('/admin/plugins/quickstart', hostMiddleware.admin.buildHeader, controllers.renderAdminPage);
router.get('/api/admin/plugins/thadTest', controllers.renderAdminPage);
callback();
};
plugin.addAdminNavigation = function(header, callback) {
header.plugins.push({
route: '/plugins/thadTest',
icon: 'fa-tint',
name: 'Quickstart'
});
callback(null, header);
};
module.exports = plugin;
# Quickstart Plugin for NodeBB
A starter kit for quickly creating NodeBB plugins. Comes with a pre-setup LESS file, server side JS script with an `action:app.load` hook, and a client-side script. Most plugins need at least one of the above, so this ought to save you some time. For a full list of hooks have a look at our [wiki page](https://github.com/NodeBB/NodeBB/wiki/Hooks), and for more information about creating plugins please visit our [documentation portal](https://docs.nodebb.org/).
Fork this or copy it, and using your favourite text editor find and replace all instances of `nodebb-plugin-quickstart` with `nodebb-plugin-your-plugins-name`. Change the author's name in the LICENSE and package.json files.
Once you're done don't forget to publish it on NPM, and make a thread about it [here](https://docs.nodebb.org/en/latest/plugins/hooks.html).
## Hello World
It will do some random stuff. As of time of writing, I don't even know myself what exactly. Really simple, just edit `static/lib/main.js` and paste in `console.log('hello world');`, and that's it!
## Installation
npm install nodebb-plugin-thad-test
## Screenshots
Don't forget to add screenshots!
Routing
In order to display your plugin correctly in the nodeBB admin page you have to set the route correctly:
in controller.js:
Controllers.renderAdminPage = function (req, res, next) {
res.render('admin/plugins/thadTest', {});
};
Once you are in redis you can type in either of those:
FLUSHDB - Removes data from your connection's CURRENT database.
FLUSHALL - Removes data from ALL databases.
To exit redis type in
exit
-------------------------
It's always good to stay up-to-date of your nodeBB. If you want to upgrade
1. Shut down your forum
$ cd /path/to/nodebb
$ ./nodebb stop
2. Back up your data
Redis
As with all upgrades, the first step is to back up your data! Nobody likes database corruption/misplacement.
All of the textual data stored in NodeBB is found in a .rdb file. On typical installs of Redis, the main database is found at /var/lib/redis/dump.rdb.
Avatars
Uploaded images (avatars) are stored in /public/uploads. Feel free to back up this folder too:
cd /path/to/nodebb/public
tar -czf ~/nodebb_assets.tar.gz ./uploads
3. Grab the latest and greatest code
$ git fetch # Grab the latest code from the NodeBB Repository
$ git checkout v0.4.x # Type this as-is! Not v0.4.2 or v0.4.3, but "v0.4.x"!
$ git merge origin/v0.4.x
If not upgrading between branches (e.g. v0.3.3 to v0.3.4, just run the following commands:
$ git fetch
$ git reset --hard origin/v0.3.x # Replace v0.3.x with the branch name!
Don’t know what branch you are on? Execute gitrev-parse--abbrev-refHEAD to find out.
4. Run the NodeBB upgrade script
This script will install any missing dependencies, upgrade any plugins or themes (if an upgrade is available), and migrate the database if necessary.
$ ./nodebb upgrade
Note: ./nodebbupgrade is only available after v0.3.0. If you are running an earlier version, run these instead: