Skip to content
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

Migrate site to Astro #346

Merged
merged 66 commits into from
Nov 26, 2024
Merged

Migrate site to Astro #346

merged 66 commits into from
Nov 26, 2024

Conversation

lucperkins
Copy link
Member

@lucperkins lucperkins commented Jun 8, 2024

The iles framework has essentially been abandoned so it's time to re-platform.

TODOs:

  • Style the language selector components
  • Adjust font size in code samples
  • Markdown plugin for auto-rendering emoji (like :rocket:)
  • Fix font spacing in navbar links
  • Add titles to all code snippets
  • Make sure Posthog is working as expected
  • Fix external sources components on Learn More page
  • Styling for Nix store path component
  • Fix line thickness in admonition icons (and elsewhere if possible)
  • Link icons in "Related" and "External sources" section of concept pages
  • Cookie consent
  • Drawer toggle

Copy link

netlify bot commented Jun 8, 2024

Deploy Preview for zero-to-nix ready!

Name Link
🔨 Latest commit 29ee926
🔍 Latest deploy log https://app.netlify.com/sites/zero-to-nix/deploys/674514750dd55b00086529a9
😎 Deploy Preview https://deploy-preview-346--zero-to-nix.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@grahamc
Copy link
Member

grahamc commented Nov 20, 2024

The feedback widget needs a bit of touch-ups:

old:

CleanShot 2024-11-20 at 08 56 09@2x

new:

CleanShot 2024-11-20 at 08 55 35@2x

Note this is a problem on both sites, and I'm not real fussed, but I noticed it expands when typing:

CleanShot 2024-11-20 at 08 57 01

...and with a narrower viewport, it gets a bit weirder:

CleanShot 2024-11-20 at 08 59 20@2x

import { posthog } from "posthog-js";
import { useEffect, useState } from "react";

const CookieConsent = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing the cookie consent banner show up, but I am seeing event data going to PostHog.

@grahamc
Copy link
Member

grahamc commented Nov 22, 2024

This is looking good to me. I'm still not seeing the cookie consent popup, but beyond that, I don't see any obvious problems. I think we should move forward with a merge as soon as the consent window comes up.

@lucperkins
Copy link
Member Author

I cannot for the life of me get it to work, so this will probably be a while

@grahamc
Copy link
Member

grahamc commented Nov 22, 2024

Have you poked around this repo? https://github.com/jop-software/astro-cookieconsent/blob/main/src/main.ts

...poking around a bit I noticed a weird flash of content on every refresh, which turns out to be all the user-initiated things:

CleanShot 2024-11-22 at 00 06 21@2x

...maybe that's a clue?

@lucperkins
Copy link
Member Author

lucperkins commented Nov 22, 2024

@grahamc There isn't really a way out of the flash of unstyled content with dark mode and a fully static site. Vue + iles has some JS magic built into it that prevents that but we don't have access to that here.

As for the cookie consent plugin, I don't see a way to integrate that with Posthog.

Copy link
Member

@flexiondotorg flexiondotorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completed a side-by-side read-through, and the Astro version is spot on.

@grahamc
Copy link
Member

grahamc commented Nov 22, 2024

@lucperkins I think if you pin posthog to just before v1.136.0 our posthog conditions will work correctly.

@lucperkins
Copy link
Member Author

@grahamc Alas, that doesn't work either. I just cannot get posthog.has_opted_in_capturing() || posthog.has_opted_out_capturing() to be anything but true no matter what I do. Very frustrating. Gonna keep trying.

@grahamc
Copy link
Member

grahamc commented Nov 23, 2024

@lucperkins I think it is because posthog is getting its .js from us.i.posthog.com, instead of the bundled version we've pinned. Is that possible?

@lucperkins lucperkins enabled auto-merge November 26, 2024 00:15
@lucperkins lucperkins merged commit f5a663e into main Nov 26, 2024
6 checks passed
@lucperkins lucperkins deleted the astro-migration branch November 26, 2024 00:24
@lucperkins lucperkins mentioned this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants