ladicle / tcardgen Goto Github PK
View Code? Open in Web Editor NEWGenerate a TwitterCard(OGP) image for your Hugo posts.
License: MIT License
Generate a TwitterCard(OGP) image for your Hugo posts.
License: MIT License
Hi, thanks for this project.
To suit my needs, I forked it to be able to deactivate certain fields. I believe other people would be happy to benefit from this. I'm not familiar with Go, so here's my commit if you'd like to cherry-pick it or if I should create a pull request in that direction, feel free to let me know !
It is a great tool for me. I created a single twitter card by specifying the MD file name specifically. And my command was like this.
tcardgen -f next.medigy.com/static/font/ \ -o news-content/ \ -t tcardgen/example/template.png \ news-content/healthtechmagazine-why-telehealth-solutions-are-vital-in-a-disaster.md
But I tried the same for multiple images creation which I have a lot of MD files in my content folder. And my command was like this.
tcardgen -f next.medigy.com/static/font/ \ -o news-content/ \ -t tcardgen/example/template.png \ news-content/*.md
And I got the following error message.
Load fonts from "next.medigy.com/static/font/"
Load template from "tcardgen/example/template.png" directory
Failed to generate twitter card for news-content.png: failed to read page content: read : The handle is invalid.
Failed to generate twitter card for news-content.png: failed to read page content: read : The handle is invalid.
Failed to generate twitter card for news-content.png: failed to read page content: read : The handle is invalid.
Failed to generate twitter card for news-content*.png: open news-content/*.md: The filename, directory name, or volume label syntax is incorrect.
2020/06/30 19:25:27 failed to generate 4 twitter cards
Could you please help me to resolve this issue? Please check the screenshot of the same.
Hi @Ladicle,
thanks for your work of developing this tool.
Today, I have a proposal.
I want a feature of specifying the output file name.
So, if you set "directory" (ex. ./path/to/directory
) as the value of -f
option, then output image file name is default one.
On the other hand, if you set "file name" (ex. ./path/to/directory/ogp.png
) as the value of -f
option, then output image file name is "ogp.png".
This way is compatible.
And, of course, I accept other way.
I hope you will consider it.
Is it possible to give the template name with a .jpeg extension or is it possible to generate the output as .jpeg?
When I tried with the .png extension, the output folder size became too large. So I want to reduce the output folder size when I'm dealing with a large number of MD files.
I have installed go using brew install go
and then ran go install github.com/Ladicle/tcardgen@latest
. But that does not seem to make tcardgen
work. I get:
> tcardgen
zsh: command not found: tcardgen
The version of go:
> go version
go version go1.19.2 darwin/amd64
What should I do to get this working on macOS?
Hi Ladicle, thanks for this amazing library!
I'm having a problem when I hit the generate command, it says "author" type of string can not convert to []interface{}
I'm putting regular string into my markdown frontmatter like this:
author: nsebhastian
Could you help me figure out what went wrong here? Thanks again!
Hi @Ladicle , Its a great tool and worked well for English content. I am having Arabic text too as description in my MD file and the image generated is having boxes in place of Arabic text. I tried by using Arabic font "Traditional Arabic" in front directory then it throws an error "Failed to load Traditional Arabic". Please help..
Hi @Ladicle,
I'm bringing the proposal again.
I want to accept both single author and multiple one.
author = ["yyh-gl"]
โ
author = "yyh-gl"
On some hoge themes, the UIs change whether it is an array or not.
So, I have to identify A or B.
Is there any way to capture custom front-matter and display it into the template with out touching the core code? If so , How can I do that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.