{
  description = "Hugo static site development environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      let
        tagCheckPython = pkgs.python313.withPackages (ps: [
          ps.spacy
          ps.spacy-models.en_core_web_lg
        ]);
      in
      {
        devShells.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            hugo
            marksman  # Markdown LSP server
            nodePackages.prettier  # Format markdown and other files
            markdownlint-cli
            aspell
            aspellDicts.en
            fzf  # Interactive spell check and tag selection
            tagCheckPython  # Python + spaCy for semantic tag similarity checker

            # Image optimization tools (used by scripts/optimize-images.sh)
            perl538Packages.ImageExifTool  # EXIF metadata reading/stripping
            imagemagick                    # Resize, auto-orient, get dimensions
            libwebp                        # cwebp for WebP conversion
          ];

          shellHook = ''
            export ASPELL_CONF="dict-dir ${pkgs.aspellDicts.en}/lib/aspell"

            # Auto-install git hooks if not already installed
            if [ ! -L .git/hooks/pre-commit ]; then
              bash scripts/install_hooks.sh
            fi

            echo "Hugo development environment loaded"
            echo "Hugo version: $(hugo version)"
          '';
        };
      }
    );
}
