Skip to content

Commit fd17fd8

Browse files
prefer namespaces in src as most expected place
1 parent 0b881b1 commit fd17fd8

27 files changed

Lines changed: 68 additions & 40 deletions

File tree

.gitignore

Lines changed: 1 addition & 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/

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Clojure Civitas
22

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

55
An open effort to structure learning resources with meaningful connections.
66

77
⚡ No setup – Clone this repo, make a new namespace, start coding.
88

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

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

1314
🧠 Build shared knowledge – Your work becomes part of a community resource.
1415

@@ -26,11 +27,12 @@ See [About Clojure Civitas](https://clojurecivitas.github.io/about).
2627
Your perspective matters.
2728
Pull Requests invited, that's the point!
2829

29-
### Creating notebooks
30+
### Creating posts and pages
3031

31-
Add a Clojure namespace or markdown file in the [`/notebooks`](notebooks) folder.
32+
Add a Clojure namespace or markdown file in the [`/src`](src) folder.
3233

3334
Add metadata on your namespace to set the title, author, and tags.
35+
3436
```clojure
3537
^{:kindly/hide-code true ; don't show this code in the notebook
3638
:clay {:title "About Civitas Metadata"
@@ -59,7 +61,8 @@ unless a different image is listed in the metadata.
5961
:many-others ["see the examples" "creative uses" "visual variety"]}
6062
```
6163

62-
**Optional:** [Setup your editor with Clay shortcuts](https://scicloj.github.io/clay/#setup) to visualize the notebook as you write.
64+
**Optional:** [Setup your editor with Clay shortcuts](https://scicloj.github.io/clay/#setup) to visualize the notebook
65+
as you write.
6366

6467
**Optional:** Preview the final website.
6568

@@ -84,11 +87,13 @@ To create a pull request
8487
3. push the branch to your fork
8588
4. and then open a pull request on GitHub to propose merging your changes into the Civitas main branch.
8689

87-
Please contact [@timothypratley](https://github.com/timothypratley) if you are having any difficulty submitting a notebook.
90+
Please contact [@timothypratley](https://github.com/timothypratley) if you are having any difficulty submitting a
91+
notebook.
8892

8993
### See your page views
9094

91-
Publicly available [page view analytics](https://clojurecivitas.goatcounter.com/) indicate how widely your notebook is being shared.
95+
Publicly available [page view analytics](https://clojurecivitas.goatcounter.com/) indicate how widely your notebook is
96+
being shared.
9297

9398
### Building the database
9499

@@ -160,19 +165,18 @@ Differentiation between posts, pages, and presentations is by `type` metadata (a
160165

161166
### File system organization
162167

163-
| Directory | Description |
164-
|-------------|----------------------------------------------------------------------|
165-
| `src` | Code for building a website and database |
166-
| `notebooks` | Source root for notebooks (Clojure and Markdown), images, data files |
167-
| `site` | Static assets of the Quarto website |
168+
| Directory | Description |
169+
|-----------|----------------------------------------------------------------------|
170+
| `src` | Source root for notebooks (Clojure and Markdown), images, data files |
171+
| `site` | Static assets of the Quarto website |
168172

169-
Non-Clojure files in `notebooks` will be synced to `site`.
170-
Shared images can go in `images`, but prefer placing images and data files as siblings to your namespace under
171-
`notebooks`.
172-
All Clojure and Non-Clojure files in `notebooks` should go under a subdirectory,
173+
Non-Clojure files in `src` will be synced to `site`.
174+
Shared images can go in `src/images`,
175+
but prefer placing images and data files as siblings to your namespace under `src`.
176+
All files in `src` should go under a subdirectory,
173177
so that it is clear they are not part of the static configuration of `site`.
174-
When building the site, Clojure namespaces are built to markdown files under `site/{my/namespaced/notebook.qmd}`.
175-
Subdirectories of `site` are gitignored and considered temporary build artifacts, safe to clean up.
178+
Clojure namespaces are built to markdown files under `site/{my/namespaced/notebook.qmd}`.
179+
Subdirectories of `site` are git ignored and considered temporary build artifacts, safe to clean up.
176180
Quarto builds all the markdown into HTML in `_site` for preview and deploy.
177181
While developing, Clay uses `temp` to build and serve HTML files.
178182

clay.edn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{:base-target-path "temp"
2-
:base-source-path "notebooks"
3-
:subdirs-to-sync ["notebooks"]
2+
:base-source-path "src"
3+
:subdirs-to-sync ["src"]
44
:sync-as-subdirs false
55
:flatten-targets false
66
:remote-repo {:git-url "https://github.com/ClojureCivitas/clojurecivitas.github.io"

deps.edn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{:paths ["src" "notebooks"]
1+
{:paths ["src"]
22

33
:deps
44
{org.clojure/clojure {:mvn/version "1.12.0"}
@@ -22,7 +22,8 @@
2222
;; Run Clay in watch mode with `clojure -J-Dclojure.main.report=stderr -M:clay`
2323
:clay {:main-opts ["-m" "scicloj.clay.v2.main"]}
2424
;; When debugging libraries
25-
:local {:override-deps {org.scicloj/clay {:local/root "../clay"}}}
25+
:local {:override-deps {org.scicloj/clay {:local/root "../clay"}
26+
org.scicloj/kindly-advice {:local/root "../kindly-advice"}}}
2627
;; $ clojure -T:build test
2728
;; $ clojure -T:build ci
2829
:build {:deps {io.github.clojure/tools.build

src/civitas/metadata.clj

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
(defn source-path-for [{:keys [topics id] :as notebook}]
1212
{:pre [id (seq topics)]}
13-
(str (fs/path "notebooks"
13+
(str (fs/path "src"
1414
(str (symbol (first topics)))
1515
(str id ".md"))))
1616

@@ -35,22 +35,21 @@
3535
[:url {:optional true} :string]])
3636

3737
(def BlogPostFrontmatter
38-
(def BlogPostFrontmatter
39-
[:map {:closed true}
40-
[:title :string]
41-
[:authors {:optional true} [:vector Author]]
42-
[:author {:optional true} Author]
43-
[:image {:optional true} :string]
44-
[:draft {:optional true} :boolean]
45-
[:publish-date {:optional true} inst?]
46-
[:last-modified-date {:optional true} inst?]
47-
[:tags {:optional true} [:vector :string]]
48-
[:categories {:optional true} [:vector :string]]
49-
[:description {:optional true} :string]
50-
[:slug {:optional true} :string]
51-
[:canonical-url {:optional true} :string]
52-
[:keywords {:optional true} [:vector :string]]
53-
[:layout {:optional true} :string]]))
38+
[:map {:closed true}
39+
[:title :string]
40+
[:authors {:optional true} [:vector Author]]
41+
[:author {:optional true} Author]
42+
[:image {:optional true} :string]
43+
[:draft {:optional true} :boolean]
44+
[:publish-date {:optional true} inst?]
45+
[:last-modified-date {:optional true} inst?]
46+
[:tags {:optional true} [:vector :string]]
47+
[:categories {:optional true} [:vector :string]]
48+
[:description {:optional true} :string]
49+
[:slug {:optional true} :string]
50+
[:canonical-url {:optional true} :string]
51+
[:keywords {:optional true} [:vector :string]]
52+
[:layout {:optional true} :string]])
5453

5554
(def key-descriptions
5655
{:title "The title of the blog post. Essential for SEO and user understanding."
File renamed without changes.
File renamed without changes.
File renamed without changes.

notebooks/code_interview/beating/with_stupid_stuff/z-combinator.jpg renamed to src/code_interview/beating/with_stupid_stuff/z-combinator.jpg

File renamed without changes.

0 commit comments

Comments
 (0)