hugo-notice icon indicating copy to clipboard operation
hugo-notice copied to clipboard

Some questions

Open rea1shane opened this issue 11 months ago • 8 comments

Hi @martignoni . Thank you so much for solving my problem with this repository! Now I'd like to create a PR to make this project better, but there are a few questions I need to ask you about:

  1. Why is the notice.html minified, won't Hugo minify it automatically?

And some non-PR related questions:

  1. What is "Workaround markdownify inconsistency for single/multiple paragraphs"?
  2. How to make the shortcode work only on paragraphs, not in e.x. code blocks?

rea1shane avatar Mar 06 '24 03:03 rea1shane

Why is the notice.html minified, won't Hugo minify it automatically?

Hugo doesn't minify automatically, only if you ask for it (with --minify or by post-processing), see https://gohugo.io/commands/hugo/ and https://gohugo.io/hugo-pipes/minification/.

What is "Workaround markdownify inconsistency for single/multiple paragraphs"?

See https://github.com/gohugoio/hugo/issues/5975, e.g. https://github.com/gohugoio/hugo/issues/5975#issuecomment-494746975

How to make the shortcode work only on paragraphs, not in e.x. code blocks?

Don't know, but why? Just do not use it in code blocks (I probably don't see your use case).

martignoni avatar Mar 06 '24 07:03 martignoni

Don't know, but why? Just do not use it in code blocks (I probably don't see your use case).

This will prevent me from showing its syntax.

For example showing GitHub alerts syntax:

> [!NOTE]
> Useful information that users should know, even when skimming content.

In the paragraph looks like:

[!NOTE] Useful information that users should know, even when skimming content.

But when I showing shortcode syntax, it won't show the source code in the code block. Instead, it shows the rendered look.

rea1shane avatar Mar 06 '24 07:03 rea1shane

What does your hugo code looks like when doing this?

martignoni avatar Mar 06 '24 07:03 martignoni

What does your hugo code looks like when doing this?

image

source code:

## Test

```
{{< notice warning >}}
This is a warning notice. Be warned!
{{< /notice >}}
```

{{< notice warning >}}
This is a warning notice. Be warned!
{{< /notice >}}

rea1shane avatar Mar 06 '24 07:03 rea1shane

Hugo doesn't minify automatically, only if you ask for it (with --minify or by post-processing), see https://gohugo.io/commands/hugo/ and https://gohugo.io/hugo-pipes/minification/.

I have an opinion, would it be possible to not minify the files, but rather have the user minify them at build time (this is what now I do), as the source code is just too hard to read and develop.

rea1shane avatar Mar 06 '24 07:03 rea1shane

Would it be possible to not minify the files, but rather have the user minify them at build time

I think this makes sense. Please make a PR for it!

martignoni avatar Mar 06 '24 10:03 martignoni

What does your hugo code looks like when doing this?

Did you try this: https://github.com/gohugoio/hugo/issues/11054#issuecomment-1572295424?

martignoni avatar Mar 06 '24 10:03 martignoni

Would it be possible to not minify the files, but rather have the user minify them at build time

I think this makes sense. Please make a PR for it!

See https://github.com/martignoni/hugo-notice/pull/36

rea1shane avatar Mar 06 '24 16:03 rea1shane

Thank you for the PRs. I've finally had time to review them.

martignoni avatar May 24 '24 14:05 martignoni