Commit graph

93 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
3865ee6a19 Fix get_hook function 2025-04-01 20:31:57 +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
Francesco Tomaselli
01624638b9
Merge pull request #102 from runofthemillgeek/fix/aspect-ratio-layout-shift
Fix layout shifts by preserving aspect-ratio at responsive sizes
2025-04-01 11:22:01 +02:00
Francesco Tomaselli
aed9e11824
Merge pull request #100 from runofthemillgeek/feat/og-image-partial
Add partial to customize og:image meta property
2025-04-01 11:20:48 +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
Francesco
f7bca2a764 Nowrap on pagination control 2025-03-19 19:30:01 +01:00
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
Sangeeth Sudheer
1cbe2066ec
Add partial to customize og:image meta property
Adds a new partial — `head/og-image.html` — that will render the value to be used
for `og:image` meta tags. The changes preserve the existing Hugo OpenGraph template's
behavior of checking and using the frontmatter or specific format of image names
as the `og:image` but if that doesn't work, it will delegate to the default partial which
uses `assets/images/og-image.{ext}` as the image.

This partial can be overriden to allow dynamic `og:image` URLs via a third-party service.

`_internal/opengraph.html` source is copied from Hugo to customize and support
this feature. Docs are updated to mention its usage.
2025-03-15 15:28:05 +05:30
Francesco Tomaselli
338510e751
Merge pull request #95 from runofthemillgeek/feat/breadcrumbs-customization
Add breadcrumbs config to hide current page and change home text
2025-03-14 21:06:32 +01:00
Marko Pejić
cae97de207
Fix error sentence in 404 page 2025-03-14 19:03:39 +01:00
Marko Pejić
d00e6e74b7
Fix home anchor tag spacing in 404 page 2025-03-14 19:01:16 +01:00
Sangeeth Sudheer
5bbe13fd43
Add breadcrumbs config to hide current page and change home text
Changes `breadcrumbs` config into an object to add customizations such as hiding current page and changing the text of
the home crumb.

By default, Typo will now show breadcrumbs. If breadcrumbs are enabled, the current default of showing the
current page crumb is preserved.

BREAKING CHANGE: `breadcrumbs` is now an object so existing `breadcrumbs = <true/false>` line in config needs to be changed.
2025-03-09 01:50:55 +05:30
Vasily Negrebetskiy
e9936b2d04 Added the old Twitter logo; added myself to the list of users 2025-03-07 13:44:56 +04:00
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
Francesco
51595b675d Cleanup breadcrumbs 2025-02-20 12:26:16 +01:00
Francesco
2082a9856f Update breadcrumbs style 2025-02-19 23:27:32 +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
Eduardo Flores
f277baeee1 fix: change property for name 2025-01-20 22:49:24 +01:00
Eduardo Flores
1696c8e99a add: fediverse meta tag 2025-01-20 22:40:24 +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
Francesco
2658baf36e Updated SVG icons 2025-01-06 23:47:31 +01:00
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
Francesco
8db773b556 Replace existing social icons definition with 3227 icons from Simple Icons 2024-11-27 21:40:02 +01:00
Juan Pablo Valencia
241671f2b9 move math block to baseof.html 2024-11-23 13:07:57 +02:00
Francesco Tomaselli
b9c6d8f3f7
Merge pull request #50 from jpvg10/translate-dates 2024-11-19 09:30:04 +01: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
Juan Pablo Valencia
3e7e8a78f6 adding support for translating dates 2024-11-18 20:10:31 +02: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
Francesco Tomaselli
a3a29cf470 Merge pull request #38 from runofthemillgeek/feat/link-main-title-to-home-page 2024-10-29 17:04:10 +01:00
Sangeeth Sudheer
a405e509ec Make header title a link to base URL (home page)
This is a common pattern found in many sites. I've also added styling
to remove the underline.
2024-10-28 14:10:57 +05:30
Sangeeth Sudheer
e1c2bf3313 Add support for Open Graph tags
This change will allow us to use the `images` property in frontmatter to display a cover image when sharing links to content in social media.

Open Graph support is provided out of the box with Hugo and is a one-line change. See docs: https://gohugo.io/templates/embedded/#open-graph
2024-10-28 11:33:32 +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
9f5d10de22 fix: set deaflt value of showFooter as true 2024-09-15 21:30:25 +05:30
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
Francesco Tomaselli
640a6c6956 Merge pull request #19 from vxnick/umami-for-production
Enable Umami analytics in Production only
2024-09-02 22:53:31 +02:00
Nick Savage
26232b2879 Enable Umami analytics in Production only
This will prevent analytics collection when testing locally.
2024-09-02 20:26:50 +01:00
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
6664932d9f Removed duplicated favicon.ico entry 2024-08-21 19:45:38 +02:00
Maahir Ur Rahman
8516f3dad6 feat(partials): allow setting of favicon path
chore(partials): add explicit links for all favicon types
2024-08-21 07:53:04 +07:00