Replies: 1 comment 1 reply
-
|
How can I access this _assets file in my Appwiki? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I recently saw the blog post about the change, that images can now be uploaded to wikis directly.
While I welcome this change, do I feel like that the way of how the images are saved could be changed, to utilize the wiki more effectively.
Currently, when uploading an image, is the resulting URL often something alongside this example:
https://user-images.githubusercontent.com/11576465/153945162-3ca15ae2-af2f-4663-8295-18f99e7f1aa9.png
Suggestion
My suggestion is, to now change this behaviour for wikis, and maybe even repositories in general.
I recall a fact, that certain files (or files in general) got uploaded under a repository's dedicated folder for those, when they got uploaded to issues or Pull requests (This seems to have changed since?)
The new behaviour would upload the image or file itself directly to an
_assetsfolder in the wiki on its default branch and return theraw.githubusercontent.comURL for it.As an example, uploading an image called
Example.pngon a wiki forExampleUser/ExampleRepowould give back the following URL (Assuming default branch is main):https://raw.githubusercontent.com/ExampleUser/ExampleRepo.wiki/main/_assets/Example.png
Possible questions and answers
Why would this be useful?
It would allow maintainers to have a more easy way to update images in the wiki.
While you can just upload the new image and update the URLs, can this be tedious, if the same image is used in multiple locations on the wiki.
With this setup could you clone the wiki locally to your desktop, update the image under the
_assetsfolder and push the changes back.That way can the URL stay the same and maintenance work is minimal.
What if a file with that name already exists?
The file would get a number attached to its name, similar to how many OS do that already when downloading files with the same name.
This means that
Example.pngwould becomeExample-1.pngWhat if the
_assetsfolder already exists?While unlikely since the wiki is often not used outside of storing Markdown files, is there the possibility for this.
In such a case would GitHub just work as if it existed before and upload the files to it, while following the previous question about duplicate names.
Aren't there any alternatives?
Currently, available alternatives would be:
All of them have their benefits and drawbacks.
Selfhosting would allow freedom of how the image is named and how the URL should look like, but requires a VPS (Or alternatively GitHub Pages, Vercel, Netlify, ...) and/or some knowledge about maintaining all this.
Parent repository is nice, but it could feel out of place if the repository isn't really image-focused or similar.
Image hosts like Imgur usually change their URLs for the image for each upload, requiring you to update the URL anyway, which wouldn't be different to a directly upload now.
Beta Was this translation helpful? Give feedback.
All reactions