Skip to content

Commit

Permalink
Link to project documentation when it is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Mar 5, 2024
1 parent 156f55f commit 760b430
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ How to build a site:


```common-lisp
(ql:quickload :cl-plus-ssl-osx-fix)
(ql:quickload :coleslaw-cli)
(ql:quickload '(cl-plus-ssl-osx-fix coleslaw-cli github))
;; To make high a limit on API calls
(setf github:*token*
"ghp_*******")
Expand Down
13 changes: 12 additions & 1 deletion pages/projects.page
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Our projects
format: spinneret
;;;;;

(ql:quickload '(dexador)
(ql:quickload '(dexador str github)
:silent t)

(:p "Here are some projects we are making or helping to develop.")
Expand Down Expand Up @@ -172,10 +172,21 @@ Works nicely with Fukamachi's [Prove](https://github.com/fukamachi/prove) and [R
((markdown (text)
(with-output-to-string (s)
(3bmd:parse-string-and-print-to-stream text s)))
(guess-project-url (project-name)
(when (str:starts-with-p "40ants/" project-name)
(let ((possible-url (format nil "https://40ants.com/~A/"
(second (str:split "/" project-name)))))
(multiple-value-bind (result status-code)
(handler-bind ((dexador:http-request-failed #'continue))
(dex:get possible-url :connect-timeout 1 :read-timeout 1))
(when (= status-code 200)
possible-url)))))

(make-url (project)
(destructuring-bind (name &key url &allow-other-keys)
(uiop:ensure-list project)
(or url
(guess-project-url name)
(format nil "https://github.com/~A" name))))
(get-name (project)
(first (uiop:ensure-list project)))
Expand Down

0 comments on commit 760b430

Please sign in to comment.