Skip to content

Commit b5a1b40

Browse files
committed
Allowing includes to use content from openshift-kni repo as well as openshift repo
1 parent 81dac24 commit b5a1b40

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
@@ -625,10 +625,19 @@ def scrub_file(info, book_src_dir, src_file, tag=None, cwd=None):
625625
# data that it finds.
626626
# modified 20/Aug/2024 to process https links which are preceded
627627
# by an added directory (happens with hugeBook)
628+
# Modified 05/Dec/2024 to allow for https links from openshift-kni repo.
628629

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