Skip to content

Commit d21d9be

Browse files
committed
ok
1 parent 6bbea9b commit d21d9be

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.buildkite/scripts/build_pr.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ PREVIEW_URL="https://${TARGET_BRANCH}.docs-preview.app.elstc.co"
228228
build_cmd="./build_docs --all \
229229
--target_repo [email protected]:elastic/built-docs \
230230
--reference /opt/git-mirrors/ \
231-
--skiplinkcheck \
232231
--target_branch ${TARGET_BRANCH} \
233232
--push \
234233
--announce_preview ${PREVIEW_URL}/diff \

resources/asciidoctor/lib/chunker/extension.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def add_nav(doc)
8585

8686
def add_url_to_v3(doc)
8787
url_to_v3 = UrlToV3.new doc
88-
doc.blocks.insert 0, url_to_v3.header
88+
doc.blocks.insert 0, url_to_v3.url
8989
end
9090

9191
def correct_xref(node)
@@ -116,7 +116,7 @@ def form_section_into_page(doc, section, html)
116116
def add_subdoc_sections(doc, subdoc, html)
117117
nav = Nav.new subdoc
118118
url_to_v3 = UrlToV3.new subdoc
119-
subdoc << url_to_v3.header
119+
subdoc << url_to_v3.url
120120
subdoc << nav.header
121121
subdoc << Asciidoctor::Block.new(subdoc, :pass, source: html)
122122
subdoc << footnotes(doc, subdoc) if doc.footnotes?

resources/asciidoctor/lib/chunker/url_to_v3.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Chunker
22

33
class UrlToV3
44

5-
attr_reader :header
5+
attr_reader :url
66

77
def initialize(doc)
88
current_url = doc.attr('current-url')
@@ -28,18 +28,17 @@ def initialize(doc)
2828
segments[0]
2929
end
3030

31-
actual_url = 'https://www.elastic.co/guide' + path_dir + '/*/' + current_url
31+
actual_url = '/guide' + path_dir + '/*/' + current_url
3232

3333
if mapping.key?(actual_url)
3434
new_url = mapping[actual_url]
3535
else
3636
new_url = '/docs'
3737
end
3838

39-
@header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
40-
<div id="url-to-v3">
41-
From: #{actual_url}
42-
To: <a href="https://www.elastic.co#{new_url}">NEW URL</a>
39+
@url = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
40+
<div id="url-to-v3" style="display: none;">
41+
A newer version is available. For the latest information, see the <a href="https://www.elastic.co#{new_url}">current release documentation</a>
4342
</div>
4443
HTML
4544
end

resources/web/template.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@
146146

147147
<script src="/guide/static/jquery.js"></script>
148148
<script type="text/javascript" src="/guide/static/docs-v1.js"></script>
149+
<script>
150+
var pageHeader = document.querySelector('.page_header');
151+
var urlToV3 = document.querySelector('#url-to-v3');
152+
if (pageHeader && urlToV3) {
153+
pageHeader.innerHTML = urlToV3.innerHTML;
154+
}
155+
</script>
149156
<!-- DOCS FINAL -->
150157
</body>
151158
</html>

0 commit comments

Comments
 (0)