open graph real easy
0

Configure Feed

Select the types of activity you want to include in your feed.

Go 100.0%
4 1 0

Clone this repository

https://git.vm.fail/jakelazaroff.com/ogre https://git.vm.fail/did:plc:qmc6q2bunodbh5kd7fopu4ej
ssh://git@knot1.tangled.sh:2222/jakelazaroff.com/ogre ssh://git@knot1.tangled.sh:2222/did:plc:qmc6q2bunodbh5kd7fopu4ej

For self-hosted knots, clone URLs may differ based on your setup.


README.md

ogre#

open graph real easy: a simple CLI tool for generating open graph images.

installation#

go install tangled.org/jakelazaroff.com/ogre/cmd/ogre@latest

usage#

ogre [-o output.png] <config.toml> [Key=Value ...]

key=value pairs are substituted into the config as go template variables.

ogre -o og.png template.toml Title="An Interactive Intro to CRDTs" Date="october 3, 2023"

config#

configure ogre via a TOML template:

layers are drawn in order — later layers appear on top.

width = 1200      # default: 1200
height = 630      # default: 630
background = "#6B5BFF"

[[layers]]
type = "text"
position = "bottom-left"
font = "./LeagueGothic-Regular.ttf"
size = 78
color = "#ffffff"
padding = 40
text = "{{.Title}}"
anchor = "baseline"   # "baseline" measures padding from the baseline rather than
                      # the font's bounding box — useful when text has no descenders
spacing = -2          # letter-spacing in pixels (negative = tighter)
wrap = 800            # max width in pixels before text wraps

[[layers]]
type = "image"
src = "./photo.jpg"
position = "bottom-right"   # omit to fill the canvas
padding = 40
width = 200                 # omit to use native size
height = 200
opacity = 0.5               # 0.0–1.0, default 1.0

positions#

top-left      top-center      top-right
middle-left   center          middle-right
bottom-left   bottom-center   bottom-right

multiline text#

use \n in the text field to insert line breaks.

development#

run tests:

cd internal/render && go test

update snapshots after intentional rendering changes:

cd internal/render && go test -update