We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad69705 commit ba5fb69Copy full SHA for ba5fb69
packages/nimiq-vitepress-theme/src/components/NqHeadline.vue
@@ -24,10 +24,22 @@ const computedAlign = computed(() => {
24
return align
25
return frontmatter.value.layout === 'home' ? 'center' : 'left'
26
})
27
+
28
+const headingId = computed(() => {
29
+ if (!title.value)
30
+ return undefined
31
+ return title.value
32
+ .toLowerCase()
33
+ .replace(/[^\w\s-]/g, '')
34
+ .replace(/\s+/g, '-')
35
+ .replace(/-+/g, '-')
36
+ .trim()
37
+})
38
</script>
39
40
<template>
41
<div
42
+ :id="headingId"
43
flex="~ col" nq-component="headline"
44
:class="{ 'items-start': computedAlign === 'left',
45
'items-center': computedAlign === 'center',
0 commit comments