Git Product home page Git Product logo

Comments (13)

futuresoup avatar futuresoup commented on May 24, 2024 1

Holy crap we did it! So great!!! 🎉

from climate-tech-handbook.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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

max-width: 959px
image

vs

max-width: 960px
image

from climate-tech-handbook.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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

image

from climate-tech-handbook.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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

image

image

from climate-tech-handbook.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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.

image


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.

image

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}}

image

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}}

image

from climate-tech-handbook.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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.

bigolboyyo avatar bigolboyyo commented on May 24, 2024

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.

futuresoup avatar futuresoup commented on May 24, 2024

@ArLough do you want to review and test Wes's code

from climate-tech-handbook.

ArLough avatar ArLough commented on May 24, 2024

Sure, I'll take a look 👍🏻

from climate-tech-handbook.

ArLough avatar ArLough commented on May 24, 2024

@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.

futuresoup avatar futuresoup commented on May 24, 2024

Found some bugs and determined that this will be on hold until we migrate to Docusaurus or Starlight

from climate-tech-handbook.

futuresoup avatar futuresoup commented on May 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.