Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

[v1] notes for ssg rewrite #22

Open
swyxio opened this issue Mar 28, 2020 · 3 comments
Open

[v1] notes for ssg rewrite #22

swyxio opened this issue Mar 28, 2020 · 3 comments

Comments

@swyxio
Copy link
Owner

swyxio commented Mar 28, 2020

The primary way ssg will work:

  1. ReadConfig
    • Read in all plugins and markdown and site global info
    • Create plan to create indexes
  2. Refresh
    • Pull indexes, run thru all plugins, create desired manifest
    • Pull existing files/create old Manifest (skipped in DEV)
  3. Plan (skipped in DEV)
    • Diff desired vs old manifest
    • generate list of pages (and other files) to generate
  4. Build (in DEV - only build on demand)
    • Pull data slices
    • Generate HTML, JS, CSS and JSON
  5. PostBuild (n/a in DEV)
    • FullData => RSS
    • Serverside Redirects?

Concepts:

  • Site global info is readable anywhere. changing it forces complete rebuild.
  • We break up data fetching into (cheap) data index and (expensive) data slices. We memoize data slice calls and attach them to data Index in a FullData object, with which we can do final builds like for RSS.
  • ssg can generate pages, images, and misc files - we just call these "files"
  • plugins can:
    • contribute indexes
    • map from index they own to files
    • map from FullData index to files
    • map from indexes to new index? -> eg how to generate tags/categories

Features to design for:

  • shadowed/eject templates and webpack config
  • We want programmatic page creation
  • We want incremental builds
  • We want a nice dev mode
  • We want redirects -> clientside as well as serverside
  • We want typescript/postprocessing/postcss
  • We want RSS (dataslices)
  • we can stop and rerun any stages if misconfigured
  • REPL for data
  • Filesystem routing

nonfeatures

  • No js in main page - just has mount points for svelte
  • no clientside routing
  • no functions/api routes

===

https://github.com/sw-yx/ssg-prototype

@swyxio
Copy link
Owner Author

swyxio commented Apr 2, 2020

@swyxio
Copy link
Owner Author

swyxio commented May 15, 2020

@swyxio
Copy link
Owner Author

swyxio commented May 21, 2020

add remark autolink headings swyxio/swyxdotio#35 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant