Skip to content

Commit 9b07f3a

Browse files
committed
Add examples and introduction text to site
1 parent 72ff5a1 commit 9b07f3a

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

site/index.html

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
<title>The Duct Framework</title>
77
<link rel="preconnect" href="https://fonts.googleapis.com">
88
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Bebas+Neue&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap">
9+
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Bebas+Neue&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
1010
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
11+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/an-old-hope.min.css">
1112
<link rel="stylesheet" href="style.css">
13+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
14+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/languages/clojure.min.js"></script>
15+
<script>hljs.highlightAll();</script>
1216
</head>
1317
<body>
1418
<section class="hero">
@@ -22,5 +26,37 @@ <h1 class="title">
2226
</div>
2327
</div>
2428
</section>
29+
<section class="section">
30+
<div class="container is-max-tablet">
31+
<p class="is-size-5">
32+
Define the structure of your application as pure data in
33+
<strong>duct.edn</strong>.
34+
</p>
35+
<pre class="highlight"><code class="language-clojure">{:system
36+
{:duct.module/logging {}
37+
:duct.module/sql {:migrations #duct/include "db/migrations.edn"}
38+
:duct.module/web {:features #{:api}
39+
:routes [["/items" #ig/ref :demo.routes/items]]}
40+
:demo.routes/items {:db #ig/ref :duct.database/sql}}}</code></pre>
41+
<p class="is-size-6">
42+
<strong>Modules</strong> remove repetition while still allowing you
43+
to override any data they add.
44+
</p>
45+
<p class="is-size-6">
46+
Use <strong>functions</strong> and <strong>multimethods</strong> to
47+
define the behavior of your components.
48+
</p>
49+
<pre class="highlight"><code class="language-clojure">(ns demo.routes
50+
(:require [next.jdbc :as jdbc]))
51+
52+
(defn list-items [{:keys [db]}]
53+
(fn handler [_request]
54+
{:body {:results (jdbc/execute! db ["SELECT * FROM items"])}}))</code></pre>
55+
</div>
56+
57+
<div class="container has-text-centered">
58+
<a class="button is-primary is-rounded is-size-5" href="#">Read the docs</a>
59+
</div>
60+
</section>
2561
</body>
2662
</html>

site/style.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
font-family: "Barlow Condensed", sans-serif;
99
font-size: 26px;
1010
margin-top: -15px;
11+
margin-bottom: 0;
1112
}
1213

1314
.hero .title .logo {
@@ -19,6 +20,32 @@
1920
background: #292929;
2021
}
2122

23+
.is-size-5 {
24+
font-size: 1.35rem !important;
25+
}
26+
27+
.is-size-6 {
28+
font-size: 1.1rem !important;
29+
}
30+
31+
section.section {
32+
padding-top: 2rem;
33+
}
34+
2235
p {
23-
font-family: "Roboto", sans-serif;
36+
font-family: "Open Sans", sans-serif;
37+
margin-bottom: 1em;
38+
}
39+
40+
pre.highlight {
41+
padding: 0;
42+
margin: 1rem 0;
43+
background: transparent;
44+
margin-bottom: 20px;
45+
}
46+
47+
pre.highlight code {
48+
border-radius: 10px;
49+
background: #292929;
50+
padding: 15px;
2451
}

0 commit comments

Comments
 (0)