Image in Markdown using Gitlab URL

Hello!

We’re using Gitlab as part of our document storage and requirements management process.

I have a markdown document that has images (flow diagrams etc.) in it that’s been committed to Gitlab. In this document, these images are stored in a local ./images folder. I’d like for this document to be a central diagram repository that captures all features and implementations for all projects (we’re reusing things across projects and customers).

I have a second markdown document(s) that’s designed to be the reference point for a specific project(s). To avoid duplication of diagrams (and if a diagram changes, I’d like it to carry through all documents and projects), I was hoping to use the permalink for an image (committed in the first markdown document) in Gitlab in the second document. When viewing the document in Gitlab, this works fine and I see the image rendered correctly. However when editing in Typora I get image errors, which carry through to exported documents.

I think this may be because images are only accessible via URL if you’ve got a Gitlab account (and we’ve also got 2 factor set up on the project) - does anyone know of any workaround? Are there other editors from Typora that could do something similar? Currently the best we’ve got is to link each image as a URL rather than embedding it and if we need to generate a document to go externally, manually copy the images in…

Don’t think this is a duplicate, haven’t found any other topics that are simila!

Really appreciate the help!

1 Like

Can’t you create an access token and include that in the link? You might want to make sure that it’s just a read-only token, but it might work.

Thanks for the reply!

I’m going to confess not being entirely familiar with access tokens etc. - I included the access token generated through Settings>Access Tokens in the image URL as so:

As far as I can tell that’s how to include it in the link? Most people seem to advise against doing it this way (for obvious reasons) but the links shouldn’t be accessible to anyone outside myself (I’ll be exporting the documents, and sensitive images will be deleted from e.g. word exports) so hopefully that’s not an issue…

EDIT: should’ve said, the above format isn’t working!

@bsbs Any updates or workaround for this usecase?

Hey :slight_smile:

Unfortunately not! We’ve updated our product line since then and managing any variations within the same Gitlab project (so images are linked by folder references (./gitlab/project/image.png) rather than URL.

It’s possible Gitlab has been updated in the last few years but it’s not something we’ve checked ourselves.

Sorry I couldn’t be more help!