Add filter to json builds to prevent search indexing on hidden documents (#56)
All checks were successful
Create Weekly Analytics Stats / run-analytics (push) Successful in 11s
All checks were successful
Create Weekly Analytics Stats / run-analytics (push) Successful in 11s
Reviewed-on: #56 Reviewed-by: Tino Schreiber <tino.schreiber@t-systems.com> Co-authored-by: Sebastian Gode <sebastian.gode@telekom.de> Co-committed-by: Sebastian Gode <sebastian.gode@telekom.de>
This commit is contained in:
@ -41,7 +41,11 @@ commands =
|
||||
sphinx-minify --input-directory doc/build/html_temp/ --output-directory doc/build/html
|
||||
{%- for doc in docs %}
|
||||
{[testenv:{{ doc.type }}]commands}
|
||||
{#- To avoid hidden documents to be searchable -#}
|
||||
{%- if (target_environment == 'internal' and doc.visibility != 'hidden')
|
||||
or (target_environment == 'public' and doc.visibility == 'public') %}
|
||||
{[testenv:json-{{ doc.type }}]commands}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{% if docs|length > 0 %}
|
||||
@ -90,6 +94,10 @@ commands =
|
||||
cp -av doc/build/html/{{ doc.type }} {{ doc.type }}/build/html
|
||||
{%- endif %}
|
||||
|
||||
{#- To avoid hidden documents to be searchable -#}
|
||||
{%- if (target_environment == 'internal' and doc.visibility != 'hidden')
|
||||
or (target_environment == 'public' and doc.visibility == 'public') %}
|
||||
|
||||
# Json version (for search)
|
||||
[testenv:json-{{ doc.type }}]
|
||||
deps = {[testenv:docs]deps}
|
||||
@ -109,6 +117,7 @@ commands =
|
||||
mkdir -p {{ doc.type }}/build/json
|
||||
cp -av doc/build/json/{{ doc.type }} {{ doc.type }}/build/json
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
# PDF version
|
||||
[testenv:{{ doc.type }}-pdf-docs]
|
||||
|
@ -316,6 +316,7 @@ def process_repositories(args, service):
|
||||
if doc["type"] == "dev":
|
||||
doc["type"] = "dev-guide"
|
||||
doc["pdf_enabled"] = cloud_environment["pdf_enabled"]
|
||||
doc["visibility"] = cloud_environment["visibility"]
|
||||
context["docs"].append(doc)
|
||||
|
||||
context["target_environment"] = args.target_environment
|
||||
|
Reference in New Issue
Block a user