diff --git a/hc/front/views.py b/hc/front/views.py index a41af575..ca7bc55c 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -283,6 +283,7 @@ def serve_doc(request, doc="introduction"): "section": "home", "section": doc, "content": content, + "first_line": content.split("\n")[0], } return render(request, "front/docs_single.html", ctx) diff --git a/templates/docs/http_api.html b/templates/docs/http_api.html index ab537cea..40625c65 100644 --- a/templates/docs/http_api.html +++ b/templates/docs/http_api.html @@ -53,15 +53,15 @@ minimizes the delay from your monitored service failing to you receiving an aler -
HTTP/1.1 200 OK
-Server: nginx
-Date: Wed, 29 Jan 2020 09:58:23 GMT
-Content-Type: text/plain; charset=utf-8
-Content-Length: 2
-Connection: close
-Access-Control-Allow-Origin: *
-
-OK
+HTTP/1.1 200 OK
+Server: nginx
+Date: Wed, 29 Jan 2020 09:58:23 GMT
+Content-Type: text/plain; charset=utf-8
+Content-Length: 2
+Connection: close
+Access-Control-Allow-Origin: *
+
+OK
@@ -82,13 +82,13 @@ optional but enables a few extra features:
HTTP/1.1 200 OK
-Server: nginx
-Date: Wed, 29 Jan 2020 09:58:23 GMT
-Content-Type: text/plain; charset=utf-8
-Content-Length: 2
-Connection: close
-Access-Control-Allow-Origin: *
+HTTP/1.1 200 OK
+Server: nginx
+Date: Wed, 29 Jan 2020 09:58:23 GMT
+Content-Type: text/plain; charset=utf-8
+Content-Length: 2
+Connection: close
+Access-Control-Allow-Origin: *
-OK
+OK
\ No newline at end of file
diff --git a/templates/docs/http_api.md b/templates/docs/http_api.md
index 015b90c5..9bb86695 100644
--- a/templates/docs/http_api.md
+++ b/templates/docs/http_api.md
@@ -63,7 +63,7 @@ GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/fail HTTP/1.0
Host: hc-ping.com
```
-```
+```http
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 Jan 2020 09:58:23 GMT
@@ -94,7 +94,7 @@ GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/start HTTP/1.0
Host: hc-ping.com
```
-```
+```http
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 Jan 2020 09:58:23 GMT
diff --git a/templates/docs/introduction.html b/templates/docs/introduction.html
index 22cbb40b..cb6bb06c 100644
--- a/templates/docs/introduction.html
+++ b/templates/docs/introduction.html
@@ -1,4 +1,4 @@
-SITE_NAME
+SITE_NAME Documentation
SITE_NAME is a service for monitoring cron jobs and similar periodic processes:
Take note of your check's unique ping URL
-Finally, edit your crontab and append a curl or wget call after the command:
+Finally, edit your cron job definition and append a curl or wget call +after the command:
$ crontab -e
# m h dom mon dow command
8 6 * * * /home/user/backup.sh && curl -fsS --retry 3 PING_URL > /dev/null
Now, each time your cron job runs, it will send a HTTP request to the ping URL.
-Since SITE_NAME knows the schedule of your cron job, it can calculate +
Now, each time your cron job runs, it will send a HTTP request to the ping URL. +Since SITE_NAME knows the schedule of your cron job, it can calculate the dates and times when the job should run. As soon as your cron job doesn't report at an expected time, SITE_NAME will send you a notification.
This monitoring technique takes care of various failure scenarios that could diff --git a/templates/docs/monitoring_cron_jobs.md b/templates/docs/monitoring_cron_jobs.md index 8bb80d30..c055d051 100644 --- a/templates/docs/monitoring_cron_jobs.md +++ b/templates/docs/monitoring_cron_jobs.md @@ -35,7 +35,8 @@ increasingly important as you add more checks to your account. 1. Take note of your check's unique **ping URL** -Finally, edit your crontab and append a curl or wget call after the command: +Finally, edit your cron job definition and append a curl or wget call +after the command: ```bash $ crontab -e @@ -44,7 +45,6 @@ $ crontab -e ``` Now, each time your cron job runs, it will send a HTTP request to the ping URL. - Since SITE_NAME knows the schedule of your cron job, it can calculate the dates and times when the job should run. As soon as your cron job doesn't report at an expected time, SITE_NAME will send you a notification. diff --git a/templates/front/docs_single.html b/templates/front/docs_single.html index 7e2a3263..e484b4d1 100644 --- a/templates/front/docs_single.html +++ b/templates/front/docs_single.html @@ -1,16 +1,13 @@ {% extends "front/base_docs.html" %} {% load compress static hc_extras %} -{% block title %}Documentation - {% site_name %}{% endblock %} -{% block description %} - -{% endblock %} -{% block keywords %} - -{% endblock %} +{% block title %}{{ first_line|striptags }} - {% site_name %}{% endblock %} +{% block description %}{% endblock %} +{% block keywords %}{% endblock %} - -{% block docs_content %}