Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showScrollToTop and minimum 200 characters #772

Closed
rasnes opened this issue Jan 7, 2024 · 2 comments · Fixed by #806
Closed

showScrollToTop and minimum 200 characters #772

rasnes opened this issue Jan 7, 2024 · 2 comments · Fixed by #806
Labels
bug Something isn't working stale This issue or pull request has not had any recent activity

Comments

@rasnes
Copy link

rasnes commented Jan 7, 2024

Issue description

Hi, thanks for a great theme! And great documentation, it was easy to get started with such thorough docs 🙇

To get started, I just created a dummy post with some random things, including some parts of the markdown.md document. The contents of the file are provided below.

As you can see, it is a pretty long (tall?) document, so I was expecting that the scrollToTop button would appear for this article. But no, I could not get it working and had a hard time debug why, in particular since this was my only long document.

In the end, I figured out why, and it is due to this clause of minimum 200 words required:

{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 200) }}

I suggest to either:

  1. Use some other logic for the minimum size of document to enable the scrollToTop button, as it seems number of words is to coarse. The document below might not have many words, but it is definitely long enough to benefit from that button IMO.
  2. Reduce the minimum number of words. I am not sure how much it would "hurt" if this button gets shown for shorter articles?
  3. Document here under footer.showScrollToTop that there is a minimum requirement for x words for the button to be shown in an article. That would have helped me a lot in this debugging :)

Start of my dummy document:


I am regular text. This is okay.

Heading H2

Here is some Go for ya.

package main

func main() {
    fmt.Println("Hello, World!")
}

Pictures are nice

But can I add them via reference tags? Nope, that doesn't work. Okay, I can use just as a convenience when writing, and then change to regular Markdown syntax on publishing.

UPDATE: all images needs to be moved into the static folder anyway, so some "post processing" before publishing would be required any way.

Alt text

A dog

Tables

Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.

Name Age
Bob 27
Alice 23

Inline Markdown within tables

Italics Bold Code
italics bold code

List Types

Ordered List

  1. First item
  2. Second item
  3. Third item

Unordered List

  • List item
  • Another item
  • And another item

Nested list

  • Fruit
    • Apple
    • Orange
    • Banana
  • Dairy
    • Milk
    • Cheese

Other Elements — abbr, sub, sup, kbd, mark

GIF is a bitmap image format.

H2O

Xn + Yn = Zn

Press CTRL+ALT+Delete to end the session.

Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.


End dummy document.

Theme version

v2.7.6

Hugo version

hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended darwin/arm64

Which browser rendering engines are you seeing the problem on?

WebKit (Safari)

URL to sample repository or website

No response

Hugo output or build error messages

No response

@rasnes rasnes added the bug Something isn't working label Jan 7, 2024
@Asiotusblog
Copy link

Or maybe an option to set it always on, it will be useful.

Copy link

This issue has been automatically marked as stale because it has not had any recent activity.
If you are still experiencing this issue, please review the issue history and add a reply with any requested and/or additional information in order to keep the issue open.
This issue will automatically close in 30 days if no further activity occurs.

@github-actions github-actions bot added the stale This issue or pull request has not had any recent activity label May 12, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale This issue or pull request has not had any recent activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants