Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jnicklas-lilliput

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jnicklas-lilliput

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Lilliput

Lilliput is a blogging engine so minimalistic, it doesn't even include a webframework.

You can use Lilliput with Sinatra like this:

require 'rubygems'
require 'sinatra'
require 'lilliput'

Lilliput.folder = File.join(File.dirname(__FILE__), 'posts')

get '/' do
  @posts = Lilliput.all
  erb :index
end

get '/:slug' do
  @post = Lilliput.find(params[:slug])
  erb :show
end

This will serve markdown files from the ./posts folder. The name of the markdown file must contain a date, an may contain a slug, where the post is accessible

2009-02-14.md
2009-02-14-my-first-lilliput-post.md

The first line of the post is used as title. If there is no slug in the filename, the title is parameterized and used. The markdown file can contain an optional author annotation like this:

/ Jonas Nicklas <jonas.nicklas@gmail.com

It must be the last line of the file.

In your view, you can do something like this:

<% @posts.each do |post| %>
  <h1><%= post.title %><

  <p class="date"><%= post.published_at %></p>
  
  <%= @post.html %>
<% end %>

There's also

Lilliput.published

which will find only those posts with a date that is in the past.

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc