Skip to content

Commit 0cba3d2

Browse files
committed
🤖 make headline formatter name generic
1 parent 59a754d commit 0cba3d2

File tree

11 files changed

+20
-16
lines changed

11 files changed

+20
-16
lines changed

‎_filters/display-category.js renamed to ‎_filters/capitaliser.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = function (rawName) {
77
['cat:nft', 'NFT'],
88
['cat:climate', 'Climate Crisis'],
99
['cat:web', 'World Wide Web'],
10+
['Around The Web', 'Around the Web'],
1011
])
1112

1213
return (

‎_src/_includes/layouts/digest.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<li>
4343
<a
4444
href="{{ category | categoryPermalink(categoryBase) }}"
45-
>{{ category | displayCategory }}</a>
45+
>{{ category | capitaliser }}</a>
4646
</li>
4747
{% endfor %}
4848
</ul>

‎_src/pages/around-the-web/category.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<main id="main" tabindex="-1">
3-
<archive-header :title="displayCategory(category)">
3+
<archive-header :title="capitaliser(category)">
44
<template #sub>
55
<p>
66
This is an automatically generated archive of
@@ -39,8 +39,9 @@ export default {
3939
eleventyComputed: {
4040
permalink: (data) =>
4141
this.categoryPermalink(data.category, data.categoryBase),
42+
title: (data) => this.capitaliser(data.category),
4243
pageTitle: (data) =>
43-
`${this.displayCategory(data.category)} | Around the Web`,
44+
`${this.capitaliser(data.category)} | Collections | Around the Web`,
4445
},
4546
}
4647
},

‎_src/pages/around-the-web/stats.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export default {
180180
)
181181
182182
enriched.push({
183-
name: this.displayCategory(category),
183+
name: this.capitaliser(category),
184184
href: this.categoryPermalink(category, this.categoryBase),
185185
count: posts.length,
186186
})

‎_src/pages/everything/category.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<main id="main" tabindex="-1">
3-
<archive-header :title="displayCategory(category)">
3+
<archive-header :title="capitaliser(category)">
44
<template #sub>
55
<p>
66
This is an automatically generated archive of
@@ -59,8 +59,7 @@ export default {
5959
eleventyComputed: {
6060
permalink: (data) =>
6161
this.categoryPermalink(data.category, data.categoryBase),
62-
pageTitle: (data) =>
63-
`${this.displayCategory(data.category)} | Everything`,
62+
pageTitle: (data) => `${this.capitaliser(data.category)} | Everything`,
6463
},
6564
}
6665
},

‎_src/pages/everything/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<ul role="list" class="inline-list">
4242
<li v-for="category in collections.categories" :key="category">
4343
<a :href="categoryPermalink(category, '/everything')">{{
44-
displayCategory(category)
44+
capitaliser(category)
4545
}}</a>
4646
</li>
4747
</ul>

‎_src/pages/notes/category.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<main id="main" tabindex="-1">
3-
<archive-header :title="displayCategory(category)">
3+
<archive-header :title="capitaliser(category)">
44
<template #sub>
55
<p>
66
This is an automatically generated archive of
@@ -37,7 +37,9 @@ export default {
3737
eleventyComputed: {
3838
permalink: (data) =>
3939
this.categoryPermalink(data.category, data.categoryBase),
40-
title: (data) => `${this.displayCategory(data.category)} | Notes`,
40+
title: (data) => this.capitaliser(data.category),
41+
pageTitle: (data) =>
42+
`${this.capitaliser(data.category)} | Collections | Notes`,
4143
},
4244
}
4345
},

‎_src/pages/notes/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<ul class="inline-list" role="list">
2525
<li v-for="collection in collections.noteCategories" :key="collection">
2626
<a :href="categoryPermalink(collection, categoryBase)">
27-
{{ displayCategory(collection) }}</a
27+
{{ capitaliser(collection) }}</a
2828
>
2929
</li>
3030
</ul>

‎_src/pages/text/blog/blog.11tydata.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060
return ''
6161
}
6262

63-
return `${this.displayCategory(categories[0])} — `
63+
return `${this.capitaliser(categories[0])} — `
6464
},
6565
},
6666
}

‎_src/pages/text/blog/how-i-built-around-the-web.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ But, this quickly became tedious. Even with only ten or so categories. Plus, I
276276

277277
And most of my mapping were basically a slug-like string to a title cased string. In other words: A boring, routine task. This is the thing computers excel at. (Sorry, computer.)
278278

279-
In the end, I decided to create a `displayCategory` filter, which does this.
279+
In the end, I decided to create a `capitaliser` filter, which does this.
280280

281281
```js
282282
const { startCase, camelCase } = require('lodash')
@@ -325,7 +325,7 @@ Here, the pieces I added earlier fell into place easily:
325325
{% for category in tags | getCategories | aToZ %}
326326
<li>
327327
<a href="{{ category | categoryPermalink(categoryBase) }}"
328-
>{{ category | displayCategory }}</a
328+
>{{ category | capitaliser }}</a
329329
>
330330
</li>
331331
{% endfor %}

‎_src/pages/text/category.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ export default {
5858
eleventyComputed: {
5959
permalink: (data) =>
6060
this.categoryPermalink(data.category, data.categoryBase),
61-
title: (data) => this.displayCategory(data.category),
62-
pageTitle: (data) => `${this.displayCategory(data.category)} | Text`,
61+
title: (data) => this.capitaliser(data.category),
62+
pageTitle: (data) =>
63+
`${this.capitaliser(data.category)} | Collections | Text`,
6364
},
6465
}
6566
},

0 commit comments

Comments
 (0)