diff --git a/hc/front/urls.py b/hc/front/urls.py index 55142d5b..5cfee8aa 100644 --- a/hc/front/urls.py +++ b/hc/front/urls.py @@ -72,7 +72,7 @@ urlpatterns = [ path("projects//checks/status/", views.status, name="hc-status"), path("checks//", include(check_urls)), path("integrations/", include(channel_urls)), - path("docs/", views.docs, name="hc-docs"), + path("docs/", views.serve_doc, name="hc-docs"), path("docs/api/", views.docs_api, name="hc-docs-api"), path("docs/cron/", views.docs_cron, name="hc-docs-cron"), path("docs/resources/", views.docs_resources, name="hc-docs-resources"), diff --git a/hc/front/views.py b/hc/front/views.py index c34c53a8..2027daf5 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -264,20 +264,7 @@ def index(request): return render(request, "front/welcome.html", ctx) -def docs(request): - ctx = { - "page": "docs", - "section": "home", - "ping_endpoint": settings.PING_ENDPOINT, - "ping_email": "your-uuid-here@%s" % settings.PING_EMAIL_DOMAIN, - "ping_email_domain": settings.PING_EMAIL_DOMAIN, - "ping_url": settings.PING_ENDPOINT + "your-uuid-here", - } - - return render(request, "front/docs.html", ctx) - - -def serve_doc(request, doc): +def serve_doc(request, doc="introduction"): path = os.path.join(settings.BASE_DIR, "templates/docs", doc + ".html") if not os.path.exists(path): raise Http404("not found") diff --git a/templates/base.html b/templates/base.html index 9c460703..3cde5167 100644 --- a/templates/base.html +++ b/templates/base.html @@ -124,7 +124,7 @@ {% endif %}
  • - Docs + Docs
  • {% if request.user.is_authenticated %} diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index f923ab0c..2a727a2f 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -8,7 +8,9 @@