Officially, this is 鄞山寺 (left). To the locals, it is simply the 鄧公廟. The deity in residence is actually 定光佛. 定光 and 鄧公 are pronounced the same in Hoklo. So there was no Mr Deng but who's counting. Hakka's own guardian 定光佛 was a high-priest-monk during the Song Dynasty. His original name was 鄭自嚴, a Hoklo who had spent a life-time ministering the 汀州 Hakkas.
This temple, first proposed by 張鳴岡, was built in 1822-23 by the Hakka residents of Danshui (with contribution from other Hakkas in northern Taiwan, particularly 三芝 and 石門), on a parcel of land donated by two Luo羅 brothers, also Hakka. Inside the complex, there was accommodation, known as 汀州會館 (Ting-Chow Meeting Place), for visiting Hakkas.
These Hakkas migrated from Western Fujian, 汀州鄞江. Presumably the Hakkas in Danshui spoke 汀州客家話. Dr George Leslie Mackay must have met and preached to some, yet after 20 years he had never mastered the Hakka language. In fact, he had decided not to learn it because he was convinced that the Hakkas would be assimilated into the general population and the language lost. He might have been right, but only in Danshui. No one seems to recall Hakka being spoken in town in recent years. Of course, when it comes to the mother tongue, all bets are off. The Hakka language elsewhere has survived more or less intact and is enjoying the same Peh-oe-ji revival as the Hoklo these days.
There also have been transient Hakkas. The 500 Hakka Hillmen who arrived in Danshui in September, 1884, did take a very active part in the battle of Fisherman's Wharf. Oddly, no casualties were ever reported. And whether the same 500 men later went on to fight the French in Keelung also remains unclear. It seems that the ones fighting in Danshui were recruited from San-shia area, whereas those in Keelung, from Hsin-Chu. There were probably free to join up in each other's camp anyway.
The Hakkas of course had settled in different parts of Taiwan. On the left is a map made by early Swiss missionaries (date unknown) showing where the Hakkas were (click to enlarge). Danshui was not among the major settlements, however.
It is unknown when the 汀州 Hakkas arrived in Danshui and in what number. Although, like most Hoklo families, the info would have been recorded in Hakka family and clan histories which are usually still accessible. Generically, all Hakkas were from 汀州. Most, however, moved on to other settlements in, e.g., Canton. 汀州 Hakkas were those who had chosen to stay.
In 1688, a Hakka infantry battalion (about 100 men) was dispatched from Guangdong to fight the last of the 明鄭Ming-Cheng (東寧王朝 - Koxinga et al) army in Taiwan. These soldiers stayed on after 4 years of service, who latter moved to Pintung and intermarried with the Pinpuhuan there. In 1721-2, the Hakkas sided with the Qing and had put down a large-scale revolt by the Hoklos. That had precipitated the lasting distrust and animosity. In 1737, large numbers of Hakkas from Guangdong arrived and settled in Miaoli. This was 50 years after the ban on Cantonese migration instituted after the Qing defeated the Ming-Cheng Dynasty. The victorious Qing general cum Ming-Cheng turncoat Shi-Lang施琅 deemed the Cantonese too rebellious to be allowed in. This ban also applied to the Hakkas.
Danshui had its share of ethnic (more accurately gang-related) conflicts during the Qing rule, but all amongst the Hoklo people themselves. The Hakkas had wisely stayed out and become invisible. The French invasion of Danshui actually put a stop to these bloody conflicts when the Hoklos suddenly realized that unity equaled survival.