We extend unsteady thin aerofoil theory to model aerofoils with generalized chordwise porosity distributions. The analysis considers a Darcy-type porosity law where the seepage velocity through the aerofoil is linearly related to the local pressure jump across the aerofoil surface. Application of the Plemelj formulae yields a singular Fredholm--Volterra integral equation which does not admit an analytic solution. Accordingly, we develop a numerical solution scheme by expanding the bound vorticity distribution in terms of appropriate basis functions. Asymptotic analysis at the leading- and trailing-edges reveals that the appropriate basis functions are weighted Jacobi polynomials whose parameters are related to the porosity distribution. The Jacobi polynomial basis enables the construction of a numerical scheme that is accurate and rapid, in contrast to the standard choice of Chebyshev basis functions that are shown to be ill-posed in their application to porous aerofoils. The numerical scheme is demonstrated to remain valid when the porosity gradient has an interior discontinuity. Porous analogues to the classical Theodorsen and Sears functions are computed numerically, which show that an effect of trailing-edge porosity is to reduce the amount of vorticity shed into the wake, thereby reducing the magnitude of the circulatory lift. Results from the present analysis and its underpinning numerical framework aim to enable the unsteady aerodynamic assessment of design strategies using porosity, which has implications for noise-reducing aerofoil design and biologically-inspired flight.