Code Monkey home page Code Monkey logo

portfolio-powered-by-behance's Introduction

Portfolio Powered by Behance

Personal portfolio using data from your Behance profile cached to redis db to offer faster response and do not reach behance api limit 150 requests per day.

Written for sinatra, but can be used with anything ruby based.

Dependencies

  • rest-client
  • redis
  • slim

Advice

When using data from behance, you should always show 'powered by Behance' image somewhere on page. Can be found at Behance branding guidlines. Of course, you should read this entire document.

Example of use with sinatra

# config/behance.yml

client_id: 'y0ur-cl13nt-1d'
user: 'username-or-user-id'

redis: # optional
  db: 1

rendering: # optional
  css_prefix: '.project'
# app.rb

require 'sinatra/base'
require 'slim'
require 'portfolio-powered-by-behance'

before do
  @portfolio = PortfolioPoweredByBehance::Portfolio.new
end

get '/' do
  @projects = @portfolio.projects
  slim :index
end

get '/projects/:id' do
  @project = @portfolio.project_details params[:id]
  @behance_stylesheet = @project.stylesheet # your behance project stylesheet
  slim :project
end
# views/layout.slim

doctype html
html
  head
    - if @behance_stylesheet
      style type='text/css' rel='stylesheet' = @behance_stylesheet
  body == yield
# views/index.slim

ul
  - @project.each do |p|
    li
      a href="/projects/#{p['id']}"
        img src=p['covers']['404'] alt=p['name']
        .info
          h3 = p['name']
# views/project.slim

.project
  h1 = @project.name
  p.description = @project.description
  ul.fields
    - @project.fields.each do |f|
      li = f

  .body
    == project.markup # your behance project markup

  a href[email protected] show on behance

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.