Skip to content

Commit

Permalink
Docs anchors (#3047)
Browse files Browse the repository at this point in the history
* Fix anchor id for 'Configuring Response Handling Examples' header

* Move heading anchor links to right of heading

To make sure they don't get cut off by weird browsers.

Also make the anchor link text the 'link' emoji which is more fun than
the hashtag.

* Keep anchor links on the left

* Make entire header the anchor link and show link emoji on hover

* Fix anchor link colour in dark mode

* Revert anchor link icon to hash character

---------

Co-authored-by: 1cg <[email protected]>
  • Loading branch information
yawaramin and 1cg authored Dec 23, 2024
1 parent 16933aa commit fb3b6a1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion www/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
insert_anchor_links = "left"
insert_anchor_links = "heading"
+++

<style type="text/css">
Expand Down
2 changes: 1 addition & 1 deletion www/content/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ The fields available for response handling configuration on entries in this arra
* `target` - A CSS selector specifying an alternative target for the response
* `swapOverride` - An alternative swap mechanism for the response

#### Configuring Response Handling Examples {#response-handling}
#### Configuring Response Handling Examples {#response-handling-examples}

As an example of how to use this configuration, consider a situation when a server-side framework responds with a
[`422 - Unprocessable Entity`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422) response when validation errors occur. By default, htmx will ignore the response,
Expand Down
1 change: 1 addition & 0 deletions www/content/essays/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = "Essays"
insert_anchor_links = "heading"
sort_by = "date"
insert_anchor_links = "left"
generate_feeds = true
Expand Down
2 changes: 1 addition & 1 deletion www/content/examples/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Examples"
insert_anchor_links = "left"
insert_anchor_links = "heading"
+++

## Server-side Integration Examples
Expand Down
2 changes: 1 addition & 1 deletion www/content/examples/move-before/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Experimental moveBefore() Support"
insert_anchor_links = "left"
insert_anchor_links = "heading"
+++

This page demonstrates the use of the experimental [`moveBefore()`](https://github.com/whatwg/dom/issues/1255) DOM
Expand Down
10 changes: 4 additions & 6 deletions www/themes/htmx-theme/static/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
--alertBackground: #161719;
--alertBorder: #41464b;
--alertShadow: rgba(0, 0, 0, 0.15);
--anchorColor: #e2dada;
--anchorColor: var(--midBlue);
--bodyBackground: #1f1f1f;
--footerBackground: #1a1d1e;
--midBlue: #5b96d5;
Expand Down Expand Up @@ -575,11 +575,9 @@ pre[class|="language"] {
color: lightgray;
}
.zola-anchor {
margin-left: -1.3rem;
margin-right: .3rem;
opacity: 40%;
color: var(--anchorColor);
}
.zola-anchor:hover {
opacity: 95%;

.zola-anchor:hover::after {
content: ' #';
}

0 comments on commit fb3b6a1

Please sign in to comment.