Open northword opened 3 months ago
I've been thinking way long and barely giving up.
I believe one possible and easy way to implement this is to generate separate git-changelog-commits.data.json
into dist
right under each pages' parent directories, then use client side fetch to dynamically fetch through GET for the actual commits logs since commit logs generally wont be needed for SEO and compatible with MPA.
For notes only:
ref:https://github.com/vuejs/vitepress/issues/3001#issuecomment-1732237283
Not sure if attaching git logs to pages is possible with transformPageData
:
async transformPageData({ relativePath }) {
return { contributors: await getContributorsAt(relativePath) }
}
Splitting the data in Virtual Module down to the page level so that when a user visits the site, they don't need to download a very large Gitlog file (usually theme.hash.js) first, and therefore have higher performance.
Ref: https://github.com/nolebase/integrations/issues/223 , this was discussed in Discord and I am creating a ticket for this issue to track it, this is probably a long term plan and I don't have much ideas on how to implement it at the moment.
(may be?) In the short term, we could probably try to split the git data out of theme.hash.js so that only when the site content is updated (usually only the git data data is changed in theme.hash.js), the user doesn't have to pay for the unchanged parts of theme.hash.js. ref: rollup config: output.manualChunks.