Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate multipass docs pages #1440

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions templates/multipass/docs/document.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% with
document=document,
nav_items=nav_items,
search_action="/multipass/docs/search",
siteSearch="/multipass/docs",
placeholder="Search Multipass docs",
navigation=navigation
%}
{% include "docs/shared/_docs.html" %}
{% endwith %}
12 changes: 12 additions & 0 deletions templates/multipass/docs/search-results.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% with
title="Multipass Docs",
query=query,
results=results,
search_action="/multipass/docs/search",
siteSearch="/multipass/docs",
placeholder="Search Multipass Docs",
search_path="/multipass/docs/search",
forum_link="https://discourse.ubuntu.com/c/multipass/21"
%}
{% include "docs/shared/_search-results.html" %}
{% endwith %}
25 changes: 25 additions & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,31 @@ def allow_src(tag, name, value):
return False


# Multipass docs
multipass_docs = Docs(
parser=DocParser(
api=DiscourseAPI(
base_url="https://discourse.ubuntu.com/", session=search_session
),
index_topic_id=8294,
url_prefix="/multipass/docs",
),
document_template="/multipass/docs/document.html",
url_prefix="/multipass/docs",
blueprint_name="multipass-docs",
)
app.add_url_rule(
"/multipass/docs/search",
"multipass-docs-search",
build_search_view(
app=app,
session=search_session,
site="canonical.com/multipass/docs",
template_path="/multipass/docs/search-results.html",
),
)
multipass_docs.init_app(app)

# Data Platform Spark on K8s docs
data_spark_k8s_docs = Docs(
parser=DocParser(
Expand Down