Skip to content

Instantly share code, notes, and snippets.

View joemoraca's full-sized avatar

Joe Moraca joemoraca

  • Digital Nomad
View GitHub Profile
@damien1
damien1 / typography.html
Last active January 24, 2024 22:01
Hugo Shortcode add Google Fonts and style to selected text. Visit my site for details https://bit.ly/31PSv6d example: {{< typography font="monoton" size="100px" style="italic" >}}You are awesome. You're even better! {{< /typography >}}
<!-- for usage details visit https://bit.ly/31PSv6d -->
{{ $font := .Get "font" }}
{{ $size := .Get "size" }}
{{ $style := .Get "style" | default "normal" }}
{{ $weight := .Get "weight" | default "normal" }}
<link href="https://fonts.googleapis.com/css?family={{ $font }}" rel="stylesheet" type="text/css">
<div style="font-family:'{{ $font }}'; font-size:{{ $size }}; font-style:{{ $style}}; font-weight:{{ $weight }}">
{{- .Inner -}}
</div>
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version