jasonknebel / sinatra-blog Goto Github PK
View Code? Open in Web Editor NEWLight weight blog using Sinatra
Home Page: http://jak-blog.herokuapp.com/
Light weight blog using Sinatra
Home Page: http://jak-blog.herokuapp.com/
Where a post is truncated, add a link to view the entire post in it's own page.
There is no rake db:create
in Sinatra.
It looks like the main app file pretty much houses all the functionality (router, database config, etc.) - perhaps it would be cleaner to separate out these components and require them in
Eek! You might want to get rid of these things, asap. You can use a gitignored config file to set these (make sure to leave an example config in the project) or use environment variables -- these are the more standard practices.
It might be easier just to see a small snippet of the text rather than the entire post in the admin index view. Rails' truncate method is a good way to deal with this, although you might have to port it in to sinatra in order to get it working : )
On Heroku, the time displayed is not for the user's timezone.
If there are two posts with the same :url
, the system will just return back the first one it finds.
Get URI to parse the database_url that can be seen with heroku config
. Otherwise, the information has to be manually entered for each different application.
require 'active_record'
require 'uri'
db = URI.parse(ENV['DATABASE_URL'] || 'postgres://localhost/mydb')
ActiveRecord::Base.establish_connection(
:adapter => db.scheme == 'postgres' ? 'postgresql' : db.scheme,
:host => db.host,
:port => db.port,
:username => db.user,
:password => db.password,
:database => db.path[1..-1],
:encoding => 'utf8'
)
Should the admin be able to edit published posts?
Currently, the admin is not able to.
Add a back button that remembers if you came from the index or admin (and what page).
Pagination on both the index and admin pages.
So it's not in an open repo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.