ipfs / ipfs/kubo

Gateway: dynamic image for social sharing

Open
#8,811 8 comments 1 reaction 0 assignees View on GitHub
dif/medium good first issue help wanted kind/enhancement need/community-input P2 topic/design-visual topic/gateway
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

We've added a basic social sharing markup in https://github.com/ipfs/dir-index-html/pull/36#issuecomment-647819924 :

> [![](https://user-images.githubusercontent.com/1507828/85344639-77c59200-b4ad-11ea-8945-e694c498ccaf.png)](https://github.com/ipfs/dir-index-html/pull/36#issuecomment-647819924)

@lanzafame pointed me at [this nice prior art from Github](https://github.blog/2021-06-22-framework-building-open-graph-images/) shows how UX can be improved by showing useful data via image:

> [![](https://github.blog/wp-content/uploads/2021/06/framework-open-graph-images_fig-1-GitHub-twitter-card.png?w=2048)](https://github.blog/2021-06-22-framework-building-open-graph-images)

In IPFS context, a cool improvement would be to provide image-per-CID with:
- QR code with shareable URL that could be scanned via phone
- prior art: share.ipfs.io has nice IPFS-branded QR codes (https://github.com/ipfs-shipyard/ipfs-share-files/pull/119), we could do something similar
- I like the idea of having a branded QR code, as it looks interesting even when not consumed.
> ![2021-06-23--21-47-07](https://user-images.githubusercontent.com/157609/123159192-024c2300-d46d-11eb-8be5-00897bf074dd.png)
> **QR code playground:** https://zpao.github.io/qrcode.react/
> URL of the icon: https://share.ipfs.io/favicon-32x32.png
- CID breakdown (codec, hash)
- dag-pb stats (total size, number of blocks)

Hot take:
- If we implement image generation as an alternative response format named `share-img` (as in, gateway response changing based on parameter `?format=json|cbor|car|block|share-img`) then we don't need to inline the data and don't need to deal with relative vs absolute vs cross-origin links (making this work on all gateway types without any additional configuration).

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Kubo's HTTP gateway response-format handling and the linked dir-index-html and ipfs-share prior art. The proposal describes a new share-img format containing a QR code, CID details, and dag-pb statistics, but names no files or tests. Done would require an agreed design and a working image response with coverage for its supported data.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.