Git Product home page Git Product logo

rack-blogengine's Introduction

Rack::Blogengine

Rack Application to serve a simple blog

NOTE

This is just a project for learning purpose, but if you want to use it read further. Code should be considered bad (1st ruby project). Also its not actively maintained.

Build status

Gem Version Build Status Code Climate Test Coverage Inline docs Dependency Status

Supported Ruby Versions & Platforms

  • rbx > 3.14
  • ruby > 2.2

Installation

$ gem install rack-blogengine

Usage

rack-blogengine generate <folder> will create your Folder skeleton

Structure

These folders and files will be created for you

Folders

targetfolder/assets

targetfolder/assets/style

targetfolder/assets/js

targetfolder/assets/layout

targetfolder/assets/images

targetfolder/operator

Files

targetfolder/assets/style/style.css

targetfolder/assets/js/script.js

targetfolder/assets/layout/layout.html (filled with basic structure)

targetfolder/index.content (filled with dummy content)

targetfolder/config.yml (basic config setup - server: webrick, port: 3000)

targetfolder/operator/operator.rb (define your operator methods in module UserOperator)

Layout

In the layout.html you use {title}, {content} and {date} which will then be populated with the values from each .content file Example:

<!DOCTYPE html>
<html>
	<head>
		<title>{title}</title>
	</head>
	<body>
		<h1>{title}</h1>
		<div>
			{date}
			{content}
		</div>
	</body>
</html>

Content

The Content files (.content) includes your content

[path][/path] - this will be your access path to your blog entry

[title][/title] - the title for your article

[date][/date] - publishing date of your article

[content][/content] - your content

Hint

For a root document (http://pathtoapp.tld/) path should be empty ([path]:[/path])

Operators

In version 0.1.2 operator handling is included. To use this new feature you have to create a operator directory in your rackblog folder. In this directory create your operators (.rb files) with following skeleton

module UserOperator
end

Your operators are normal ruby methods defined in this module. Available params are documents & html

Param documents: An Array with document objects. This Document objects has following attributes: path, title, html

Param html: The content of the file where the operator was included

Example

module UserOperator
  def show_nav
  end
end

In your layout.html then

<div class="nav">
	{% show_nav %}
</div>

TODO

Implement pygments without nokogiri html parser (maybe use oga as alternative - https://github.com/YorickPeterse/oga)

Contributing

  1. Fork it
  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 new Pull Request

rack-blogengine's People

Contributors

tak1n avatar

Stargazers

 avatar

Watchers

 avatar  avatar

rack-blogengine's Issues

" rack-blogengine run ." encounter error,how to fix it?

hi.
i ran:
gem install rack-blogengine

then ran:
cd /usr/local/
rack-blogengine generate rack-blogengine-site
cd rack-blogengine-site

root@AR:/usr/local/rack-blogengine-site# rack-blogengine run .
Set up ./assets/style/highlight.css
/usr/local/rvm/gems/ruby-2.3.0/gems/rack-blogengine-1.0.9/lib/rack/blogengine/command_line_interface.rb:87:in generate_highlight_css': private method open' called for Rack::File:Class (NoMethodError)
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-blogengine-1.0.9/lib/rack/blogengine/command_line_interface.rb:32:in run' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-blogengine-1.0.9/bin/rack-blogengine:16:in public_send'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-blogengine-1.0.9/bin/rack-blogengine:16:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/bin/rack-blogengine:23:in load'
from /usr/local/rvm/gems/ruby-2.3.0/bin/rack-blogengine:23:in <main>' from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval'
from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `

'

root@AR:/usr/local/rack-blogengine-site#

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.