I be curious to see a site that claims it's only based on the written letter rather than pronunciation. We clearly don't actually do it that way, and I can't think of exceptions; but like anything in English, there are probably exceptions I just can't think of.
I did some Googling too out of curiosity, and can find a bunch of sites that state things like this: "A long-standing rule that you might have learned along the way is to use
a before a word that begins with a consonant and
an before a word that begins with a vowel (a, e, i, o, u)." That article then goes on to say that it's not entirely correct and what matters is the sound. (
https://www.grammarbook.com/blog/effective-writing/a-or-an/)
So it seems like a bunch of folks remember being taught that way - that the spelling matters. I don't, personally, and remember learning it by sound (I think). Did you find a site that only states the "a before consonant, an before vowel" rule? Got a link?