Skip to content

Commit 12921d6

Browse files
authored
Merge pull request #85878 from rohennes/include-openshift-kni
Allowing includes to use content from openshift-kni repo as well as openshift repo
2 parents 9b3b63e + b5a1b40 commit 12921d6

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

build_for_portal.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,19 @@ def scrub_file(info, book_src_dir, src_file, tag=None, cwd=None):
626626
# data that it finds.
627627
# modified 20/Aug/2024 to process https links which are preceded
628628
# by an added directory (happens with hugeBook)
629+
# Modified 05/Dec/2024 to allow for https links from openshift-kni repo.
629630

631+
# Check for both allowed URL patterns
630632
https_pos = base_src_file.find("https://raw.githubusercontent.com/openshift/")
631-
if https_pos >=0:
632-
base_src_file = base_src_file[https_pos:]
633+
https_kni_pos = base_src_file.find("https://raw.githubusercontent.com/openshift-kni/")
634+
635+
if https_pos >= 0 or https_kni_pos >= 0:
636+
# Ensure we start from the correct URL (either github or openshift-kni)
637+
if https_kni_pos >= 0:
638+
base_src_file = base_src_file[https_kni_pos:]
639+
else:
640+
base_src_file = base_src_file[https_pos:]
641+
633642
try:
634643
response = requests.get(base_src_file)
635644
if response:

contributing_to_docs/doc_guidelines.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ host site.
10081008
[IMPORTANT]
10091009
====
10101010
You are restricted to only embed files from GitHub repositories managed by the
1011-
`openshift` GitHub user. You must also prefix your external file URI with `https`.
1011+
`openshift` or `openshift-kni` GitHub user. You must also prefix your external file URI with `https`.
10121012
URIs beginning with `http` are forbidden for security reasons and will fail the
10131013
documentation build.
10141014
====

0 commit comments

Comments
 (0)