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

Project Bluebell: time for a site redesign! #741

Open
16 of 17 tasks
alexwlchan opened this issue Apr 5, 2024 · 3 comments
Open
16 of 17 tasks

Project Bluebell: time for a site redesign! #741

alexwlchan opened this issue Apr 5, 2024 · 3 comments

Comments

@alexwlchan
Copy link
Owner

alexwlchan commented Apr 5, 2024

This is a big ticket to cover a moderate redesign of the site and its content. Overall goals:

  • Incorporate TILs as a top-level idea
  • Simplify the number of pages I need to maintain and manage (/projects/ is very out-of-date!)
  • Simplify some of the codebase and build process
  • Make the build faster to run locally

I'll put details in individual PRs linked to this issue.

@alexwlchan
Copy link
Owner Author

For at least some of these changes, I want to make sure I'm not changing the output of the site. I've written a short Python script that compares two copies of the site and checks they're byte-for-byte identical:

import pathlib
import filecmp

import tqdm


def get_file_paths_under(root=".", *, suffix=""):
    """
    Generates the absolute paths to every matching file under ``root``.
    """
    root = pathlib.Path(root)

    if root.exists() and not root.is_dir():
        raise ValueError(f"Cannot find files under file: {root!r}")

    if not root.is_dir():
        raise FileNotFoundError(root)

    for dirpath, _, filenames in root.walk():
        for f in filenames:
            p = dirpath / f

            if p.is_file() and f.lower().endswith(suffix):
                yield p


for p in tqdm.tqdm(list(get_file_paths_under("_site.amber"))):
    new_p = pathlib.Path(str(p).replace("_site.amber", "_site"))

    if not new_p.exists():
        print(p)
        continue

    if not filecmp.cmp(p, new_p, shallow=False):
        print(p)

for p in tqdm.tqdm(list(get_file_paths_under("_site"))):
    old_p = pathlib.Path(str(p).replace("_site", "_site.amber"))

    if not old_p.exists():
        print(p)
        continue

@alexwlchan
Copy link
Owner Author

One thing I've discovered: the built-in smartify filter is pretty slow! I can make the site a lot faster by using that more judiciously (and maybe caching the output later?).

@alexwlchan
Copy link
Owner Author

I'm starting to simplify my CSS setup (see more notes in #743).

As a brief benchmark, the size of my current style.css file is 16,888 bytes.

This was referenced Apr 5, 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

No branches or pull requests

1 participant