about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--corp/tvixbolt/index.html4
-rw-r--r--corp/tvixbolt/src/main.rs21
2 files changed, 25 insertions, 0 deletions
diff --git a/corp/tvixbolt/index.html b/corp/tvixbolt/index.html
index af6123a202c0..62bf14539f2b 100644
--- a/corp/tvixbolt/index.html
+++ b/corp/tvixbolt/index.html
@@ -7,5 +7,9 @@
           href="https://unpkg.com/terminal.css@0.7.2/dist/terminal.min.css" />
     <link data-trunk rel="inline" href="index.css">
     <title>Tvixbolt</title>
+
+    <!-- Yandex.RTB -->
+    <script>window.yaContextCb=window.yaContextCb||[]</script>
+    <script src="https://yandex.ru/ads/system/context.js" async></script>
   </head>
 </html>
diff --git a/corp/tvixbolt/src/main.rs b/corp/tvixbolt/src/main.rs
index ee73fce71d47..f36d264d555e 100644
--- a/corp/tvixbolt/src/main.rs
+++ b/corp/tvixbolt/src/main.rs
@@ -36,6 +36,26 @@ fn tvixbolt_overview() -> Html {
     }
 }
 
+/// This renders an ad in the Tvixbolt footer. Most people that end up
+/// on Tvixbolt will probably block this anyways, but might as well.
+fn ad() -> Html {
+    let ad_code = r#"
+window.yaContextCb.push(()=>{
+  Ya.Context.AdvManager.render({
+    renderTo: 'yandex_rtb_R-A-1943274-1',
+    blockId: 'R-A-1943274-1'
+  })
+})
+"#;
+
+    html! {
+        <div id="ad">
+            <div id="yandex_rtb_R-A-1943274-1"></div>
+            <script>{ad_code}</script>
+        </div>
+    }
+}
+
 fn footer_link(location: &'static str, name: &str) -> Html {
     html! {
         <>
@@ -57,6 +77,7 @@ fn footer() -> Html {
             {"© ООО ТВЛ"}
           </p>
           <p class="lod">{"ಠ_ಠ"}</p>
+          {ad()}
         </footer>
         </>
     }