aboutsummaryrefslogtreecommitdiff
path: root/docs/src/app.ffi.mjs
blob: 3983f27044d908c8cd1cbef20b2ae2d431d1c6c6 (plain)
1
2
3
4
5
6
7
8
9
10
export function base() {
  return import.meta.env.BASE_URL;
}

export const fetch_post = (path, dispatch) => {
  fetch(`${import.meta.env.BASE_URL}page/${path.slice(1)}.md`)
    .then((res) => res.text())
    .then((content) => dispatch(content))
    .catch(console.error);
};