Skip to content

Commit 4160b76

Browse files
committed
Fix workflow and link in DSA
1 parent 5cc4832 commit 4160b76

6 files changed

Lines changed: 1189 additions & 134 deletions

File tree

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sync Logseq → Quartz Content & Build
1+
name: Sync Logseq → Quartz Content
22

33
on:
44
push:
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch: # allows manual trigger from GitHub Actions UI
1111

1212
jobs:
13-
sync-and-build:
13+
sync:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
contents: write
@@ -35,57 +35,14 @@ jobs:
3535
SOURCE="logseq-source/pages"
3636
DEST="quartz-site/content"
3737
38-
# Count files before sync
39-
before=$(find "$DEST" -name "*.md" ! -name "index.md" | wc -l)
38+
# Use rsync to sync files, deleting removed files, but excluding index.md
39+
rsync -av --delete --exclude="index.md" "$SOURCE"/ "$DEST"/
4040
41-
# Delete stale notes (keeps index.md intact)
42-
find "$DEST" -name "*.md" ! -name "index.md" -delete
43-
44-
# Copy notes from Admin branch to Web-live branch
45-
cp -r "$SOURCE"/. "$DEST"/
46-
47-
# Count files after sync
48-
after=$(find "$DEST" -name "*.md" ! -name "index.md" | wc -l)
49-
echo "files_before=$before" >> $GITHUB_OUTPUT
50-
echo "files_after=$after" >> $GITHUB_OUTPUT
51-
52-
- name: Setup Node.js
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: 22
56-
57-
- name: Cache node_modules
58-
id: cache-node-modules
59-
uses: actions/cache@v4
60-
with:
61-
path: quartz-site/node_modules
62-
key: ${{ runner.os }}-node-modules-${{ hashFiles('quartz-site/package-lock.json') }}
63-
64-
- name: Install dependencies
65-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
66-
run: |
67-
cd quartz-site
68-
npm ci
69-
70-
- name: Cache Quartz build cache
71-
uses: actions/cache@v4
72-
with:
73-
path: quartz-site/.quartz-cache
74-
key: ${{ runner.os }}-quartz-cache-${{ github.run_id }}-${{ github.run_attempt }}
75-
restore-keys: |
76-
${{ runner.os }}-quartz-cache-
77-
78-
- name: Build Quartz site
79-
run: |
80-
cd quartz-site
81-
npx quartz build
82-
83-
- name: Check for changes in content/ and public/
41+
- name: Check for changes in content/
8442
id: changes
8543
run: |
8644
cd quartz-site
8745
git add content/
88-
git add -f public/
8946
if git diff --staged --quiet; then
9047
echo "has_changes=false" >> $GITHUB_OUTPUT
9148
echo "No changes detected — skipping deploy."
@@ -103,20 +60,16 @@ jobs:
10360
git config user.email "github-actions[bot]@users.noreply.github.com"
10461
COMMIT_SHA=$(cd ../logseq-source && git rev-parse --short HEAD)
10562
106-
git add content/
107-
git add -f public/
10863
git commit -m "sync: ${{ steps.changes.outputs.changed_count }} file(s) updated from Logseq (Admin@$COMMIT_SHA)"
10964
git push origin Web-live
11065
11166
- name: Summary
11267
run: |
11368
if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then
114-
echo "### ✅ Sync & Build complete" >> $GITHUB_STEP_SUMMARY
115-
echo "- **Files before:** ${{ steps.sync.outputs.files_before }}" >> $GITHUB_STEP_SUMMARY
116-
echo "- **Files after:** ${{ steps.sync.outputs.files_after }}" >> $GITHUB_STEP_SUMMARY
117-
echo "- **Changed files (source & build):** ${{ steps.changes.outputs.changed_count }}" >> $GITHUB_STEP_SUMMARY
118-
echo "- Pre-built \`public/\` files pushed to **Web-live**. Vercel will deploy instantly." >> $GITHUB_STEP_SUMMARY
69+
echo "### ✅ Sync complete" >> $GITHUB_STEP_SUMMARY
70+
echo "- **Changed files:** ${{ steps.changes.outputs.changed_count }}" >> $GITHUB_STEP_SUMMARY
71+
echo "- Content pushed to **Web-live**. Hosting provider will trigger build." >> $GITHUB_STEP_SUMMARY
11972
else
12073
echo "### ⏭️ No changes" >> $GITHUB_STEP_SUMMARY
121-
echo "Content and build output were already up to date — no commit made." >> $GITHUB_STEP_SUMMARY
74+
echo "Content was already up to date — no commit made." >> $GITHUB_STEP_SUMMARY
12275
fi

‎pages/A Search Algorithm.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,13 +742,15 @@ displayTitle: A* Search Algorithm
742742
- IDA* is a memory-saving variant that combines depth-first search backtracking with heuristic evaluation, replacing the priority queue with a capped threshold limits.
743743
-
744744
- # Key Takeaways
745+
collapsed:: true
745746
- **Evaluation function** — $f(n) = g(n) + h(n)$ guides exploration toward the target.
746747
- **Optimal & Complete** — guarantees finding the shortest path if $h(n)$ is admissible (never overestimates) and consistent.
747748
- **Min-Heap driven** — open set selection is powered by priority queues for $O(\log V)$ node retrieval.
748749
- **Dijkstra as base** — Dijkstra is a special case of A* where the heuristic function $h(n) = 0$.
749750
- **Memory bound** — A* stores both open and closed sets in memory, which scales to $O(V)$ size.
750751
-
751752
- # More Learn
753+
collapsed:: true
752754
- ## GitHub & Webs
753755
- [Amit's Introduction to A* Pathfinding (Red Blob Games)](https://www.redblobgames.com/pathfinding/a-star/introduction.html)
754756
- [TheAlgorithms – A* Search (Python)](https://github.com/TheAlgorithms/Python/blob/master/searches/a_star.py)

0 commit comments

Comments
 (0)