I’m running Gitea to host my git repos. Many thanks for that, OSS community!
On my blog, I’d like to discuss some code that is stored (publicly) on Gitea. Can anybody think of a way to embed that file directly from git onto my webpage? Like, adding some JS to my page, which would in turn grab that piece of code and render it just like the Gitea page itself? Like, gists?
Thx. That’d not give me the nice visual representation of the code editor embedded in Gitea. Eg no line numbers, syntax coloring or else. I see Gitea itself is using the Monaco editor library, probably I’ll build something around that, that’ll pull source from Gitea using the raw URL that you’ve mentioned.
Yeah. It’s better for Gitea to have that feature but unfortunately there is not. But I think it’s not difficult for you to find a javascript code highlight plugin to do that.
I needed to get CORS header along with my Gitea response and had no luck doing so using the Gitea configuration. But I could add those headers using Traefik.