You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add sidenote examples, related posts and giscus to distill posts (#3103)
This PR adds a few stylistic improvements to the distill-style blog
posts:
- Update distill blog post example to showcase sidenotes as an
alternative to styles in PR #3077
- Showcase equations in sidenotes (closes#1242)
- Add `overrides.js` to match footnotes and citation styles with global
theme styling
- Add "related posts" sections if enabled to distill style posts
- Add "giscus" section if enabled to distill style posts
https://github.com/user-attachments/assets/b19a9cd9-779d-4d89-a4fb-eb14fb384480
@@ -1334,6 +1334,65 @@ It does not interrupt the normal flow of `.l-body` sized text except on mobile s
1334
1334
1335
1335
---
1336
1336
1337
+
## Sidenotes
1338
+
1339
+
Distill supports sidenotes, which are like footnotes but placed in the margin of the page.
1340
+
They are useful for providing additional context or references without interrupting the flow of the main text.
1341
+
1342
+
There are two main ways to create a sidenote:
1343
+
1344
+
**Using the `<aside>` tag:**
1345
+
1346
+
The following code creates a sidenote with **_distill's styling_** in the margin:
1347
+
1348
+
```html
1349
+
<aside><p>This is a sidenote using aside tag.</p></aside>
1350
+
```
1351
+
1352
+
<aside><p> This is a sidenote using `<aside>` tag</p> </aside>
1353
+
1354
+
We can also add images to sidenotes (click on the image to zoom in for a larger version):
1355
+
{% raw %}
1356
+
1357
+
```html
1358
+
<aside>
1359
+
{% include figure.liquid loading="eager" path="assets/img/rhino.png" class="img-fluid rounded z-depth-1" zoomable=true %}
1360
+
<p>
1361
+
F.J. Cole, “The History of Albrecht Dürer’s Rhinoceros in Zoological Literature,” Science, Medicine, and History: Essays on the Evolution of
1362
+
Scientific Thought and Medical Practice (London, 1953), ed. E. Ashworth Underwood, 337-356. From page 71 of Edward Tufte’s Visual Explanations.
1363
+
</p>
1364
+
</aside>
1365
+
```
1366
+
1367
+
{% endraw %}
1368
+
1369
+
<aside>
1370
+
{% include figure.liquid loading="eager" path="assets/img/rhino.png" class="img-fluid rounded z-depth-1" zoomable=true %}
1371
+
<p>F.J. Cole, “The History of Albrecht Dürer’s Rhinoceros in Zoological Literature,” Science, Medicine, and History: Essays on the Evolution of Scientific Thought and Medical Practice (London, 1953), ed. E. Ashworth Underwood, 337-356. From page 71 of Edward Tufte’s Visual Explanations.</p>
1372
+
</aside>
1373
+
1374
+
Sidenotes can also contain equations and links:
1375
+
1376
+
In physics, mass–energy equivalence is the relationship between mass and energy in a system's rest frame. The two differ only by a multiplicative constant and the units of measurement.
1377
+
1378
+
<aside>
1379
+
<p>This principle is defined by Einstein's famous equation: $E = mc^2$ <ahref="https://en.wikipedia.org/wiki/Mass%E2%80%93energy_equivalence"target="_blank">(Source: Wikipedia)</a></p>
1380
+
</aside>
1381
+
1382
+
**Using the `l-gutter` class:**
1383
+
1384
+
The following code creates a sidenote with **_al-folio's styling_** in the margin:
1385
+
1386
+
```html
1387
+
<divclass="l-gutter"><p>This is a sidenote using l-gutter class.</p></div>
1388
+
```
1389
+
1390
+
<divclass="l-gutter">
1391
+
<p> This is a sidenote using `l-gutter` class. </p>
1392
+
</div>
1393
+
1394
+
---
1395
+
1337
1396
## Other Typography?
1338
1397
1339
1398
Emphasis, aka italics, with _asterisks_ (`*asterisks*`) or _underscores_ (`_underscores_`).
0 commit comments