template (n.)
1670s, templet "horizontal piece under a girder or beam," probably from French templet "weaver's stretcher," diminutive of temple, which meant the same thing, from Latin templum "plank, rafter," also "consecrated place" (see temple (n.1)).

The meaning "pattern or gauge for shaping a piece of work" is first recorded 1819 in this form, earlier temple (1680s); the form was altered mid-19c., probably influenced by plate [Barnhart], but the pronunciation did not begin to shift until more recently (templet is still the primary entry for the word in Century Dictionary).