Commit 7c438c4
committed
feat(tags): slugify tag names
This change makes tags with spaces or special characters play nicely
with the Web. By default, tag display values will be converted to
`slugs` using [Slugify][slugify] when building permalinks.
The tag extension configuration has been extended to have a `:tags`
option with a map of display values to options (the only supported
option is `:slug`):
```elixir
config :tableau, Tableau.TagExtension,
tags: %{
"C++" => [slug: "c-plus-plus"],
}
```
This will be used instead of automatic slug conversion. Automatic slug
conversion can be configured in the main Tableau configuration with the
`:slug` keyword option, which is passed directly to [Slugify][slugify].
Other extension writers may use `Tableau.Extension.Common.slugify/2`.
[slugify]: https://hexdocs.pm/slugify/Slug.html
Resolves: #1601 parent 953145c commit 7c438c4
File tree
5 files changed
+100
-9
lines changed- lib
- tableau
- extensions
- test/tableau/extensions
5 files changed
+100
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
11 | 32 | | |
12 | 33 | | |
13 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
14 | 32 | | |
15 | 33 | | |
16 | 34 | | |
| |||
79 | 97 | | |
80 | 98 | | |
81 | 99 | | |
| 100 | + | |
| 101 | + | |
82 | 102 | | |
83 | 103 | | |
84 | 104 | | |
| |||
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
92 | | - | |
| 112 | + | |
| 113 | + | |
93 | 114 | | |
94 | 115 | | |
95 | 116 | | |
| |||
102 | 123 | | |
103 | 124 | | |
104 | 125 | | |
| 126 | + | |
105 | 127 | | |
106 | 128 | | |
107 | 129 | | |
| |||
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
| 140 | + | |
118 | 141 | | |
119 | 142 | | |
120 | 143 | | |
121 | 144 | | |
122 | | - | |
| 145 | + | |
| 146 | + | |
123 | 147 | | |
124 | | - | |
125 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
126 | 155 | | |
127 | 156 | | |
128 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
9 | 23 | | |
10 | 24 | | |
11 | 25 | | |
12 | 26 | | |
13 | 27 | | |
14 | 28 | | |
15 | | - | |
| 29 | + | |
| 30 | + | |
16 | 31 | | |
17 | 32 | | |
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
21 | 36 | | |
22 | | - | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
33 | 60 | | |
34 | 61 | | |
35 | 62 | | |
| |||
39 | 66 | | |
40 | 67 | | |
41 | 68 | | |
| 69 | + | |
| 70 | + | |
42 | 71 | | |
43 | 72 | | |
44 | 73 | | |
| |||
0 commit comments