Skip to content

Commit

Permalink
fix: anchor links ( #68 )
Browse files Browse the repository at this point in the history
  • Loading branch information
not-matthias committed Jul 9, 2024
1 parent 6fc5abd commit 7448495
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 49 deletions.
1 change: 0 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ theme = "toggle" # light, dark, auto, toggle
comment = false
fancy_code = true
dynamic_note = true # a note that can be toggled
h_anchor_link = true
# mathjax = true
# mathjax_dollar_inline_enable = true

Expand Down
2 changes: 2 additions & 0 deletions content/posts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
paginate_by = 7
title = "Posts"
sort_by = "date"

insert_anchor_links = "heading"
+++
17 changes: 7 additions & 10 deletions content/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ tags=["blog"]

# Configuration

## Anchor Links

You can add anchor links by adding the following to your `_index.md`:
```toml
insert_anchor_links = "heading"
```

## Table of Contents (`toc`)

Enables or disables the table of contents for posts.
Expand Down Expand Up @@ -79,16 +86,6 @@ Allows for the creation of togglable note sections in your content.

When enabled, you can create expandable/collapsible note sections in your blog posts.

## Header Anchor Links (`h_anchor_link`)

Adds anchor links to headers for easy referencing.

- Type: Boolean
- Default: true
- Usage: `h_anchor_link = true`

This feature adds clickable links next to headers, allowing readers to easily share or bookmark specific sections of your posts.

## Menu

Defines the navigation menu items for your blog.
Expand Down
18 changes: 12 additions & 6 deletions sass/parts/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ a {
z-index: 1;
}

a.zola-anchor {
border-bottom: none;
}

a:hover {
background-color: var(--primary-color);
color: var(--hover-color);
Expand All @@ -72,8 +76,8 @@ time {

// change the line-through color
del {
text-decoration-color: var(--primary-color);
text-decoration-thickness: 3px;
text-decoration-color: var(--primary-color);
text-decoration-thickness: 3px;
}

@media all and (max-width: 640px) {
Expand Down Expand Up @@ -120,7 +124,9 @@ del {
}
}

.MathJax_Display, .MJXc-display, .MathJax_SVG_Display {
overflow-x: auto;
overflow-y: hidden;
}
.MathJax_Display,
.MJXc-display,
.MathJax_SVG_Display {
overflow-x: auto;
overflow-y: hidden;
}
26 changes: 0 additions & 26 deletions static/js/anchor.js

This file was deleted.

7 changes: 1 addition & 6 deletions templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@
{% if config.extra.toc | default(value=false) %}
<script src={{ get_url(path="js/toc.js") }}></script>
{% endif %}

{# H_tag anchor links#}
{% if config.extra.h_anchor_link | default(value=false) %}
<script src={{ get_url(path="js/anchor.js") }}></script>
{% endif %}


{# Dynamic Note #}
{% if config.extra.dynamic_note | default(value=false) %}
<script src={{ get_url(path="js/note.js") }}></script>
Expand Down

0 comments on commit 7448495

Please sign in to comment.