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: 17 days ago
JSON representation
🎨 High performances Golang server for generating social share images dynamically (beta).
- Host: GitHub
- URL: https://github.com/micheleriva/gauguin
- Owner: micheleriva
- License: gpl-3.0
- Created: 2020-10-12T13:17:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-29T19:38:59.000Z (over 2 years ago)
- Last Synced: 2025-03-30T22:22:05.342Z (about 2 months ago)
- Topics: chromedp, gauguin, go, golang, opengraph, opengraph-data, opengraph-images, opengraph-tags
- Language: Go
- Homepage: https://micheleriva.gitbook.io/gauguin
- Size: 1.2 MB
- Stars: 115
- Watchers: 5
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
**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
# 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:
# 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).