aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-09-17 00:35:00 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-09-17 00:35:00 +0200
commitdebdf64ab44ee0d6c9d5248aca5ba667322e8cf5 (patch)
treeb1d90f88f15c3e654fa295db6f9e98bf69237fa2 /README
parentf36d927701d1561da53b46ee23a986c549cdb1b4 (diff)
README: Add a few nits
Diffstat (limited to 'README')
-rw-r--r--README4
1 files changed, 2 insertions, 2 deletions
diff --git a/README b/README
index b6303a8..3a4c9be 100644
--- a/README
+++ b/README
@@ -62,7 +62,7 @@ Where =router:router-mode= slots include:
=router:route= slots include a mini-DSL that specifies what URL part to block, redirect or invoke externally via a comparison type. Personally, I believe this is a bit more straightforward than having to fiddle around with complex regular expressions and it allows you to define many site behaviors within a single point. The following is a detailed description of all the available slots:
-- =redirect= :: can take a redirect URL simply as a string or as a cons of the form =(REDIRECT-URI . TYPES)=, where =TYPES= is a property list of the form =(TYPE . RULES)= that can currently only take =:path= for =TYPE=. =RULES= is an alist of the form =(REPLACEMENT-PATH ORIGINAL-PATHS)=, where =ORIGINAL-PATHS= is a single string or list of paths of the original URL which will be redirected to =REPLACEMENT-PATH=. If you want to redirect all paths except =ORIGINAL-PATHS= to =REPLACEMENT-PATH=, prefix this list with =not=. Alternatively, it can be given as a =router:redirect= object with the appropriate slots or as a function to compute an arbitrary redirect URL.
+- =redirect= :: can take a redirect URL simply as a string or as a cons of the form =(REDIRECT-URI . TYPES)=, where =TYPES= is a property list of the form =(TYPE . RULES)= that can currently only take =:path= for =TYPE=. =RULES= is an alist of the form =(REPLACEMENT-PATH . ORIGINAL-PATHS)=, where =ORIGINAL-PATHS= is a single string or list of paths of the original URL which will be redirected to =REPLACEMENT-PATH=. If you want to redirect all paths except =ORIGINAL-PATHS= to =REPLACEMENT-PATH=, prefix this list with =not=. Alternatively, it can be given as a =router:redirect= object with the appropriate slots or as a function to compute an arbitrary redirect URL.
- =blocklist= :: a property list of blocking conditions in the form of =(TYPE VALUE)=, where =TYPE= can be one of =:path= or =:host=, and =VALUE= is either another property list of the form =(TYPE PATHNAMES)=, where =TYPE= is either =:starts=, =:ends=, or =:contains= to denote the URL comparison and =PATHNAMES= is a simple string or a list of URL pathnames to draw the comparison against. You can also pass an integer as =VALUE= to indicate the number of URL /sections/ (e.g. =https://example.com/section1/section2=) to block in case the blocking condition value is not known. If =PATHNAMES= is prefixed with =not=, all paths will be blocked except for the specified list. Alternatively, a =router:blocklist= object can be supplied with the appropriate slots, or the value =t= can be passed to block all the routes for the defined triggers.
- =external= :: used to open resources externally. If it's a function, it takes a single parameter =REQUEST-DATA= and can invoke arbitrary Lisp forms within it. If provided as a string, it will run the specified command via =uiop:run-program= with the current URL as its argument in a =format=-like syntax.
- =original= :: the route's original hostname, which can be used for storage purposes (bookmarks, history, etc.) so that the original URL is recorded instead of the redirect's URL.
@@ -102,7 +102,7 @@ See below for some example =router:route= routes.
:blocklist '(:path (:contains (not "/comments"))))
#+end_src
- If you pass the =:original= slot to the =route=, you can wrap Nyxt internal methods like shown below, so that history entries get recorded with the original URL.
+ You can pass an =:original= slot to the =route=, so that if you wrap Nyxt internal methods like shown below, history entries will get recorded with the original URL, meaning an inverse redirection will be applied to figure out the original structure.
#+begin_src lisp
(defmethod nyxt:on-signal-load-finished :around