index.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="canonical" href="https://jamesfengcao.gitlab.io/uweb/en/url2site/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>Any url as website</title>
  9. <script>
  10. function findLang(){
  11. let href = location.href;
  12. for(let i=href.length-1;i>0;i--){
  13. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  14. return i;
  15. }
  16. return 0;
  17. }
  18. function nav2(page){
  19. let i = findLang();
  20. location.href = location.href.substring(0,i+1)+page;
  21. }
  22. function nav2Lang(lang){
  23. let i = findLang();
  24. let href = location.href;
  25. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  26. }
  27. </script>
  28. </head>
  29. <body>
  30. <header class='header'>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  32. <nav>
  33. </nav>
  34. </header>
  35. <br />
  36. <div class="container">
  37. <h1 class="title">Any url as website
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. </ul>
  43. <p>The <a href="../index.html#">uweb</a> internal link &quot;<a href="../links/index.html">i:0m</a>&quot; make any url such as download or indirect links visitable as a website. The second part of <a href="../mirrors/index.html#">mirrors</a> has examples using the following tricks:</p>
  44. <ul>
  45. <li>&quot;i:0m04:[url]&quot;: to treat the [url] content as html with bookmarklet.</li>
  46. <li>&quot;i:0m?:[url]&quot;: to treat the [url] content as html, handling css/js properly.</li>
  47. <li>&quot;i:0m?[postfix]:[url]&quot;: auto append query postfix to url to retrieve content.</li>
  48. <li>&quot;i:0mi:5h:[url]&quot;: similar to &quot;i:0m?:[url]&quot;, to treat the [url] content as html (for download or no-script links etc.)</li>
  49. <li>&quot;i:0mi:5h?[postfix]::[url]&quot;: similar to &quot;i:0m?[postfix]:[url]&quot;. auto append query postfix to url to retrieve content.</li>
  50. <li>&quot;i:0mi:5h/[regex]/[replacement]::[url]&quot;: use the result of regular expression replacement to retrieve the content.</li>
  51. </ul>
  52. <p>For more complicated links such as cloud storage shared links, which need user gestures to reach temporary generated content link, use<br>
  53. &quot;i:0m/.../[local.html]:[url]&quot;, where the local file &quot;/.../[local.html]&quot; processes &quot;[url]&quot; as needed.</p>
  54. </div>
  55. <p>Last Modified: 7 April 2024<br>
  56. more details on global redirection url<br>
  57. <pre></pre>
  58. </p>
  59. <script id='jsgiscus'
  60. src='https://giscus.app/client.js'
  61. data-repo="torappinfo/uweb"
  62. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  63. data-category="Announcements"
  64. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  65. data-mapping="title"
  66. data-strict="0"
  67. data-reactions-enabled="1"
  68. data-emit-metadata="0"
  69. data-input-position="top"
  70. data-theme="light"
  71. data-lang="en"
  72. data-loading="lazy"
  73. crossorigin="anonymous" async>
  74. </script>
  75. <footer class="site-footer">
  76. <div class="container">
  77. &copy; 2018-2024 Richard H. Cao
  78. </div>
  79. </footer>
  80. <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
  81. </body>
  82. </html>