Comments (13)
Holy crap we did it! So great!!! 🎉
from climate-tech-handbook.
I'm checking this out. From initial observation it seems we just need to add a drawer button for mobile layout that displays the table of contents. Will update with further findings
from climate-tech-handbook.
Alright so a media query should fix this with a little custom js and css. Then I'll work on adding the drawer and onClick functionality for the toc menu
vs
from climate-tech-handbook.
We have liftoff! Need to implement drawer and nav functionality for it now
https://pictogrammers.com/library/mdi/
Also the second hamburger icon on the other side is kind of gross imo. Maybe someone has an idea for a better icon? @futuresoup
from climate-tech-handbook.
Making progress. I am looking for the css/js for .md-drawer and the .md-overlay so I don't recreate it. See if I can just copy the existing styles.
{{page.toc}} is showing thanks to the nav: permalink: true in the config
from climate-tech-handbook.
Wiki made for anyone who wants more insight: https://github.com/climate-tech-handbook/climate-tech-handbook/wiki/Customizing-MKDocs
Drawer is 95% of the way done outside of a minor bug I should have sorted in the next day or two.
BUG DETAILS
When programmatically navigating forward with <a>
tags the {{page.toc}}
updates normally with a popState() event. I was able to workaround most of the missed updates using a simple location.reload()
cheat. (This obviously isn't optimal, but for a static text based site it shouldn't cause issues)
So for example If you reference the image above and I click the main Climate Tech Handbook title it would not update the new table of contents for the page unless you refreshed first, this is where my cheat comes in.
I went home and the {{page.toc}} updates with my tocDrawer.js
script.
This workaround doesn't cover everything yet and here is what happens (it keeps the memory of the last updated {{page.toc}}
)
Clicking anything in the right side drawer doesn't update our {{page.toc}}
The <a>
tag here uses href=[".."]
so I thought adding all of the relative paths to my script and rediverting to the home page with a forced reload would work. But a popState()
event doesn't occur.
So figuring out what event is occurring and how to mitigate would be our fastest fix.
Best fix is to figure out how to control the update to {{page.toc}}
from climate-tech-handbook.
After looking more at meta tags I think I have a better approach.
We can create tags for each page's table of contents(TOC) and store them in the Frontmatter
And then just load that for each page's drawer. I believe this will prevent the need for unnecessary page refreshes.
Something similar to this
tocTags:
- Welcome
- Join the Movement
- Nav 3
- ... so on
Will experiment and hopefully have some final updates soon!
from climate-tech-handbook.
page-toc branch pushed to the handbook repo.
@futuresoup @alexmayberry @ArLough @connor-cs
Check it out and tell me what you think
If someone could tag Uliana too please!
from climate-tech-handbook.
@ArLough do you want to review and test Wes's code
from climate-tech-handbook.
Sure, I'll take a look 👍🏻
from climate-tech-handbook.
@bigolboyyo Overall it looks good to me!
The only thing is I feel like the TOC heading and items hug the left a little too much especially when viewing it in the iPhone SE dimension simulation on chrome. We may want to add more left padding. But, I'm open if people have other opinions on this
from climate-tech-handbook.
Found some bugs and determined that this will be on hold until we migrate to Docusaurus or Starlight
from climate-tech-handbook.
@mzhanggg how is this going? Are you taking a break with the project?
@dovid11564 is also happy to pick it up if you're too busy?
from climate-tech-handbook.
Related Issues (20)
- Call out box ("Admonitions") color fix - Question Box
- Alternative Refrigerant Page & content HOT 1
- Test hackmd.io as a potential writing and collaboration tool
- Mobile view for new design - fit items in the clock
- Homepage upgrade - new footer, cards, mobile view
- [EPIC] Update minicourse content
- Get Podcast Pagination working HOT 3
- Explore Notion API with our Data Magic Flask App
- Fix jump link to only scroll effect so it doesn't happen on page urls, only jump link urls HOT 1
- Fix broken links! HOT 1
- Implement React Icons in the Sidebar - potentially other parts of the site as well HOT 4
- Image captions HOT 1
- Swap out drop shadow for hero text on mobile, change to overlay
- Remove H3 headers from Table of Contents
- Make image cards fit 3 in a row on laptop
- Incorrect information showing on the Countdown Counter before loading correct info HOT 1
- Make a filter for image cards on the Sector Pages, so that solutions cards can be filtered
- Design image cards filter
- Add code to repo with documentation and workflow instructions
- Background on mobile changes from grey to white, make breakpoint CSS fix HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from climate-tech-handbook.