Commit graph

50 commits

Author SHA1 Message Date
Francesco
73e65f2014 Add proper table rendering 2025-04-18 11:15:18 +02:00
Corné Haasjes
157c87d95e Put body_end above footer 2025-04-01 21:23:08 +02:00
Corné Haasjes
fe5d64c3c8 Add support for hooks in layouts/partials/hooks
Supported hooks:

- head_start
- head_end
- body_end
- footer_start
2025-04-01 19:38:31 +02:00
Sangeeth Sudheer
28ba526714
Fix layout shifts by preserving aspect-ratio at responsive sizes
Uses `aspect-ratio` property to constrain height and width of render image's container to allow responsive resizing
while maintaining the original aspect ratio and avoiding layout shifts.

Previously, even though `width` and `height` attributes were passed to the `img` element, Chrome (and probably others)
weren't reserving space for the image as expected because CSS `width`/`height` were both `auto`. At least one of them
needed to be a fixed value in order to maintain aspect ratio. Even with this change, it doesn't seem possible to
constrain both width and height on the same element at the same time — only one or the other works.

The change introduced makes the `img` element constrain width using `max-width` while the parent element constrain
height using `max-height` and `aspect-ratio`. This way, we can get responsive sizing on both axes while obeying the
constraints.
2025-03-26 07:39:37 +05:30
Sangeeth Sudheer
63df9dc335
Remove px from width/height img attributes in render-image hook
As per the spec, width/height attrs should be non-negative integers but
currently, they are being rendered with a `px` suffix. This change removes
the suffix which hopefully fixes any outstanding layout shifts.

References:
- https://html.spec.whatwg.org/multipage/embedded-content-other.html#dimension-attributes
2025-03-15 21:46:55 +05:30
Francesco Tomaselli
24dc86184b
Merge pull request #86 from OleMussmann/configure-mermaid-theme
Configure mermaid theme
2025-02-21 09:48:40 +01:00
Ole Mussmann
f5f04dba37 make mermaid themes configurable 2025-02-21 08:57:59 +01:00
Ole Mussmann
31ba2ee311 move inline JS to its own file 2025-02-20 20:59:17 +01:00
Ole Mussmann
11606533c9 fix disappearing header links 2025-02-02 18:17:24 +01:00
Ole Mussmann
8def1b3e59 fix mermaid diagram rendering
closes #69
2025-01-25 21:09:02 +01:00
Arun Mathai
6e5bc2f944 feat(copy-code): To allow user to copy contents within code block to clipboard
fix(ui): corrections told by tomfran

fix(ui): add more contrast to button.

fix(ui): loading js as deferred
2025-01-16 10:36:25 +05:30
Senophyx
1cf30d5ee1 Re-order if statement 2024-12-25 16:37:08 +07:00
Senophyx
b3c35f92dd Adding features to disable comment on specific post 2024-12-25 14:01:41 +07:00
Juan Pablo Valencia
241671f2b9 move math block to baseof.html 2024-11-23 13:07:57 +02:00
Francesco Tomaselli
5ee19e964c
Merge pull request #49 from runofthemillgeek/feat/heading-anchors
Add article heading anchors
2024-11-18 22:17:01 +01:00
Sangeeth Sudheer
47ba12bd1c
Add width and height attrs for local images
Image render hook now computes width/height of local images and adds
them as attributes. This patch also adds relevant CSS changes to prevent
stretchy images.

The main reason for this change is to avoid content shifts when images
load. Without providing width/height, browser doesn't have info to know
the aspect ratio to reserve some space until the image loads. With this
change, browser knows the intrinsic size and aspect-ratio to reserve
space and avoid content shifts in the page.

I believe this also fixes an issue I face in Safari where sometimes, an
image below the fold wouldn't load and thus have zero height because it
has loading="lazy".

