contentEqualIgnoringModDate compares two file contents, treating the modDate frontmatter line as identical regardless of actual date value. Normalizes CRLF to LF before comparing so existing files with different line endings don't cause false mismatches.
(a, b []byte)
| 205 | // Normalizes CRLF to LF before comparing so existing files with different |
| 206 | // line endings don't cause false mismatches. |
| 207 | func contentEqualIgnoringModDate(a, b []byte) bool { |
| 208 | placeholder := []byte("modDate: PLACEHOLDER") |
| 209 | cr := []byte("\r\n") |
| 210 | lf := []byte("\n") |
| 211 | normA := bytes.ReplaceAll(modDatePattern.ReplaceAll(a, placeholder), cr, lf) |
| 212 | normB := bytes.ReplaceAll(modDatePattern.ReplaceAll(b, placeholder), cr, lf) |
| 213 | return bytes.Equal(normA, normB) |
| 214 | } |
| 215 | |
| 216 | const documentationTemplate = `--- |
| 217 | layout: src/layouts/Default.astro |
no outgoing calls
no test coverage detected