Improve metadata
This commit is contained in:
parent
82b2371c34
commit
eff901319e
3 changed files with 18 additions and 7 deletions
|
@ -1 +1,2 @@
|
||||||
HP_ENV=
|
HP_ENV=
|
||||||
|
HP_URL=
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:import-from #:cl-dotenv
|
(:import-from #:cl-dotenv
|
||||||
#:load-env)
|
#:load-env)
|
||||||
(:export #:hp-env))
|
(:export #:hp-env
|
||||||
|
#:hp-url))
|
||||||
(in-package #:hp/env)
|
(in-package #:hp/env)
|
||||||
|
|
||||||
(load-env (merge-pathnames "./.env"))
|
(load-env (merge-pathnames "./.env"))
|
||||||
|
@ -12,3 +13,4 @@
|
||||||
(or (uiop:getenv ,var) "")))
|
(or (uiop:getenv ,var) "")))
|
||||||
|
|
||||||
(env-var hp-env "HP_ENV")
|
(env-var hp-env "HP_ENV")
|
||||||
|
(env-var hp-url "HP_URL")
|
||||||
|
|
|
@ -7,19 +7,22 @@
|
||||||
(:import-from #:hsx/element
|
(:import-from #:hsx/element
|
||||||
#:element)
|
#:element)
|
||||||
(:import-from #:hp/env
|
(:import-from #:hp/env
|
||||||
|
#:hp-url
|
||||||
#:hp-env))
|
#:hp-env))
|
||||||
(in-package #:hp/renderer)
|
(in-package #:hp/renderer)
|
||||||
|
|
||||||
(defun bust-cache (url)
|
(defun path->url (path)
|
||||||
(format nil "~a?v=~a" url #.(get-universal-time)))
|
(concatenate 'string
|
||||||
|
(hp-url)
|
||||||
|
(and (not (string= path "/")) path)))
|
||||||
|
|
||||||
(defparameter *metadata-template*
|
(defparameter *metadata-template*
|
||||||
(list :title (lambda (title)
|
(list :title (lambda (title) (format nil "~@[~a - ~]~a" title "skyizwhite.dev"))
|
||||||
(format nil "~@[~a - ~]~a" title "skyizwhite.dev"))
|
|
||||||
:description "The personal homepage of Akira Tempaku (paku) - projects, thoughts, and more."
|
:description "The personal homepage of Akira Tempaku (paku) - projects, thoughts, and more."
|
||||||
:og-url "https://skyizwhite.dev"
|
:canonical #'path->url
|
||||||
|
:og-url #'path->url
|
||||||
:og-type "website"
|
:og-type "website"
|
||||||
:og-image "https://skyizwhite.dev/img/og.jpg"
|
:og-image (path->url "/img/og.jpg")
|
||||||
:og-image-width 1024
|
:og-image-width 1024
|
||||||
:og-image-height 1024))
|
:og-image-height 1024))
|
||||||
|
|
||||||
|
@ -31,8 +34,12 @@
|
||||||
(funcall template value)
|
(funcall template value)
|
||||||
(or value template)))))
|
(or value template)))))
|
||||||
|
|
||||||
|
(defun bust-cache (url)
|
||||||
|
(format nil "~a?v=~a" url #.(get-universal-time)))
|
||||||
|
|
||||||
(defcomp ~document (&key title
|
(defcomp ~document (&key title
|
||||||
description
|
description
|
||||||
|
canonical
|
||||||
og-url
|
og-url
|
||||||
og-type
|
og-type
|
||||||
og-image
|
og-image
|
||||||
|
@ -54,6 +61,7 @@
|
||||||
(meta :property "og:image" :content og-image)
|
(meta :property "og:image" :content og-image)
|
||||||
(meta :property "og:image:width" :content og-image-width)
|
(meta :property "og:image:width" :content og-image-width)
|
||||||
(meta :property "og:image:height" :content og-image-height)
|
(meta :property "og:image:height" :content og-image-height)
|
||||||
|
(link :rel "canonical" :href canonical)
|
||||||
(link :rel "icon" :type "image/x-icon" :href "/img/favicon.ico")
|
(link :rel "icon" :type "image/x-icon" :href "/img/favicon.ico")
|
||||||
(link :rel "apple-touch-icon" :href "/img/favicon.ico")
|
(link :rel "apple-touch-icon" :href "/img/favicon.ico")
|
||||||
(link :rel "stylesheet" :href (bust-cache "/style/dist.css"))
|
(link :rel "stylesheet" :href (bust-cache "/style/dist.css"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue