mirror of
https://github.com/Django-LiveView/docs.git
synced 2024-12-22 19:05:35 +01:00
Add sitemap and robots
This commit is contained in:
parent
caefd89dec
commit
60c1edd829
4
assets/robots.txt
Normal file
4
assets/robots.txt
Normal file
@ -0,0 +1,4 @@
|
||||
User-Agent: *
|
||||
Allow: /
|
||||
Disallow: /img/
|
||||
Sitemap: https://django-liveview.andros.dev/sitemap.txt
|
19
onerc.el
19
onerc.el
@ -1,3 +1,6 @@
|
||||
;; Variables
|
||||
(defvar domain "django-liveview.andros.dev")
|
||||
|
||||
;; Utils
|
||||
(defun make-title (title)
|
||||
"If title is empty, return the website name. Otherwise, return the title with the website name."
|
||||
@ -161,3 +164,19 @@
|
||||
)))
|
||||
(:main.main.main--docs
|
||||
,content))))))
|
||||
|
||||
;; Sitemap
|
||||
|
||||
(defun make-sitemap (pages tree global)
|
||||
"Produce file ./public/sitemap.txt"
|
||||
(with-temp-file "./public/sitemap.txt"
|
||||
(insert
|
||||
(mapconcat 'identity (mapcar
|
||||
(lambda (page)
|
||||
(let* ((path (plist-get page :one-path))
|
||||
(link (concat "https://" domain path)))
|
||||
link
|
||||
))
|
||||
pages) "\n"))))
|
||||
|
||||
(add-hook 'one-hook 'make-sitemap)
|
||||
|
Loading…
Reference in New Issue
Block a user