Skip to content

Commit 78c8f7b

Browse files
committed
update bitrise-navigation documentation
1 parent 6641d25 commit 78c8f7b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

dist/bitrise-navigation.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<!-- Load the component script (production: from CDN, dev: local) -->
7272
<script>
7373
const script = document.createElement('script');
74-
script.src = `/bitrise-navigation.js?v=${Date.now()}`; // Cache-busting for development; use CDN URL in production
74+
script.src = `/bitrise-navigation.js?v=${Math.floor(Date.now() / 3600000)}`; // Hourly cache-busting
7575
script.async = true;
7676
document.head.appendChild(script);
7777
</script>
@@ -97,8 +97,12 @@ <h2>Quick Start (no framework)</h2>
9797

9898
<span class="tag">&lt;bitrise-footer&gt;&lt;/bitrise-footer&gt;</span>
9999

100-
<span class="comment">&lt;!-- 2. Load the component script (once — registers both elements) --&gt;</span>
101-
<span class="tag">&lt;script</span> <span class="attr">src</span>=<span class="str">"https://web-cdn.bitrise.io/bitrise-navigation.js"</span><span class="tag">&gt;&lt;/script&gt;</span></code></pre>
100+
<span class="comment">&lt;!-- 2. Load the component script (hourly cache-busting) --&gt;</span>
101+
<span class="tag">&lt;script&gt;</span>
102+
<span class="kw">const</span> s = document.createElement(<span class="str">'script'</span>);
103+
s.src = <span class="str">`https://web-cdn.bitrise.io/bitrise-navigation.js?v=${Math.floor(Date.now() / 3600000)}`</span>;
104+
document.head.appendChild(s);
105+
<span class="tag">&lt;/script&gt;</span></code></pre>
102106

103107
<p>That's it. Each element:</p>
104108
<ol>
@@ -124,7 +128,11 @@ <h3>1. Load the script</h3>
124128
<pre><code><span class="comment">&lt;!-- public/index.html --&gt;</span>
125129
<span class="tag">&lt;head&gt;</span>
126130
...
127-
<span class="tag">&lt;script</span> <span class="attr">src</span>=<span class="str">"https://web-cdn.bitrise.io/bitrise-navigation.js"</span><span class="tag">&gt;&lt;/script&gt;</span>
131+
<span class="tag">&lt;script&gt;</span>
132+
<span class="kw">const</span> s = document.createElement(<span class="str">'script'</span>);
133+
s.src = <span class="str">`https://web-cdn.bitrise.io/bitrise-navigation.js?v=${Math.floor(Date.now() / 3600000)}`</span>;
134+
document.head.appendChild(s);
135+
<span class="tag">&lt;/script&gt;</span>
128136
<span class="tag">&lt;/head&gt;</span></code></pre>
129137

130138
<h3>2. Use in JSX</h3>

0 commit comments

Comments
 (0)