To avoid images getting stretched and images overflow/filling the entire
screen when their intrinsic size is larger than the container size, I've
added some CSS. A configurable `max-height` is present which is used for
`figure img` elements. This especially helps when you have tall images
like mobile screenshots.
2024-11-17 17:21:02 +05:30
Sangeeth Sudheer
62972cfe7a
Add article heading anchors
Adds heading anchors (#) that appear when user hovers over headings in
articles. Clicking the anchor will scroll viewport until heading is
aligned to top and update the address bar with the hash. This makes it
easy to copy URLs that link to a specific heading in the article.
2024-11-17 16:27:18 +05:30
Sangeeth Sudheer
9f5b8e8059
Support relative paths in markdown images
Adds code from Hugo's built-in render-image hook
and modifies it slightly to support relative image
paths in markdown files.

Previously, we'd have to spell the absolute path
from root of the hugo site or make directories for
each individual post which is what Hugo recommend.
But this was very inefficient. This change allows
us to use editors like Obsidian, VSCode and have
them render the images correctly. It also supports
Hugo's page bundles for rendering images as a
result. Based on the order, I believe page bundles
are given priority so that works out.

i.e, if you have the following tree:

```
content
└── posts
   ├── _index.md
   ├── hello.md
   ├── images
   │  └── test.png
   └── test.png
```

You can now include images in `hello.md` in the
following ways:

```
![](test.png)
![](images/test.png)
![](./test.png)
![](./images/test.png)
```
2024-10-31 03:33:47 +05:30
Frank Villaro-Dixon
3dbee5b30d single view: markdownify summary
The summary is not markdownified, and thus we see the md content on the summary. This fixes that
2024-10-10 13:57:36 +02:00
simon-siggaard
7a7c68d177 add support for Mermaid diagrams 2024-09-20 14:41:06 +02:00
Arun
1ec074201b feat: show generic footer 2024-09-15 00:00:26 +05:30
Arun
f3000f6830 feat: Content License and Copyright holder as Footer 2024-09-14 00:40:35 +05:30
Nick Savage
a2e01c16dd Allow the date/time format on the single template to be overridden
Example:

```toml
[params]
singleDateFormat = '2 January 2006'
```
2024-09-02 19:57:55 +01:00
Francesco
ca10a42626 Not show breadcrumbs on homepage 2024-08-25 18:45:50 +02:00
Francesco
4d5bfd1f21 Uniform umami and comments inclusion 2024-08-13 19:29:25 +02:00
Francesco
d4f49c1c1a Pagination on single posts 2024-06-24 18:44:39 +02:00
Francesco
9c16b36696 Fixed tags display on posts 2024-06-02 11:44:18 +02:00
Francesco
604e4d7014 Image tags for sizing 2024-05-23 13:09:47 +02:00
Francesco
8fe6a2c12a Minor 2024-05-21 19:16:01 +02:00
Francesco
27e4286af3 Minor 2024-05-21 19:04:54 +02:00
Francesco
be85b2a784 Secondary color, tweaked width 2024-05-19 23:53:41 +02:00
Francesco
3f734ef24d Back to top button 2024-05-16 16:53:32 +02:00
Francesco
60282e5ada Minor 2024-05-11 23:29:14 +02:00
Francesco
5fd1088462 Breadcrumbs and tags 2024-05-11 22:48:26 +02:00
Francesco
bdee1c7d39 Merge branch 'main' into tmp 2024-05-11 22:14:41 +02:00
Francesco
c8cfbe555d Format 2024-05-11 22:13:47 +02:00
Francesco
1a5d0d46a1 Breadcrumbs tmp 2024-05-06 21:53:29 +02:00
nyms7
ca11f2c2bb feat: add giscus support 2024-05-06 15:19:49 +08:00
Francesco
0916af52ce Removed unnecessary homeIntro parameter, cleaned up layouts 2024-04-29 20:05:40 +02:00
Francesco
dcdf269fa1 Fixed overflow on Katex for mobile, woff2 for Literata 2024-04-29 00:05:22 +02:00
Francesco
5a8bc58198 Img lazy loading 2024-04-24 15:02:34 +02:00
Francesco
96d6b7d3f4 Removed unnecessary math.js load 2024-04-24 14:53:00 +02:00
Francesco
d956b1d02f Theme Update 2024-04-23 16:38:35 +02:00
Francesco
7f5067f611 Theme Update 2024-04-23 11:42:18 +02:00
Francesco
e5afd7abcf Theme Update 2024-04-22 19:50:12 +02:00
Francesco
303266ac28 Theme Update 2024-04-22 19:49:53 +02:00
Francesco
68f1baa172 Theme Update 2024-04-22 19:27:01 +02:00
Francesco
70a938a3a5 Theme Update 2024-04-22 17:12:48 +02:00
Francesco
ac65427931 Theme Update 2024-04-22 15:13:47 +02:00
Francesco
96c71b9bcb Initial 2024-04-22 13:19:56 +02:00