feat: subheading with custom id generator logic

This commit is contained in:
coolnsx
2025-06-09 12:14:48 +05:30
parent e87d44fe97
commit 3c01957646
3 changed files with 11 additions and 5 deletions

View File

@@ -1 +1 @@
<a href="{{ href }}" class="text-blue-400">{{ text }}</a> <a rel="noopener" href="{{ href }}" class="text-blue-400">{{ text }}</a>

View File

@@ -1,4 +1,10 @@
{% set href = text
| regex_replace(pattern="[\\\/#%<>\[\]\(\)`\\^{}\|.]", rep="")
| regex_replace(pattern=" +", rep="-")
| lower
%}
<hr class="border-gray-700 my-4"> <hr class="border-gray-700 my-4">
<h3 class="text-3xl font-bold"> <a id="{{ href }}" class="text-3xl font-bold focus:outline-none focus:ring-0" href="#{{ href }}" aria-label="Anchor link for : {{ href }}">
{{ text }} {{ text | safe }}
</h3> </a>

View File

@@ -1,4 +1,4 @@
<div class="relative overflow-x-auto shadow-md sm:rounded-lg my-8"> <div class="relative overflow-x-auto shadow-md rounded-lg my-8">
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
<tr> <tr>