-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: build toc and dashboard in hugo #1122
Conversation
...parse data from dom. build toc from data. an experiment in not building the toc client side. instead we build the site without a toc, parse the dom, build the data model, write the toc model to json in the hugo data dir, which then lets us build the toc from data. gross, but it means the toc isnt built in the client, which is worth it, as it explodes on mobile. License: MIT Signed-off-by: Oli Evans <[email protected]>
License: MIT Signed-off-by: Oli Evans <[email protected]>
@hugomrdias local testing shows we can have hugo render to disk in dev mode, parse the generated dom, write the toc model as JSON to the hugo data dir, and have hugo pick up the change, and rebuild the ToC 🎉 Next up i'm going to move the spec dashboard back to hugo but this time built from the toc model. Would be great to get your eyes on it in the mean time to double check this is not too outrageous. |
License: MIT Signed-off-by: Oli Evans <[email protected]>
use the data in toc.json to build out the dashboard, rather than doing it client side. License: MIT Signed-off-by: Oli Evans <[email protected]>
LGTM can you make it work with the diagrams watcher ? we should use only one watcher. |
License: MIT Signed-off-by: Oli Evans <[email protected]>
License: MIT Signed-off-by: Oli Evans <[email protected]>
License: MIT Signed-off-by: Oli Evans <[email protected]>
hidden toc sections are only actually hidden at runtime with js, can we build the toc already hidden at build time ? |
License: MIT Signed-off-by: Oli Evans <[email protected]>
Done!
Will do in separate PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build is not minifying the output html
@hugomrdias the npm run script The dev build probably doesn't minify the output, but I dont see a problem there. |
I know but some the preview url doesnt load the minified html |
- add watch.js to configure chokidar. - pass watcher to each tool via an exported `configureWatcher` method. - allow tools to be run as scripts or required as modules License: MIT Signed-off-by: Oli Evans <[email protected]>
License: MIT Signed-off-by: Oli Evans <[email protected]>
License: MIT Signed-off-by: Oli Evans <[email protected]>
* master: (27 commits) fix(content): filecoin VM interface update (#1056) fix(content): chainsync section update (#1123) fix(content): libraries section update (#1115) fix: show hugo errors on build docs: tidy up the readme, add toc. (#1141) fix: reword stacked drg missing link text" fix: fix broken refs and change warns to errors (#1139) fix: import meter css (#1140) feat: build toc and dashboard in hugo (#1122) feat: show wip and reliable in progress bar (#1137) content: fix typo plus remove definition of weight (#1138) fix: css for label style and dashboard link (#1136) feat: add symbol embeds and listing (#1126) v1.0.1 feat(tooling): release scripts v1.0.0 chore: update readme and package.json fix: update dns link fix: fix broken links fix(content): FIL VM System Actors Update (#1061) ...
Avoid building the ToC and the dashboard on the client side by parse data from dom and building the toc from data.
Generates a toc.json file in the hugo data dir, which is then used by the toc partial and the dashboard-spec shortcode.
example toc.json
TODO
fixes #1125
License: MIT
Signed-off-by: Oli Evans [email protected]