diff --git a/README.md b/README.md index c159efb..58f476c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ Contains everything needed to build the [Roc website](http://www.roc-lang.org/). Build with: ```sh cd website -roc ./build_website.roc +# --cache prevents reprocessing for things that have not changed +roc ./build_website.roc --cache # If you want a local deploy for development, do: npx http-server ./build -c-1 -p 8080 ``` diff --git a/website/build_website.roc b/website/build_website.roc index 71b6b5e..91a2fe8 100644 --- a/website/build_website.roc +++ b/website/build_website.roc @@ -136,19 +136,23 @@ build_with_cache! = |{}| last_build_millis = read_cache_millis!(cache_marker_path) |> Result.with_default(0i128) latest_content_millis = max_mtime_in_dirs_millis!(["content"]) |> Result.with_default(0i128) latest_public_millis = max_mtime_in_dirs_millis!(["public"]) |> Result.with_default(0i128) + static_site_gen_millis = + File.time_modified!("static_site_gen.roc")? + |> Utc.to_millis_since_epoch content_changed = latest_content_millis > last_build_millis public_changed = latest_public_millis > last_build_millis + static_site_gen_changed = static_site_gen_millis > last_build_millis - if content_changed || public_changed then + if content_changed || public_changed || static_site_gen_changed then # Copy public โ†’ build if public changed if public_changed then Cmd.exec!("cp", ["-r", "public/.", "build/"])? else {} - # Only run static site generation if content changed - if content_changed then + # Only run static site generation if content or generator changed + if content_changed || static_site_gen_changed then Cmd.exec!("roc", ["build", "--linker", "legacy", "static_site_gen.roc"])? Cmd.exec!("./static_site_gen", ["content", "build"])? @@ -157,11 +161,11 @@ build_with_cache! = |{}| write_builtins_redirects!({})? add_github_links_to_examples!({})? else - Stdout.line!("Content unchanged; skipping static site generation.")? + Stdout.line!("Content and static_site_gen.roc unchanged; skipping static site generation.")? write_cache_millis!(cache_marker_path)? else - Stdout.line!("No changes detected in content/ or public/ since last cached build; skipping site generation.")? + Stdout.line!("No changes detected in content/, public/, or static_site_gen.roc since last cached build; skipping site generation.")? Ok({}) diff --git a/website/content/donate.md b/website/content/donate.md index 5db0c3b..56d6323 100644 --- a/website/content/donate.md +++ b/website/content/donate.md @@ -11,4 +11,4 @@ All donations go through the [Roc Programming Language Foundation](/foundation), It also means that the foundation's tax filings are a [matter of public record](https://en.wikipedia.org/wiki/501(c)(3)_organization#Transparency), so you have real transparency into how your donations are advancing Roc! -If you would like your organization to become an official sponsor of Roc's development, please [DM Richard Feldman on Zulip](https://roc.zulipchat.com/#narrow/pm-with/281383-user281383). We'd love to talk to you! +If you would like your *organization* to become an official sponsor of Roc's development, please [DM Richard Feldman on Zulip](https://roc.zulipchat.com/#narrow/pm-with/281383-user281383). We'd love to talk to you! diff --git a/website/content/index.md b/website/content/index.md index 142b99a..54601d6 100644 --- a/website/content/index.md +++ b/website/content/index.md @@ -1,20 +1,44 @@
@@ -41,7 +65,7 @@