Skip to content

Commit 5310ca2

Browse files
authored
Merge branch 'main' into main
2 parents 2646f8f + d32f557 commit 5310ca2

152 files changed

Lines changed: 44718 additions & 1010 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
inputs:
7+
publish:
8+
description: "Deploy to Pages (manual runs only)"
9+
type: boolean
10+
default: false
11+
12+
name: Incremental Render and Publish
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
SITE_CACHE_REPO: ${{ secrets.SITE_CACHE_REPO }}
19+
SITE_CACHE_TOKEN: ${{ secrets.SITE_CACHE_TOKEN }}
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # need history to get mtimes
30+
31+
- name: Normalize source repo file mtimes to last commit
32+
run: |
33+
set -euo pipefail
34+
git ls-files -z | xargs -0 -I{} sh -c 'ts=$(git log -1 --format=%ct -- "{}" || true); if [ -n "$ts" ]; then touch -d "@$ts" "{}"; fi'
35+
36+
- name: Restore `site` from cache repo without overwriting source controlled files
37+
run: |
38+
set -euo pipefail
39+
git clone "https://x-access-token:${SITE_CACHE_TOKEN}@github.com/${SITE_CACHE_REPO}.git" /tmp/site-cache
40+
cd /tmp/site-cache
41+
git ls-files -z -- site/ | xargs -0 -I{} sh -c 'ts=$(git log -1 --format=%ct -- "{}" || true); if [ -n "$ts" ]; then touch -d "@$ts" "{}"; fi'
42+
cd -
43+
rsync -a --ignore-existing /tmp/site-cache/site/ site/ || true
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.10'
49+
- name: Install dependencies
50+
run: |
51+
pip install plotly kaleido
52+
53+
- name: Set up Java
54+
uses: actions/setup-java@v4
55+
with:
56+
distribution: 'temurin'
57+
java-version: '21'
58+
59+
- name: Set up Clojure
60+
uses: DeLaGuardo/setup-clojure@main
61+
with:
62+
cli: 'latest'
63+
64+
- name: Cache clojure dependencies
65+
uses: actions/cache@v3
66+
with:
67+
path: |
68+
~/.m2/repository
69+
~/.gitlibs
70+
~/.deps.clj
71+
key: cljdeps-${{ runner.os }}
72+
73+
- name: Detect changed Clojure sources
74+
id: changed_clj
75+
run: |
76+
set -euo pipefail
77+
changed=""
78+
if [ -f /tmp/site-cache/SOURCE_COMMIT ]; then
79+
source_commit=$(cat /tmp/site-cache/SOURCE_COMMIT)
80+
echo "Using source commit recorded in cache: $source_commit"
81+
changed=$(git diff --name-only --diff-filter=ACMR "$source_commit" HEAD -- 'src/**/*.clj' | tr '\n' ' ')
82+
fi
83+
if [ -z "$changed" ]; then
84+
echo "No changed Clojure sources detected"
85+
exit 0
86+
fi
87+
echo "Changed Clojure source files:" $changed
88+
echo "files=$changed" >> "$GITHUB_OUTPUT"
89+
90+
- name: Build notebooks
91+
run: clojure -M:clay -A:markdown ${{ steps.changed_clj.outputs.files }}
92+
93+
- name: Set up Quarto
94+
uses: quarto-dev/quarto-actions/setup@v2
95+
with:
96+
tinytex: true
97+
98+
- name: Render Quarto
99+
uses: quarto-dev/quarto-actions/render@v2
100+
with:
101+
path: site
102+
103+
- name: Upload artifact for Pages
104+
uses: actions/upload-pages-artifact@v3
105+
with:
106+
path: site/_site
107+
108+
- name: Push site to cache repo
109+
run: |
110+
set -euo pipefail
111+
source_commit=$(git rev-parse HEAD)
112+
rm -rf /tmp/site-cache/site
113+
cp -r site /tmp/site-cache/
114+
echo "$source_commit" > /tmp/site-cache/SOURCE_COMMIT
115+
cd /tmp/site-cache
116+
git config user.email "github-actions@github.com"
117+
git config user.name "GitHub Actions"
118+
git add -A
119+
if ! git diff --cached --quiet; then
120+
git commit -m "Cache update from build ${source_commit}"
121+
git checkout -b temp
122+
git push --force origin main
123+
else
124+
echo "No changes to cache."
125+
fi
126+
127+
deploy:
128+
needs: build
129+
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.ref == 'refs/heads/main')
130+
permissions:
131+
pages: write
132+
id-token: write
133+
environment:
134+
name: github-pages
135+
url: ${{ steps.deployment.outputs.page_url }}
136+
runs-on: ubuntu-latest
137+
steps:
138+
- name: Deploy to GitHub Pages
139+
id: deployment
140+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/temp
2-
/site/*/
2+
/site
33
.clj-kondo/
44
.quarto/
55
_site/
@@ -38,6 +38,8 @@ _site/
3838
**/password.edn
3939
/src/finance/portfolio_analysis/*.edn# Created by https://www.toptal.com/developers/gitignore/api/osx
4040

41+
!/site/_quarto.yml
42+
4143
# Edit at https://www.toptal.com/developers/gitignore?templates=osx
4244

4345
### OSX ###

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="src/images/civitas-icon.svg" alt="Civitas Icon" align="right">
44

5-
Clojure Civitas is a shared [blog](https://clojurecivitas.github.io/posts.html) space for your ideas and explorations.
5+
Clojure Civitas is a [shared blog space](https://clojurecivitas.org/posts.html) for your ideas and explorations.
66
Clojure Civitas makes it easy for you to publish Clojure ideas and explorations without the overhead of setting up a new project, blog, or repo.
77
Whether you're sketching out a quick experiment or writing a deeper post,
88
just fork this repo, add a namespace, write, commit and submit a pull request.
@@ -14,7 +14,7 @@ Think. Code. Share.
1414

1515
✍️ Write as you code – Capture notes, results, and ideas as you go as comments.
1616

17-
🚀 Easy to share – Create a Pull Request, once merged it appears on the [Clojure Civitas Website](https://clojurecivitas.github.io).
17+
🚀 Easy to share – Create a Pull Request, once merged it appears on the [Clojure Civitas Website](https://clojurecivitas.org).
1818

1919
🧠 Build shared knowledge – Your work becomes part of a community resource.
2020

@@ -26,7 +26,7 @@ Literate programming is fun.
2626
We want more people to experience it.
2727
Why markdown in code? We value reproducible artifacts.
2828

29-
See [Clojure Civitas Rationale](https://clojurecivitas.github.io/about#rationale) for more detail.
29+
See [Clojure Civitas Rationale](https://clojurecivitas.org/about#rationale) for more detail.
3030

3131
## Contributing
3232

@@ -138,7 +138,7 @@ clojure -M:clay -A:markdown
138138
quarto preview site
139139
```
140140

141-
(`bb site-preview` will run these two commands for you.)
141+
(`bb preview` will run these two commands for you.)
142142

143143
This will open a browser displaying the site locally.
144144

@@ -181,6 +181,8 @@ If you `git add -f site/my-ns/my-post.qmd`,
181181
it will prevent the source `src/my-ns/my-post.clj` file from executing in the publish process.
182182
Only you will run the code locally (where you have secrets and large files available).
183183

184+
If your notebook displays locally stored images, you will also need to commit these. Quarto puts them under `site/my-ns/my-post_files`.
185+
184186
See [Some notebooks should only be run locally](https://clojurecivitas.github.io/scicloj/clay/skip_if_unchanged_example.html) for more detail.
185187

186188
### Styling and other features
@@ -306,7 +308,21 @@ Goal: Minimize friction in authoring while ensuring publishable reproducibility.
306308

307309
## Deployment
308310

309-
See [.github/workflows/render-and-publish.yml](.github/workflows/render-and-publish.yml)
311+
The site is built and deployed using GitHub Actions with two workflows:
312+
313+
- **Full Build and Publish**: Triggered on pushes to `main`.
314+
Rebuilds all notebooks with Clay, renders the entire site with Quarto, and deploys to GitHub Pages.
315+
See [.github/workflows/render-and-publish.yml](.github/workflows/render-and-publish.yml).
316+
317+
- **Incremental Build**: Triggered on pushes to `main`.
318+
Uses a separate cache repository to enable partial rebuilds.
319+
Restores the cached site (containing rendered HTML and generated files) without overwriting source-controlled files in `site/`.
320+
Sets file mtimes of source and cache files based on the last commit so that Quarto will know if the cached file is newer than the source.
321+
Compares the current source commit to the last build source commit (stored in the cache) to detect changes in Clojure sources.
322+
Rebuilds affected notebooks with Clay (rebuilds all if no changes detected).
323+
Renders the site incrementally with Quarto.
324+
Replaces the cache with the new site, and writes the source commit in a file in the cache.
325+
See [.github/workflows/render-and-publish-incremental.yml](.github/workflows/render-and-publish-incremental.yml).
310326

311327
## License
312328

deps.edn

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
io.github.clojure/core.async.flow-monitor {:git/tag "v0.1.2"
1111
:git/url "https://github.com/clojure/core.async.flow-monitor"
1212
:git/sha "6248a5d"}
13+
criterium/criterium {:mvn/version "0.4.6"}
1314
metosin/malli {:mvn/version "0.19.1"}
1415
clj-fuzzy/clj-fuzzy {:mvn/version "0.4.1"}
1516
clj-thamil/clj-thamil {:mvn/version "0.2.0"}
16-
org.scicloj/clay {:mvn/version "2.0.2"}
17+
org.scicloj/clay {:mvn/version "2.0.5"}
1718
org.scicloj/kindly {:mvn/version "4-beta21"}
1819
thi.ng/geom {:mvn/version "1.0.1"}
1920
org.eclipse.elk/org.eclipse.elk.core {:mvn/version "0.10.0"}
@@ -25,20 +26,37 @@
2526
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
2627
io.github.alza-bitz/snowpark-clj {:git/url "https://github.com/alza-bitz/snowpark-clj.git"
2728
:git/sha "7856d9ca2080b188f9feec115ca709d3f54877b0"}
28-
org.lwjgl/lwjgl {:mvn/version "3.3.6"}
29-
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.3.6"}
30-
org.lwjgl/lwjgl-opengl {:mvn/version "3.3.6"}
31-
org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.3.6"}
32-
org.lwjgl/lwjgl-opengl$natives-windows {:mvn/version "3.3.6"}
33-
org.lwjgl/lwjgl-opengl$natives-macos {:mvn/version "3.3.6"}
34-
org.lwjgl/lwjgl-glfw {:mvn/version "3.3.6"}
35-
org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.3.6"}
36-
org.lwjgl/lwjgl-glfw$natives-windows {:mvn/version "3.3.6"}
37-
org.lwjgl/lwjgl-glfw$natives-macos {:mvn/version "3.3.6"}
38-
org.lwjgl/lwjgl-stb {:mvn/version "3.3.6"}
39-
org.lwjgl/lwjgl-stb$natives-linux {:mvn/version "3.3.6"}
40-
org.lwjgl/lwjgl-stb$natives-windows {:mvn/version "3.3.6"}
41-
org.lwjgl/lwjgl-stb$natives-macos {:mvn/version "3.3.6"}
29+
org.lwjgl/lwjgl {:mvn/version "3.4.0"}
30+
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.4.0"}
31+
org.lwjgl/lwjgl-opengl {:mvn/version "3.4.0"}
32+
org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.4.0"}
33+
org.lwjgl/lwjgl-opengl$natives-windows {:mvn/version "3.4.0"}
34+
org.lwjgl/lwjgl-opengl$natives-macos {:mvn/version "3.4.0"}
35+
org.lwjgl/lwjgl-glfw {:mvn/version "3.4.0"}
36+
org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.4.0"}
37+
org.lwjgl/lwjgl-glfw$natives-windows {:mvn/version "3.4.0"}
38+
org.lwjgl/lwjgl-glfw$natives-macos {:mvn/version "3.4.0"}
39+
org.lwjgl/lwjgl-stb {:mvn/version "3.4.0"}
40+
org.lwjgl/lwjgl-stb$natives-linux {:mvn/version "3.4.0"}
41+
org.lwjgl/lwjgl-stb$natives-windows {:mvn/version "3.4.0"}
42+
org.lwjgl/lwjgl-stb$natives-macos {:mvn/version "3.4.0"}
43+
comb/comb {:mvn/version "1.0.0"}
44+
midje/midje {:mvn/version "1.10.10"}
45+
dev.data-star.clojure/sdk {:mvn/version "1.0.0-RC4"}
46+
dev.data-star.clojure/http-kit {:mvn/version "1.0.0-RC4"}
47+
dev.data-star.clojure/brotli {:mvn/version "1.0.0-RC4"}
48+
dev.data-star.clojure/malli-schemas {:mvn/version "1.0.0-RC4"}
49+
dev.data-star.clojure/http-kit-malli-schemas {:mvn/version "1.0.0-RC4"}
50+
dev.data-star.clojure/ring-malli-schemas {:mvn/version "1.0.0-RC4"}
51+
52+
;; libraries for GIS work
53+
org.apache.sis.storage/sis-geotiff {:mvn/version "1.5"}
54+
org.apache.sis.core/sis-referencing {:mvn/version "1.5"}
55+
org.geotools/gt-geotiff {:mvn/version "31.2"}
56+
org.geotools/gt-main {:mvn/version "31.2"}
57+
org.geotools/gt-epsg-hsql {:mvn/version "31.2"}
58+
org.geotools/gt-geojson {:mvn/version "31.2"}
59+
4260
clj-http/clj-http {:mvn/version "3.13.1"}
4361

4462
generateme/fastmath {:mvn/version "3.0.0-alpha4"}
@@ -48,11 +66,18 @@
4866

4967
org.soulspace/qclojure {:mvn/version "0.22.0"}
5068
org.babashka/http-client {:mvn/version "0.4.22"}
51-
com.github.danielsz/bioscoop {:mvn/version "1.0.5"}
69+
io.github.babashka/sci.nrepl {:mvn/version "0.0.2"}
70+
com.github.danielsz/bioscoop {:mvn/version "1.0.5"
71+
:exclusions [ch.qos.logback/logback-classic]}
5272
yamlscript/core {:git/url "https://github.com/yaml/yamlscript"
5373
:git/sha "ed7adfbf90a39f379d5a7193bb2e4bdd7f0eecf8"
5474
:deps/root "core"}
55-
}
75+
com.hyperphor/multitool {:mvn/version "0.2.3"}
76+
datascript/datascript {:mvn/version "1.7.8"}
77+
io.github.pbaille/noon {:git/url "https://github.com/pbaille/noon.git"
78+
:git/sha "e63bb7c82671293c5610da6a02e3148a48ad71dd"}}
79+
80+
:mvn/repos {"osgeo" {:url "https://repo.osgeo.org/repository/release/"}}
5681

5782
:aliases
5883
{;; Build the site with `clojure -M:clay -A:markdown`

site/_quarto.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,59 @@ project:
44
- "*.cljs"
55
- "*.svg"
66
- "*.png"
7+
- "*.tif"
78

89
website:
910
title: "Clojure Civitas"
1011
favicon: "favicon.ico"
11-
site-url: "https://clojurecivitas.github.io"
12+
site-url: "https://clojurecivitas.org"
1213
image: "/images/civitas-icon.svg"
13-
draft-mode: unlinked
14+
draft-mode: visible
1415
open-graph: true
1516
navbar:
1617
logo: "/images/civitas-icon.svg"
1718
logo-alt: "Clojure Civitas Logo"
1819
right:
1920
- about.qmd
2021
- posts.qmd
22+
- drafts.qmd
2123
- civitas/authors.qmd
2224
- civitas/explorer.qmd
2325
- icon: github
2426
href: "https://github.com/ClojureCivitas/clojurecivitas.github.io"
2527
- icon: rss
2628
href: posts.xml
29+
sidebar:
30+
- id: emmy-fdg
31+
title: "Functional Differential Geometry in Emmy"
32+
logo: "https://raw.githubusercontent.com/mentat-collective/emmy/main/doc/img/logo.png"
33+
contents:
34+
- href: mentat_collective/emmy/fdg_prologue.qmd
35+
text: "Prologue"
36+
- section: "Chapters"
37+
contents:
38+
- href: mentat_collective/emmy/fdg_ch01.qmd
39+
text: "FDG Chapter 1"
40+
- href: mentat_collective/emmy/sicm_original_ch01.qmd
41+
text: "SICM Chapter 1"
42+
- href: mentat_collective/emmy/fdg_ch02.qmd
43+
text: "FDG Chapter 2"
44+
- href: mentat_collective/emmy/fdg_ch03.qmd
45+
text: "FDG Chapter 3"
46+
- href: mentat_collective/emmy/fdg_ch04.qmd
47+
text: "FDG Chapter 4"
48+
- href: mentat_collective/emmy/fdg_ch05.qmd
49+
text: "FDG Chapter 5"
50+
- href: mentat_collective/emmy/fdg_ch06.qmd
51+
text: "FDG Chapter 6"
52+
- href: mentat_collective/emmy/fdg_ch01_ys.qmd
53+
text: "FDG Ch01 Infix"
54+
- href: mentat_collective/emmy/sicm_ch01.qmd
55+
text: "SICM Ch01 Graphics"
56+
- href: mentat_collective/emmy/debroglie.qmd
57+
text: "deBroglie Waves"
58+
- href: mentat_collective/emmy/silcm_ch01.qmd
59+
text: "Lorentz Covariant"
2760

2861
format:
2962
html:
@@ -32,6 +65,7 @@ format:
3265
dark: [ darkly, brand, styles.scss, styles-dark.scss ]
3366
respect-user-color-scheme: true
3467
lightbox: true
68+
include-after-body: zulip_script.html
3569
include-in-header:
3670
- text: |
3771
<script data-goatcounter="https://clojurecivitas.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

0 commit comments

Comments
 (0)