home blog tags about

Holiday Greetings

written by Robin Schubert on 2020-07-17 | Tags: miscellaneous, private

I'm on vacation at the North Sea with my family, and like exactly one year ago I was facing the problem of having too many postcards to write. Last year, I had written a small Python script that would take a yaml file and compile it to an HTML postcard.

The yaml describes all adjustable parts of the postcard, like the content and address, but also a title, stamp and front image. A jinja2 template, a bit of CSS and javascript create a flipable postcard that can be sent via email - which is very convenient if you, like me, are too lazy to buy postcards and stamps, and have more email addresses in your address book than physical addresses.

A postcard yaml could look like this (click the card to flip it around):

---

- name: Holiday Status 2020
  front_image: 'private_images/ninja.jpg'
  address: |
    Random Reader
    Schubisu's Blog
    World Wide Web
  title: I'm fine, thanks :)
  content: |
    Hey there!
    I'm currently on vacation and was stumbling over the same problem I had last year; writing greeting cards for friends and family. Luckily I've solved that issue last year, I simply had totally forgotten about it.
    This is an electronic postcard, made of HTML, CSS and a tiny bit of javascript, compiling my private photos and messages to a nice looking card.
    Feel free to fork, use and add whatever you like!
    Greets,
    Schubisu
  stamp: 'private_images/leuchtturm_2020.jpg'

and will be rendered by the script to this:

I was curious anyway, how this would be rendered on my blog. I've added a small adjustment to my CSS to scale the iframe tag by 0.75% and I'm okay with the result ;)

Write your own postcard or add some features! You can find the repository here: https://gitlab.com/schubisu/postcard.

Creative Commons License