index.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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="stylesheet" href="../style.css#" type="text/css" />
  7. <title>Any url as website</title>
  8. <script type="text/javascript">
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <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>
  31. <nav>
  32. </nav>
  33. </header>
  34. <br />
  35. <div class="container">
  36. <h1 class="title">Any url as website
  37. <br>
  38. <span class="subtitle"></span>
  39. </h1>
  40. <ul class="tags">
  41. </ul>
  42. <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>
  43. <ul>
  44. <li>&quot;i:0m04:[url]&quot;: to treat the [url] content as html with bookmarklet.</li>
  45. <li>&quot;i:0m?:[url]&quot;: to treat the [url] content as html, handling css/js properly.</li>
  46. <li>&quot;i:0m?[postfix]:[url]&quot;: auto append query postfix to url to retrieve content.</li>
  47. <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>
  48. <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>
  49. <li>&quot;i:0mi:5h/[regex]/[replacement]::[url]&quot;: use the result of regular expression replacement to retrieve the content.</li>
  50. </ul>
  51. <p>For more complicated links such as cloud storage shared links, which need user gestures to reach temporary generated content link, use<br>
  52. &quot;i:0m/.../[local.html]:[url]&quot;, where the local file &quot;/.../[local.html]&quot; processes &quot;[url]&quot; as needed.</p>
  53. </div>
  54. <p>Last Modified: 7 April 2024<br>
  55. more details on global redirection url<br>
  56. <pre></pre>
  57. </p>
  58. <script id='jsgiscus'
  59. src='https://giscus.app/client.js'
  60. data-repo="torappinfo/uweb"
  61. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  62. data-category="Announcements"
  63. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  64. data-mapping="title"
  65. data-strict="0"
  66. data-reactions-enabled="1"
  67. data-emit-metadata="0"
  68. data-input-position="top"
  69. data-theme="light"
  70. data-lang="en"
  71. data-loading="lazy"
  72. crossorigin="anonymous" async>
  73. </script>
  74. <footer class="site-footer">
  75. <div class="container">
  76. &copy; 2018-2024 Richard H. Cao
  77. </div>
  78. </footer>
  79. <!-- 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/>. -->
  80. </body>
  81. </html>