From dfed1df8b60072dc353b95ba2996411f9d4c2001 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 30 Mar 2014 15:47:28 -0400 Subject: [PATCH] init --- README.md | 37 +++++++++++++++++++++++++++++++++++++ lib/client.js | 17 +++++++++++++++++ lib/theme.js | 35 +++++++++++++++++++++++++++++++++++ package.json | 10 ++++++++++ plugin.json | 12 ++++++++++++ theme.json | 6 ++++++ theme.less | 1 + 7 files changed, 118 insertions(+) create mode 100644 README.md create mode 100644 lib/client.js create mode 100644 lib/theme.js create mode 100644 package.json create mode 100644 plugin.json create mode 100644 theme.json create mode 100644 theme.less diff --git a/README.md b/README.md new file mode 100644 index 0000000..6db12f3 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Quickstart Theme for NodeBB + +This repository contains all of the preparatory work for a theme based off of the vanilla base theme. + +Fork it to create your own theme based off of it! + +### Some things to change + +* You should rename this theme from `quickstart` to something else. Change all instances of that word in the following files: + * `package.json` + * `plugin.json` + * `theme.json` + +### When you're done... + +Be sure to add some other metadata to the `package.json`, like this: + +``` json +"author": { + "name": "Your Name", + "email": "Your Email", + "url": "Your website" +}, +"repository": { + "type": "git", + "url": "https://github.com/{your-username}/{your-repository}" +}, +"bugs": { + "url": "https://github.com/{your-username}/{your-repository}/issues" +} +``` + +Also, add a screenshot! Take a picture of your theme, and save it as "screenshot.png" in the root of your theme folder, then add this to `theme.json`: + +``` json +"screenshot": "screenshot.png" +``` \ No newline at end of file diff --git a/lib/client.js b/lib/client.js new file mode 100644 index 0000000..9d90ccd --- /dev/null +++ b/lib/client.js @@ -0,0 +1,17 @@ +/* + Hey there! + + This is the client file for your theme. If you need to do any client-side work in javascript, + this is where it needs to go. + + You can listen for page changes by writing something like this: + + $(window).on('action:ajaxify.end', function(data) { + var url = data.url; + console.log('I am now at: ' + url); + }); +*/ + +$(document).ready(function() { + // Your code goes here +}); \ No newline at end of file diff --git a/lib/theme.js b/lib/theme.js new file mode 100644 index 0000000..c2940f8 --- /dev/null +++ b/lib/theme.js @@ -0,0 +1,35 @@ +(function(module) { + "use strict"; + + var Theme = {}; + + Theme.defineWidgetAreas = function(areas, callback) { + areas = areas.concat([ + { + 'name': 'MOTD', + 'template': 'home.tpl', + 'location': 'motd' + }, + { + 'name': 'Homepage Footer', + 'template': 'home.tpl', + 'location': 'footer' + }, + { + 'name': 'Category Sidebar', + 'template': 'category.tpl', + 'location': 'sidebar' + }, + { + 'name': 'Topic Footer', + 'template': 'topic.tpl', + 'location': 'footer' + } + ]); + + callback(null, areas); + }; + + module.exports = Theme; + +}(module)); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9876cd5 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "nodebb-theme-quickstart", + "version": "0.0.0", + "description": "Enter a description here", + "main": "theme.less", + "keywords": [ + + ], + "license": "MIT" +} diff --git a/plugin.json b/plugin.json new file mode 100644 index 0000000..33a51d4 --- /dev/null +++ b/plugin.json @@ -0,0 +1,12 @@ +{ + "id": "nodebb-theme-quickstart", + "library": "./lib/theme.js", + "hooks": [ + { + "hook": "filter:widgets.getAreas", "method": "defineWidgetAreas", "callbacked": true + } + ], + "scripts": [ + "lib/client.js" + ] +} \ No newline at end of file diff --git a/theme.json b/theme.json new file mode 100644 index 0000000..a207eb1 --- /dev/null +++ b/theme.json @@ -0,0 +1,6 @@ +{ + "id": "nodebb-theme-quickstart", + "name": "My Theme Name", + "description": "Enter a description here", + "url": "https://github.com/designcreateplay/nodebb-theme-quickstart" +} diff --git a/theme.less b/theme.less new file mode 100644 index 0000000..bbc5dbc --- /dev/null +++ b/theme.less @@ -0,0 +1 @@ +@import "../nodebb-theme-vanilla/theme"; \ No newline at end of file