simo hace 1 mes
padre
commit
997e3c2a64
Se han modificado 2 ficheros con 29 adiciones y 28 borrados
  1. 0 27
      example-config.ini
  2. 29 1
      templates/home.html

+ 0 - 27
example-config.ini

@@ -1,27 +0,0 @@
-[server]
-host = 0.0.0.0
-port = 8087
-domain = https://search.simo.ng
-
-[proxy]
-# Single proxy (comment out to use list_file instead)
-#proxy = "socks5://127.0.0.1:9050"
-
-# Or use a proxy list file (one proxy per line)
-#list_file = proxies.txt
-
-#max_retries = 3
-
-# Randomize proxy credentials for each request
-#randomize_username = true
-#randomize_password = true
-
-[cache]
-# Directory to store cached responses
-#dir = /tmp/omnisearch_cache
-
-# Cache TTL for search results in seconds (default: 3600 = 1 hour)
-#ttl_search = 3600
-
-# Cache TTL for infobox data in seconds (default: 86400 = 24 hours)
-#ttl_infobox = 86400

+ 29 - 1
templates/home.html

@@ -15,11 +15,39 @@
             title="Simo Search"
             href="/opensearch.xml"
         />
+        <script>
+            (function () {
+                function applyEmbedModeFromHash() {
+                    var isEmbed =
+                        (window.location.hash || "").indexOf("#embed") !== -1;
+                    if (!isEmbed) return;
+
+                    var container = document.querySelector(
+                        ".view-home .container",
+                    );
+                    if (!container) return;
+
+                    document.body.innerHTML = "";
+                    document.body.appendChild(container);
+                }
+
+                if (document.readyState === "loading") {
+                    document.addEventListener(
+                        "DOMContentLoaded",
+                        applyEmbedModeFromHash,
+                    );
+                } else {
+                    applyEmbedModeFromHash();
+                }
+
+                window.addEventListener("hashchange", applyEmbedModeFromHash);
+            })();
+        </script>
     </head>
 
     <body>
         <div class="view-home">
-            <div class="container">
+            <div class="container" id="container">
                 <h1 class="hero-logo">Simo <span>Search</span></h1>
                 <form action="/search" class="home-search-form">
                     <div class="search-input-wrapper">