PAD Showcase
All tags/Gravatar

No request to a third party

fallback= draws the picture on the server instead - the initials of the name, or the identicon of the address - so no visitor is sent to Gravatar.

1 The data gravatar/private.php php
<?php

  $comments = [
    [ 'name' => 'Herbert Jebbink', 'email' => 'herbert@example.com', 'text' => 'The page cache halves the time of the home page.' ],
    [ 'name' => 'Ada Lovelace',    'email' => 'ada@example.org',     'text' => 'Could the sequence tags take a step of their own?' ],
    [ 'name' => 'Grace Hopper',    'email' => 'grace@example.net',   'text' => 'A bug report with a template line number - lovely.' ] ];

?>
2 The template gravatar/private.pad pad
<div style="display:grid; gap:16px">
  {comments}
  <div style="display:flex; gap:12px; align-items:flex-start">
    {gravatar $email, size=40, fallback='avatar', alt=$name}
    {gravatar $email, size=40, fallback='identicon', alt=$name}
    <div><strong>{$name}</strong><br>{$text}</div>
  </div>
  {/comments}
</div>
3 The result rendered on the server
Herbert Jebbink HJ Herbert Jebbink
Herbert Jebbink
The page cache halves the time of the home page.
Ada Lovelace AL Ada Lovelace
Ada Lovelace
Could the sequence tags take a step of their own?
Grace Hopper GH Grace Hopper
Grace Hopper
A bug report with a template line number - lovely.