Coder Social home page Coder Social logo

wit-cms-bootstrap's Introduction

wit-cms-bootstrap

wit-cms-bootstrap is an example blog built with Express and wit-cms. It is to be used a starting point when building a website with wit-cms.

Usage

Clone this repository and start the local webserver to become acquainted with wit-cms:

npm run start

The webserver will bind to port 3000 by default, and will be available at http://localhost:3000.

The example blog posts contain tips regarding using wit-cms. You may want to read them.

After you've become acqainted with this example website, you may freely modify it to suit your needs.

Layout

wit-cms-bootstrap contains the following files and directories:

File/Directory Purpose
app.js The Express application entry-point.
bin Contains executable scripts.
media Intended to serve static post/page content. (Not intended to serve "code", like stylesheets.)
pages Contains "page" content markdown files.
post Contains "post" content markdown files.
public Intended to serve static application assets, like stylesheets and JavaScript.
views Contains Express views.

Configuring

This repository will require minor configuration changes before production use.

app.js

A config object is defined in app.js. You'll likely want to update some of its values:

// wit configs
const config = {

  // website metadata, a la Wordpress
  params: {
    author  : 'John Doe',
    fqdn    : 'https://example.com',
    name    : 'example.com',
    tagLine : 'Built with wit-cms-bootstrap',
  },

};

You may likewise freely attach any additional values to config.params to make them available to the wit object.

bin/minify-css

bin/minify-css contains an array of stylesheets that are to be concatenated and minified:

// stylesheets to concatenate (ordered)
const files = [
  'normalize.css',
  'main.css',
  'desktop.css',
  'mobile.css',
  'solarized-dark.css', // highlighting styles for highlight.js
];

Modify those as necessary. Note that array order is important - stylesheets will be concatenated in the order in which they are specified. (See: Building)

bin/www

Change the logging application name in the following line of bin/www:

var debug = require('debug')('wit-cms-bootstrap:server');

Static File Serving

By default, the local webserver is configured only to serve static files in the development environment:

// only use the static-file middleware on the dev environment
if ('development' == app.get('env')) {
  app.use(express.static(path.join(__dirname, 'public')));
  app.use('/media', express.static('media'));
}

In production, it is recommended to use a webserver like Apache, Nginx, or Caddy for serving static files.

Building

By default, wit-cms-bootstrap defines a single build task, which concatenates and minifies all stylesheets specified in bin/minify-css:

npm run build

By default, the combined stylesheets will be saved to public/stylesheets/app.css.

Extending

wit-cms is for programmers, and wit-cms-bootstrap is ultimately just an Express application. You may freely modify it as you would any other application.

wit-cms-bootstrap's People

Contributors

chrisallenlane avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

n400 lqm231

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.