I want to produce Link with a path for sharing limages - path

I have a folder which have a construction below.
images_folder1/
├image01.png
├image02.png
images_folder2/
├image01.png
├image02.png
I want to upload these folders and get the link to access and I hope that the link has something like a relative path or absolute path.
(ex: https://〇〇//images_folder1/image01.png)
I already tried to use Github to accomplish this goal. Actually Github enables me to get the link with a path structure like "https://github.com/User/test_repo/blob/main/images_folder1/image01.png".
but the images should not be seen to other people except for those who know the link.(Github's private repository cannot do this. I have to get the repository "public") That's why Github is not suitable.
Also, I came up with the idea to get the link by using online storage services like "Box" but the link that I can get via Box seemed to be encrypted.(I mean there are no relationship between the folder structure and the link itself.)
Are there anyone who know the best websites or applications suitable for my requirements?
It is the first time to ask questions via stack overflow and I'm Japanese, so there might be some expressions hard to understand or sentences that don't contain sufficient explanations. Please let me know.

GitHub also gives you a relative or absolute path for your image other than url like https://github.com/User/test_repo/blob/main/images_folder1/image01.png. Just make sure, the url path you have given is correct. As:
If your GitHub pages site is publised at abc.github.io then type abc.github.io/images_folder1/image01.png.
If your GitHub pages site is publised at abc.github.io/repository then type abc.github.io/repository/images_folder1/image01.png.
Note: Make sure that no "/" is used at the end of the image, or page, url. Such that abc.github.io/images_folder1/image01.png/ should not be used instead of "abc.github.io/images_folder1/image01.png" , otherwise it will throw an error.
EDIT:
Suppose your GitHub username is "abc".
And you create a repository named "tiger", and turn GitHub pages on from the setting.(If your repository is private then you will need to upgrade to a premium account to active GitHub Pages)
Then your GitHub Pages will be published at "https://abc.github.io/tiger",i.e.,
("https://your-username.github.io/repository-name") by default and the "index.html" file will work as your homepage.
And if you repository name is "tiger.github.io" instead of only tiger, then your GitHub Pages will be published at "https://tiger.github.io",i.e.,
("https://repository-name.github.io").
But of you want to connect it to a custom top-level domain then you can do it from the settings.

Related

Change Jekyll site baseurl without breaking links to existing posts

I have a Jekyll blog using the Minimal Mistakes theme. It's hosted through GitHub Pages, with a custom domain name. The github repo is called eg me.github.io. Currently, the blog is at something like http://www.example.com, so each post comes up like http://www.example.com/trouble-with-urls/.
I want to change it so that it's all at http://www.example.com/blog instead. I have added baseurl: "/blog" to my _config.yml file and now the posts are at the right place, http://www.example.com/blog/trouble-with-urls/. However, I now have two problems: all my image links are broken, and more importantly the links to individual posts are also broken.
Is it possible to automatically redirect posts? I looked at the jekyll-redirect-from gem, but I don't really understand it. It looks like the baseurl is automatically included in the path for the redirect_from: and I can't work out how to ignore it. The readme for that gem says, for customising, "Simply create a layout in your site's _layouts directory called redirect.html." Is there something I can do with that?
Actually I would also like to change the permalinks as well, to add dates, but I'm trying to focus on one problem at a time! Eventually the final URL of each post should be like http://www.example.com/blog/2021/02/13/trouble-with-urls/.
For the images, they are currently all hardcoded like ![url trouble](/assets/images/2021-02/ugh.png). I can fix the path by adding in "/blog", to make it ![url trouble](/blog/assets/images/2021-02/ugh.png) but I think this might be a bad way to link images anyway. I saw that there are {% %} tags for links but can't find any resources about using them for images. Is it possible?
I managed to get this working, so here's what I did in case anyone else tries similar in future.
Adding a baseurl in _config.yml didn't work. Instead, I duplicated my repo, to take advantage of Github Pages' allowance for 1 User site but many Project sites.
One repo remained as me.github.io. I renamed the copy to blog, and added a gh-pages branch. This made GitHub automatically deploy it at me.github.io/blog.
Within the blog repo, I changed the permalinks to the style I wanted. The images were fine as the relative paths hadn't changed.
Within the original me.github.io repo, I first changed the home page (by editing the Minimal Mistakes html files) to hide all posts. Then I added a link at the top of the page to their new home, at me.github.io/blog. The blog is now successfully a subsidiary of the main site.
So that old links wouldn't break, I kept all the existing post files in the me.github.io repo. I used the jekyll-redirect-from gem to add redirects into each post for the new address. This was done by manually adding a line into the Front Matter of each, saying eg redirect_to: http://www.example.com/blog/2021/02/13/trouble-with-urls/. I also deleted all the post content of these posts, so only the Front Matter was left.
All future posts will be made within the blog repo, and so they will have the correct URLs.

Why does my asciidoc relative link doesn't work outside of my microservice?

I'm starting to create documentation using asciidoc on my project which is following a microservices architecture.
We have a microservice for documentation. In its files I want to link to another document in another microservice.
I can do a relative link inside my own component but when I try to go higher with ../ it does not work and the link does nothing.
Does anyone may know why ?
Could it be because asciidoc is installed in the jenkins file of my component but not the others ?
Or is it because I do not use the link correctly ?
I use it as it is describe in the doc :
link:../other_microservice/other-document.asciidoc[]
I also tried the xref with no more success.
Thanks a lot for anyone who can help me
The link: macro is supposed to be used with a URL, not a file path. Generally, it does what you mean. However, Asciidoctor's safe mode prevents access to files which reside outside of the folder containing the source file specified for transformation.
So, if the documentation for your other microservices is going to be hosted separately (e.g. one URL per microservice), then you should update your link: macro usage to specify URLs instead.
If all of your microservice documentation is to be hosted under one URL, specify --safe when you invoke Asciidoctor. For more details, see:: https://asciidoctor.org/docs/user-manual/#running-asciidoctor-securely

How to have myname.github.io as url of a personal website on GitHub?

I want to set up a personal website on Github. I followed this video to create a repository containing a file index.html.
I read online that in order to obtain an url <myname>.github.io for this html page, you need to name the respository <myname>.github.io. But when I do this, the html page gets published to <accountname>.github.io/<myname>.github.io. Did I do something wrong?
From https://pages.github.com:
Head over to GitHub and create a new repository named
username.github.io, where username is your username (or organization
name) on GitHub.
If the first part of the repository doesn’t exactly match your
username, it won’t work, so make sure to get it right.

How to make permanent url to file in svn?

Good day, colleagues,
can you advice me, how to make permanent links to files in SVN?
If I make a link, now I get something like:
http://172.29.15.15/svn/OFFICE_WORK/Trainings/123.xlsx
but if I move file to other directory, I get a error (file not found).
I know that in Sharepoint I can assign unique IDs (aditional option in admin panel) to files, and I'll get a permanent URL to file, that doesn't depend on it's location.
Is there an opportunity in SVN to make permanent link to file, that not depend on it's location?
Thank you in advance!
I'm not sure if I'm understanding the question correctly when you say "permanent link". But try adding an external property to your checked out directory. Right click on the directory you wish to add the 123.xslx file to, go to TortoiseSVN > Properties > New > Externals.
Then click New..., give the local path to the file and URL to the file which you posted above
Example:
Local Path: 123.xlsx
URL: http://172.29.15.15/svn/OFFICE_WORK/Trainings/123.xlsx
Hit OK. OK, again. Then do an SVN Update on the folder. Your 123.xlsx file should be included.
Not sure what you're referring to by not depending on location though. In subversion, in order to pull a file, you have to have the URL to gather it from. There isn't any ID feature unfortunately. It seems your repositories are based off an IP address of some sort... Is there any way you can use a common domain name for your path? That would probably solve your issue as well.

How do I link to a PDF file in Silex?

I've looked around a bit and can't seem to figure out how to link to a static file while using Silex. I've seen some similar questions/answers in regards to Symfony, but they involved YML routing files, which I don't use with Silex.
My Situation
I have some files in a /docs folder. Logged in users can upload new pdf files (so, I don't know ahead of time what all of the filenames will be; they're constantly changing).
My Intent
I need to be able to link to these PDF files, so that a click on a link somewhere will open www.myurl.com/docs/myfile.pdf.
The Problem
Due to the routing system in silex, it treats the url as a route (obviously) and throws a Page Not Found error.
Thanks in advance for any feedback!
You need to configure your web server in a way that it does not forward existing files to the front controller. The web servers section of the silex documentation has examples of such configurations for the most popular web servers.
As for the link itself, just link to the file directly, something along these lines:
{{ filename }}

Resources