alexeyinkin commented on code in PR #21959:
URL: https://github.com/apache/beam/pull/21959#discussion_r920052853


##########
website/www/site/layouts/get-started/playground_template.html:
##########
@@ -0,0 +1,42 @@
+{{/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+*/}}
+
+<!DOCTYPE html>
+<html lang="{{ .Site.Language.Lang }}" class="no-js">
+<head>
+  {{ partial "head.html" . }}
+</head>
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+  {{ partial "header.html" . }}
+  <div class="clearfix container-main-content">
+    <div class="section-nav closed" data-offset-top="90" 
data-offset-bottom="500">
+      <span class="section-nav-back glyphicon glyphicon-menu-left"></span>
+      <nav>
+        <ul class="section-nav-list" data-section-nav>
+          {{ partial (printf "section-menu/%s/get-started.html" .Lang) . }}
+        </ul>
+      </nav>
+    </div>
+
+    <nav class="page-nav clearfix" data-offset-top="90" 
data-offset-bottom="500">
+      {{ .TableOfContents }}
+    </nav>
+
+    <div class="body__contained body__section-nav">
+      {{ .Content }}
+      {{ partial "feedback.html" . }}
+    </div>
+  </div>
+{{ partial "footer.html" . }}
+{{ partial "hooks/body-end-playground.html"}}

Review Comment:
   Do we need to include this on each page where this scrolling trick is used? 
If so, it is inconvenient.
   
   I see the following options to avoid it:
   
   1. There seems to be a technique to check if a shortcode is used anywhere in 
the page to include scripts in that case:
   https://gohugo.io/templates/shortcode-templates/#checking-for-existence
   
   2. Inline JS in the shortcode. It may be non-trivial if we want to avoid IDs 
on iframes and divs.
   
   3. Include this JS unconditionally on all pages as the last resort, since 
Playground will likely be used on most of them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to