Giter VIP home page Giter VIP logo

cloudpress's Introduction

Cloudpress

Who needs Wordpress when you can use CLOUDPRESS!

What?

Cloudpress is a blogging engine that publishes metadown files from Dropbox. It's designed as a fire and forget blogging solution, if you can write a metadown/markdown file then you can publish it without doing anything more than just placing it in a directory on Dropbox.

It's designed to be included within a Rails 3.1+ application, and provides a multitude of hooks for you to build your own templates around it.

Requirements

  • Rails 3.1+
  • PostgreSQL database
  • Dropbox Account

Installation

Add these lines to your application's Gemfile:

gem 'cloudpress'
gem 'metadown', github: 'steveklabnik/metadown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cloudpress

After that, you will want to copy the migrations into the application

$ rake cloudpress:install:migrations

And then run the initializer generator, which will ask you to fill in the application ID, log in to dropbox and authorize the application, and then enter the token you're provided with and then write them all in to config/initializers/cloudpress.rb you may want to replace them with ENV variables instead of hardcoding them.

$ rails g cloudpress:initializer

The application ID is 7i1ku4x291czftv which points to a dropbox application that I've made. If you'd like to create your own, just go ahead and replace that ID with your own applications.

After you've done that you can run your initial import.

$ rake cloudpress:update

Configuration

config.app_key         # The application ID, as explained above
config.app_secret      # The app secret, populated by the installer
config.app_token       # The token you pasted in from the installtion
config.base_path       # The path in your dropbox that's considered root
config.live_path       # Where your live files will live under the base_path
config.draft_path      # Draft file location, under the base_path
config.draft_user      # Username for draft HTTP auth, leave as nil for no auth
config.draft_password  # Password for draft HTTP auth, leave as nil for no auth

Usage

Cloudpress provides the majority of it's functionality through view helper renderers that you can move around and change to fit with your HTML structure.

You can see examples of these within the views/cloudpress/* folder, again all of these partial templates can be overriden within your application by adding a views/cloudpress/* directory.

Adding Posts

Cloudpress, by default will look in a cloudpress directory in the root of your Dropbox. Inside it will create two folders on the first update, live and draft folders. Cloudpress will search these directories recursivly, so you can use whatever organisational structure suits. I tend just to stick with years, since I don't write enough blog posts!

You then just create a metadown file with a md extension, that reads like this:

---
title: The Rails renderer pattern
publish_date: 24/04/2015 10:30AM
tags:
- Ruby
- Ruby on rails
- Renderers
- Views
---
## Development
So this is the content...

The first part of the file contains metadata about the post, the second the actual content, all markdown is supported, and uses pygments for code block highighting

Updating

I've got this deployed on Heroku, with a scheduled job to run every 10 mins using the provided rake task, or you can do it programatically by booting a console and typing Cloudpress.update!

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/cloudpress/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

cloudpress's People

Stargazers

 avatar Adam Carlile avatar

Watchers

Adam Carlile avatar James Cloos 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.