feat: Improve sharing of posts

  - If there's a feature image, it will be unfurled instead of the
    200ok logo
  - Add `og:description` metadata
parent 28f143d0
Pipeline #5132 passed with stage
in 1 minute and 43 seconds
......@@ -164,8 +164,6 @@ https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2F200ok.c
**** TODO Add language field to Post
- Schema: BlogPosting =inLanugage= or similar
*** TODO Sharing Improvement: If there's a picture in the post, don't share the 200ok logo
*** PROJECT Improve Technologies Page
**** TODO Some technologies in =technologies.yml= are only stubs
......@@ -181,10 +179,6 @@ https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2F200ok.c
*** TODO Add favicon through realfavicongenerator
*** TODO Style Opensource page and source in some logic from =project.clj=
*** DONE Eval how to do a 404 Page
- [X] Is it even possible without a back-end?
*** TODO When rendering the blog preview, properly close the missing tags
- [ ] Maybe use an HTML parser and close the tags
- [ ] Maybe use a completely different option for previews
......@@ -199,5 +193,8 @@ https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2F200ok.c
*** TODO on project page the technologies should not overflow the center area
*** TODO fix categories in feed
*** TODO [#C] weirdly, adding a rss-feed seems to have fixed the order of entries in the atom-feed, albeit the order in the rss-feed seems to be wrong. wtf
*** Archive
**** DONE Sharing Improvement: If there's a picture in the post, don't share the 200ok logo
**** DONE Eval how to do a 404 Page
- [X] Is it even possible without a back-end?
......@@ -147,9 +147,7 @@
[:meta {:itemprop "width"
:content "349"}]
[:meta {:itemprop "url"
:content (if (:featured-image post)
(:featured-image post)
(helper/logo-url))}]])
:content (helper/logo-url)}]])
(defn render-post
"Renders a post as :article"
......
(ns ok.post
(:require [ok.layout :as layout]))
(:require [ok.layout :as layout]
[ok.index :as index]))
(defn render [{global-meta :meta posts :entries post :entry}]
(layout/blog global-meta
post
[:main.single-post
[:div#content
(ok.index/render-post post)]]))
(index/render-post post)]]))
......@@ -5,9 +5,9 @@
(:description meta-data))
(defn image-url [post-meta]
;; TODO: This should be optimized by sourcing an image from the
;; post if there is one.
(helper/logo-url))
(if-let [featured-image-url (:featured-image post-meta)]
(helper/fully-qualifying-url featured-image-url)
(helper/logo-url)))
(defn meta-description-tag
"If the `meta-data` includes a `:description`, add the relevant <meta>
......@@ -24,6 +24,7 @@
(defn opengraph-meta [global-meta post-meta]
[[:meta {:property "og:title" :content (title global-meta post-meta)}]
[:meta {:property "og:type" :content "article"}]
[:meta {:property "og:description" :content (meta-description post-meta)}]
[:meta {:property "og:url" :content (helper/fully-qualifying-url (:permalink post-meta))}]
[:meta {:property "og:image" :content (image-url post-meta)}]])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment