Skip to content

Commit a2ed78c

Browse files
committed
Better robots handling for frontpage
1 parent 4e3b664 commit a2ed78c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/blog/blog.lisp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
(with-site ((my site))
127127
(with-ml-output-start
128128
(loop for entry in (my ready-entries) do
129-
(output-raw-ml "http://" (its canonical-name (its dispatcher (my site))) (its url-path entry) tpd2.io:+newline+)))))
129+
(output-raw-ml (its canonical-protocol (its dispatcher (my site))) (its canonical-name (its dispatcher (my site))) (its url-path entry) tpd2.io:+newline+)))))
130130

131131

132132
(my-defun blog set-page ()
@@ -186,7 +186,9 @@
186186
(lambda ()
187187
(webapp ((with-ml-output (my name) ": frontpage")
188188
:head-contents
189-
(my feed-head-contents))
189+
(with-ml-output
190+
(output-raw-ml "<meta name='robots' content='noindex,follow' />")
191+
(my feed-head-contents)))
190192
(my front-page))))
191193

192194
(defpage-lambda-blog (my latest-url)

src/http/dispatcher.lisp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
(defstruct dispatcher
44
canonical-name
5+
(canonical-protocol "http://")
56
(paths (make-hash-table :test 'equalp))
67
(error-responder 'default-http-error-page))
78

@@ -115,10 +116,10 @@
115116
(defun find-dispatcher (host)
116117
(or (find-dispatcher-go host) *default-dispatcher*))
117118

118-
(defun find-or-make-dispatcher (host)
119+
(defun find-or-make-dispatcher (host &rest args)
119120
(let ((host (force-byte-vector host)))
120121
(or (find-dispatcher-go host)
121-
(let ((it (make-dispatcher :canonical-name host)))
122+
(let ((it (apply 'make-dispatcher :canonical-name host args)))
122123
(push (cons host it) *dispatchers*)
123124
it))))
124125

0 commit comments

Comments
 (0)