I know two constructions for producing topologies on a function space:
$I$ is a set, $(X_i)_{i\in I}$ is a collection of topological spaces; in this case the initial topology w.r.t the projections $\pi_i:\prod_{k\in I} X_k\to X_i$ is called the (indexed) product topology.
$I,X$ are topological spaces; then we can form the set $C(I,X)$ of continuous functions $I\to X$ and topologize it with the compact-open topology.
The two definitions agree when $I$ is a set (treated as discrete for the purposes of (2)) and $X_i=X$ is constant, so that $C(I,X)=\prod_{i\in I}X$. Thus we can in some sense understand the index set $I$ as always being discrete in the product topology.
Is there a way for us to generalize these two constructions into one where the index set is topologized, but the fibers are not all the same? Fiber bundles seem to be similar, but seem to be more like the binary topological product $X\times Y$. Finally, I have also seen some claims to the effect that HoTT has formalized a topological space with these properties (since all their types act like topological spaces, and they happen to have a dependent type constructor), but I don't know what it would look like in elementary terms.
The first thing to do is to formalize what it means to have a "continuous" family $\{X_i\}_{i \in I}$ of spaces indexed by a topological space $I$. I think a fiber bundle, or more generally a fibration, is indeed the way to go: given a fibration $p : \mathbf{X} \to I$, denote the fibers as $X_i = p^{-1}(i)$, then you can in some sense view the $X_i$ as a continuous family of spaces over $I$. With a fiber bundle, if $i$ and $j$ lie in the same connected component of $I$, then $X_i$ and $X_j$ will be homeomorphic, while for a fibration they will merely be homotopy equivalent.
Now an element of the "continuous product" $\prod_{i \in I} X_i$ can be defined a section $s : I \to \mathbf{X}$ of $p$ (i.e. a continuous map s.t. $p \circ s = \operatorname{id}_I$). This gives an element $s(i) \in X_i$ for every $i \in I$ that varies continuously with $I$. The space of sections is more formally given by $$\Gamma(p) = \{ s \in X^I \mid p \circ s = \operatorname{id}_I \} \subset X^I,$$ topologized as a subspace of $X^I$ (which is itself endowed with the compact open topology).