|
67 | 67 | .prose td:last-child { |
68 | 68 | padding-right: 1.5rem; |
69 | 69 | } |
| 70 | + |
| 71 | +/* Alternating sections for markdown --- breaks */ |
| 72 | +.alternating-section:nth-child(odd) { |
| 73 | + background-color: var(--bg-secondary); |
| 74 | + padding: 1rem; |
| 75 | + margin: 1rem 0; |
| 76 | + border-radius: var(--border-radius); |
| 77 | +} |
| 78 | + |
| 79 | +.alternating-section:nth-child(even) { |
| 80 | + background-color: var(--bg-tertiary); |
| 81 | + padding: 1rem; |
| 82 | + margin: 1rem 0; |
| 83 | + border-radius: var(--border-radius); |
| 84 | +} |
70 | 85 | </style> |
71 | 86 |
|
72 | 87 | <div class="container mx-auto px-4 py-8 max-w-4xl"> |
@@ -113,6 +128,31 @@ <h3 class="text-lg font-semibold text-gray-900 mb-4">Tags</h3> |
113 | 128 | {% endif %} |
114 | 129 | </article> |
115 | 130 |
|
| 131 | + <script> |
| 132 | + document.addEventListener('DOMContentLoaded', function() { |
| 133 | + const contentDiv = document.querySelector('.prose.prose-lg.max-w-none'); |
| 134 | + if (!contentDiv) return; |
| 135 | + |
| 136 | + const html = contentDiv.innerHTML; |
| 137 | + // Split by hr tags, keeping the hr |
| 138 | + const parts = html.split(/(<hr[^>]*>)/); |
| 139 | + let newHtml = '<section class="alternating-section">'; |
| 140 | + let inSection = true; |
| 141 | + |
| 142 | + for (let part of parts) { |
| 143 | + if (part.match(/<hr[^>]*>/)) { |
| 144 | + // Close current section and start new one |
| 145 | + newHtml += '</section><section class="alternating-section">'; |
| 146 | + } else { |
| 147 | + newHtml += part; |
| 148 | + } |
| 149 | + } |
| 150 | + newHtml += '</section>'; |
| 151 | + |
| 152 | + contentDiv.innerHTML = newHtml; |
| 153 | + }); |
| 154 | + </script> |
| 155 | + |
116 | 156 | <!-- Navigation --> |
117 | 157 | <div class="mt-12 pt-8 border-t border-gray-200"> |
118 | 158 | <div class="flex justify-between items-center"> |
|
0 commit comments