diff --git a/dist/index.css b/dist/index.css index 650f743..bd66a5f 100644 --- a/dist/index.css +++ b/dist/index.css @@ -84,6 +84,7 @@ --primary-text: #58151c; --secondary-text: #052c65; --link-hover-color: #555; + --link-hover-color-rgb: 85, 85, 85; } @media (prefers-color-scheme: dark) { @@ -98,6 +99,7 @@ --primary-text: #ffddb3; --secondary-text: #c6e2ff; --link-hover-color: #ddd; + --link-hover-color-rgb: 221, 221, 221; } } @@ -173,7 +175,7 @@ main.container { } .blog-link { - color: var(--link-color); + color: var(--text-color); } .blog-link:hover { diff --git a/dist/profile.webp b/dist/profile.webp index 3e74c2a..30d8cd9 100644 Binary files a/dist/profile.webp and b/dist/profile.webp differ diff --git a/shell.nix b/shell.nix index c0c9492..76aa2d1 100644 --- a/shell.nix +++ b/shell.nix @@ -16,10 +16,10 @@ pkgs.mkShell { fi source $VENV_PATH/bin/activate pip install -r requirements.txt + pip install watchdog python parser/md.py python generate.py - cd dist - python -m http.server 8000 + python watch.py ''; } diff --git a/watch.py b/watch.py new file mode 100644 index 0000000..4359215 --- /dev/null +++ b/watch.py @@ -0,0 +1,44 @@ +import time +import os +import subprocess +from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler + +class ChangeHandler(FileSystemEventHandler): + def on_modified(self, event): + if event.is_directory: + return + if any(event.src_path.endswith(ext) for ext in ['.md', '.py', '.html', '.css', '.js']): + print(f"File {event.src_path} has been modified") + self.regenerate() + + def on_created(self, event): + if event.is_directory: + return + if any(event.src_path.endswith(ext) for ext in ['.md', '.py', '.html', '.css', '.js']): + print(f"File {event.src_path} has been created") + self.regenerate() + + def regenerate(self): + print("Regenerating content...") + subprocess.run(["python", "parser/md.py"]) + subprocess.run(["python", "generate.py"]) + print("Content regenerated") + +if __name__ == "__main__": + event_handler = ChangeHandler() + observer = Observer() + # Watch both current directory and dist directory + observer.schedule(event_handler, "templates", recursive=True) + observer.start() + + http_server = subprocess.Popen(["python", "-m", "http.server", "8000", "--directory", "dist"]) + + try: + print("Watching for file changes... (Press Ctrl+C to stop)") + while True: + time.sleep(1) + except KeyboardInterrupt: + observer.stop() + http_server.terminate() + observer.join() \ No newline at end of file