0.0
No commit activity in last 3 years
No release in over 3 years
A Middleman extension to automatically generate VCards based on provided configurations. It also includes some useful Middleman helpers to work with the generated VCards. This is particularly useful in contacts pages to create a vcard button.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
>= 0

Runtime

 Project Readme

Middleman VCard

Gem Version Build Status Code Climate Test Coverage

Project informations

Description

A Middleman extension to generate VCards and useful helpers to work with.

Usage

Include the middleman-vcard gem in your Gemfile:

gem 'middleman-vcard'

Add the following code to your config.rb file:

require "middleman-vcard"
activate :vcard,
  name: data.site.vcard.name,
  emails: [{
    email:     data.site.vcard.email,
    preferred: true,
    location:  "work"
  }],
  phones: [{
    number:     data.site.vcard.phone,
    preferred:  true,
    location:   "work",
    capability: ["voice", "video", "msg"]
  }],
  addresses: [{
    preferred:  true,
    location:   "work",
    postalcode: data.site.vcard.postalcode.to_s,
    locality:   data.site.vcard.city,
    region:     data.site.vcard.province,
    country:    data.site.vcard.country
  }],
  photo: {
    path: File.join(root, config.source, config.images_dir, "logo-vcard.jpg"),
    type: "jpeg"
  }

Of course you can organize your data as you want and choose what to include in your data files or directly in your config file.

Also, you can pass multiple phones, addresses, emails.

Now the VCard file will be automatically generated :D

Helpers:

Usually you need to include your VCard in HTML, so there are some helpers already defined:

vcard_link

Generate a link tag that points to the VCard.

Details here.

vcard_path

Build the path that points to the VCard file.

Details here.

Contributors

Many thanks to Luca Molari (LMolr)!!

Install

$ gem install middleman-vcard

Copyright

Copyright (c) 2015 Alessandro Molari

See LICENSE for details.