You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/building-blocks/routing.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,11 @@ title = "Routing"
3
3
weight = 15
4
4
+++
5
5
6
+
I prefer the easy-routes library than pure Hunchentoot to define
7
+
routes, as we did in the tutorial, so skip to its section below if you
8
+
want. However, it can only be benificial to know the built-in
9
+
Hunchentoot ways.
6
10
7
-
{{% notice info %}}
8
-
9
-
I prefer the easy-routes library than pure Hunchentoot to define routes, skip to its section if you want.
10
-
11
-
{{% /notice %}}
12
11
13
12
## Hunchentoot
14
13
@@ -171,7 +170,7 @@ You probably have nothing to do to get the value of those parameters: if you def
171
170
172
171
However, here's how to interact more with URL parameters. In particular, we can define the default type of a parameter: they are strings by default, but we can ask to receive an integer.
173
172
174
-
### Hunchentoot
173
+
### Hunchentoot URL parameters
175
174
176
175
First of all, note that we can access query parameters anytime with
177
176
@@ -192,15 +191,15 @@ We defined the following handler:
Copy file name to clipboardExpand all lines: content/building-blocks/templates.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ weight = 30
7
7
### Djula - HTML markup
8
8
9
9
[Djula](https://github.com/mmontone/djula) is a port of Python's
10
-
Django template engine to Common Lisp. It has [excellent documentation](https://mmontone.github.io/djula/doc/build/html/index.html).
10
+
Django template engine to Common Lisp. It has [excellent documentation](https://mmontone.github.io/djula/djula/).
11
11
12
12
Install it if you didn't already do it:
13
13
@@ -61,13 +61,13 @@ the most downloaded libraries of Quicklisp.
61
61
#### Djula filters
62
62
63
63
Filters allow to modify how a variable is displayed. Djula comes with
64
-
a good set of built-in filters and they are [well documented](https://mmontone.github.io/djula/doc/build/html/filters.html). They are not to be confused with [tags](https://mmontone.github.io/djula/doc/build/html/tags.html).
64
+
a good set of built-in filters and they are [well documented](https://mmontone.github.io/djula/djula/Filters.html#Filters). They are not to be confused with [tags](https://mmontone.github.io/djula/djula/Tags.html#Tags).
65
65
66
-
They look like this: `{{ name | lower }}`, where `lower` is an
66
+
They look like this: `{{ var | lower }}`, where `lower` is an
67
67
existing filter, which renders the text into lowercase.
68
68
69
-
Filters sometimes take arguments. For example: `{{ value | add:2 }}` calls
70
-
the `add` filter with arguments `value` and 2.
69
+
Filters sometimes take arguments. For example: `{{ var | add:2 }}` calls
70
+
the `add` filter with arguments `var` and 2.
71
71
72
72
Moreover, it is very easy to define custom filters. All we have to do
73
73
is to use the `def-filter` macro, which takes the variable as first
@@ -76,11 +76,11 @@ argument, and which can take more optional arguments.
76
76
Its general form is:
77
77
78
78
~~~lisp
79
-
(def-filter :myfilter-name (value arg) ;; arg is optional
79
+
(def-filter :myfilter-name (var arg) ;; arg is optional
80
80
(body))
81
81
~~~
82
82
83
-
and it is used like this: `{{ value | myfilter-name }}`.
83
+
and it is used like this: `{{ var | myfilter-name }}`.
84
84
85
85
Here's how the `add` filter is defined:
86
86
@@ -112,9 +112,10 @@ HTML5 generator. It looks like this:
112
112
(:footer ("Last login: ~A" *last-login*)))
113
113
~~~
114
114
115
-
The author finds it is easier to compose the HTML in separate
116
-
functions and macros than with the more famous cl-who. But it
117
-
has more features under it sleeves:
115
+
I find it is easier to compose the HTML than with the more famous
116
+
cl-who, but I personnally prefer to use HTML templates.
117
+
118
+
Spinneret has nice features under it sleeves:
118
119
119
120
- it warns on invalid tags and attributes
120
121
- it can automatically number headers, given their depth
0 commit comments