Cùran's life
A Debian Developer's observations

2nd March 2011 16:20 (GMT)
Embedding license information in a XHTML-valid way

When you want to offer creative work, or at least your blog posts, under a license which gives the receivers a lot of freedoms, you'll sooner or later come across the Creative Commons licenses. And after you've selected a license of your liking, you'll be presented with a little XHTML snippet. Nice. What's not so nice is, that you'll break the validity of your website as soon as you put that snippet somewhere on your homepage. What to do?

Easy. Ask the W3C for help (ok, don't call them, just use a search engine). Since Tim Berners-Lee is promoting the semantic web for some time now, there must be some conformant way to add the information, which hopefully is also supported by standard-compliant browsers. The answer is a W3C recommendation. The recommendation talks only about XHTML 1.1, but there's also a XHTML 1.0 DOCTYPE (If you don't care about IE, you can use the XHTML 1.1 variant, at least the last time I checked, IE failed miserable with XHTML 1.1. Admittedly, it has been a while since I looked this up.). Just put:



at the top of your document. Depending on what RDF namespaces you want to use (and how often), you can add more namespaces than the default one to your html tag. So a template for a "XHTML 1.0 + RDFa" document might look like:




  
    An XHTML 1.0 + RDFa standard template
    
  

  
     

Your HTML content here

[Website Title] by [Author's Name] is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License unless noted otherwise.

When you're finished, you can start adding licensing information (and other relations) to your website as this little blog is doing.

Permalink | creativecommons, licensing, meta, xhtml.
11th May 2011 11:29 (GMT)
Flattr "released" donation button

Some might remember, that I have been asked in the past to add Flattr to the available support models. And after considering this a little more, I wanted to add support options to my blog too. So I looked into the different options already available and found, that while Flattr offered a donation option, they had no graphic available like the PayPal donation button. Thus I contacted the Flattr guys and they responded almost immediately by sending me a tarball with two images and an example HTML file. You can see that in action below (this is the ECMAScript version, the CSS version can be seen on the right side of this website):

Flattr donation button

If you want to use it on your own homepage here is, what you need to do:

  1. Download the images (normal, hover) to your server/webspace.
  2. Add the following to the page(s) where you want to see the Flattr donation button:
    Flattr donation button
    

    You need to replace [USERID] with your registered user name.
  3. You're done!

You can, of course, also just download the first image and skipt the whole hover effect stuff. And, of course again, you can also use CSS to implement the hover effect, as I do it on this site. In that case just remove the img tag from the code snippet above, add a unique id (let us assume it is flattrDonate) to the a tag and add the following to your style sheet:

#flattrDonate {
        display:        block;
        background-image: url('/imgs/flattr_donate_normal.png');
        width:          56px;
        height:         21px;
}

#flattrDonate:hover {
        background-image: url('/imgs/flattr_donate_hover.png');
}

Obviously you need to change the URL to point to your copies of the two images.

Permalink | flattr, meta, xhtml.
28th October 2011 19:16 (GMT)
Google recommends using OpenStreetMaps/OpenLayers

Maybe you've already heard, that Google is starting to charge a fee for using the Maps API (Google may decide you're an non-profit organization and waive the fees). That is, in my opinion, Google telling you to look for better alternatives. And thanks to the awesome effort of the OpenStreetMaps community, there is such an alternative.

Thus today's addition to the mini-tips series will tell you, how you get an OpenStreetMaps-powered map on your website.

  1. First you need to determine the coordinates, where you want to center, the map. You can do this with OpenRouteService.org. Just search for the address, right-click on the marker highlighting the result, and set it as e.g. your start point, that'll give you the coordinates in the start field on the left. Alternatively you can just move your pointer over a place on the map and have a look at the lower right corner, where the current coordinates for the pointer position are displayed.
  2. Then you need to add a few things to the website, where the card is to be shown:
    • Include the OpenLayers script in the <head> of your webpage: