Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/micheleriva/gauguin

๐ŸŽจ High performances Golang server for generating social share images dynamically (beta).
https://github.com/micheleriva/gauguin

chromedp gauguin go golang opengraph opengraph-data opengraph-images opengraph-tags

Last synced: about 1 month ago
JSON representation

๐ŸŽจ High performances Golang server for generating social share images dynamically (beta).

Awesome Lists containing this project

README

        

Gauguin - Generate opengraph images at runtime

Gauguin - Generate dynamic OpenGraph or social images in real-time | Product Hunt

**Gauguin** (pronounced `/หˆษกoสŠษกรฆฬƒ/`) is an high performances Golang server that generates dynamic **opengraph** images at runtime.

๐ŸŽ‰ Read the quickstart post [here](https://levelup.gitconnected.com/generate-dynamic-opengraph-images-using-gauguin-b53c5dc8ec2f)!

# Sponsors



GraphCMS




Become a sponsor

# Gauguin in 6 easy steps

1) Create a configuration file called `gauguin.yaml`

```yml
version: 0.0.1
routes:
- path: /articles/opengraph
params:
- title
- author
- imgUrl
size: 1200x630
template: ./templates/article.tmpl
- path: /author/opengraph
params:
- username
- imgUrl
size: 1200x630
template: ./templates/user.tmpl
```

2) For each route, create a Golang `tmpl` file (named the same way you named it inside the configuration file):

```html



body {
margin: 0;
font-family: Arial;
color: #fff;
}
.article-template {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 1200px;
height: 630px;
background: #001f1c;
}
h1 {
margin: 0;
font-size: 32px;
}
img {
width: 200px;
height: 200px;
object-fit: cover;
border-radius: 15px;
margin-bottom: 25px;
}





{{.title}}


Written by {{.author}}



```

3) Copy [this](/docker-compose.yaml) docker-compose file locally and run `docker-compose up -d`
4) Choose a title, an author and an image for your article opengraph image. Pass them via querystrng to the route you defined in your configuration file.
5) Go to `http://localhost:5491/articles/opengraph?author=Bojack%20Horseman&title=A%20Post%20About%20my%20Garden&imgUrl=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1525498128493-380d1990a112%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D300%26q%3D80`
6) Admire the following image:

Gauguin opengraph image example

# Documentation

I'm currently writing more documentation, it will be available on **Gitbook**: [http://micheleriva.gitbook.io/gauguin](http://micheleriva.gitbook.io/gauguin)

# Env Variables
```env
PORT= # HTTPS Port
DOCKERIZED= # Set to true if running Gauguin in Docker
CHROME_URL= # Optional, the URL of the Chrome REST Debugging APIs
```

# License
**Gauguin** is distributed under the [GPLv3 open source license](/LICENSE.md).