GithubHelp home page GithubHelp logo

mbrukman / crate-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crate/crate-web

0.0 1.0 0.0 11.38 MB

Crate.IO Website

License: Apache License 2.0

Python 3.98% HTML 70.61% CSS 22.32% JavaScript 3.09%

crate-web's Introduction

crate-web

Crate.IO Website

https://crate.io

This is the developement setup for the crate.io website. It uses the static website generator tool Cactus to generate HTML pages.

Development Setup

$ git clone -b setup [email protected]:crate/crate-web.git
$ cd crate-web
$ git submodule init
$ git submodule update

The dev environment requires Python 2.7 to be installed.

$ python2.7 bootstrap.py
$ bin/buildout -N

Select an environment:

$ bin/py src/web/env.py local > crate/config.json

or simpler:

$ bin/env local

To start the development server:

$ bin/serve

By default Cactus serves the site on port 8000. You can specify a specific port with the --port argument:

$ bin/serve --port 8888

Convert Wordpress content to Markdown

To convert the WP dump (.xml) to Markdown files we use wp2md.

First, export WordPress data to XML file (Tools -> Export -> All content), then run:

$ bin/wp2md -d out data/crate.wordpress.yyyy-mm-dd.xml

Move the posts into the blog folder and rename from .md to .html

$ mv out/posts/* crate/pages/blog/
$ cd crate/pages/blog/
$ for fn in *.md; do mv $fn ${fn//.md/.html}; done
$ for fn in *.html; do mv $fn "${fn//#[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-/}"; done

Manage

All pages are located in ./crate/pages and respective subfolders.

Blog posts are located in ./crate/pages/blog.

Deployment

Deploy Staging

Simply run the deploy_web-staging job on Jenkins.

Site will be served without caching on https://staging.crate.io.

Deploying to Amazon

To deploy to S3 run

$ cd crate-web/crate
$ ../bin/cactus deploy

The first time you run this command it will ask for

Deploying to Google Cloud Storage

requirments

  • Install google-api-python-client
  • Install httplib2
  • Modify upstream/cactus/deployment/gcs/engine:41
    • Old: "service = apiclient.discovery.build('storage', 'v1beta2', http=http_client)"
    • New: "service = apiclient.discovery.build('storage', 'v1', http=http_client)"

Modify the config.json to include:

$ "gcs-bucket-name": "crateweb",
$ "gcs-bucket-website": "Unavailable for GCS",
$ "provider": "google"

Now you can deploy with:

$ cd crate-web/crate
$ ../bin/cactus deploy

The first time you run this command Google will verify the account and you have to copy and paste a code from your browser into your terminal

crate-web's People

Contributors

chaudum avatar jodok avatar spanktar avatar tbrandles avatar xsolid 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.