Git Product home page Git Product logo

openbadges.org's Introduction

This is the content for the website at openbadges.toolness.org. It will eventually replace the content on openbadges.org.

Prerequisites

You need Python version 2.6 or higher. All other dependencies are self-contained within the project's code repository.

Setup

Just run this at the terminal prompt:

cd openbadges.org
python manage.py runserver

Then, point your browser to http://localhost:8000/.

Development

All static, unlocalized files are in the static directory, which are placed at the root of the web site. The templates directory contains localized Jinja2 templates that are located at /<locale>/ on the web site, where <locale> is the name of a locale like en-US. The single exception to this is the file templates/locale-redirector.html, which is used to redirect a non-localized pathname to a localized one (e.g., redirecting /goggles/ to /en-US/goggles).

Whenever you need to link to a localized template, you can do so either via a relative URL or an absolute one that begins with the template variable {{ LOCALE_ROOT }}.

Testing

When writing JavaScript code, please try to make it testable and add a unit test for it in the static/test directory. These QUnit tests can be run from the development server at localhost:8000/test.

Localization

The site uses GNU gettext for localization via Babel and Jinja2's i18n extension. Soon we'll get the site listed on localize.mozilla.org so that anyone can easily help localize the website.

Deployment

Run this at the terminal prompt:

python manage.py build

This will create a static version of the site, for all supported locales, in the dist directory. You can copy this directory to any web server that serves static files, such as Apache or Amazon S3.

Technical Design Philosophy

The Open Badges website is almost entirely static content, so we didn't see much of a need to use a massive server-side framework like Playdoh. Instead, we took an approach more akin to that of Jekyll, whereby a script can be run to generate a fully static site capable of being deployed to any static web server.

However, we pick from Playdoh's toolkit when we need to solve a problem, which results in a code repository that looks more familiar to Mozilla developers as the site's requirements become more complex.

openbadges.org's People

Contributors

cmcavoy avatar icaaq avatar stenington avatar threeqube avatar toolness avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.