Giter Site home page Giter Site logo

Comments (5)

colinwilson avatar colinwilson commented on September 2, 2024

Having trouble replicating this. Your example:

{{% alert icon="๐Ÿ…" context="success" %}} 
Markdown 
{{% /alert %}}

renders as below for me (Chrome/FireFox on Windows/MacOS):

2023-08-31 01_56_45-Window

Do you see any warnings, errors, 404's in Chrome's dev tools? Is the alert code nested inside another Shortcode?

from lotusdocs.

Nadine2016 avatar Nadine2016 commented on September 2, 2024

@colinwilson It looks like that the markdown alert is not assigned a css class, but HTML alerts are assigned one.

This is the example for the markdown alert
image

And this is the HTML alert output:
image

This shortcode is not used within a shortcode. It is placed right underneath the heading. I was checking the network tab in the Chrome developer tools, but I cannot see any errors. I am using Hugo 117 to build my site. I am not sure if it could be related to the Hugo version?

from lotusdocs.

colinwilson avatar colinwilson commented on September 2, 2024

Ah, Apologies!

This is due to a lack of documentation on my part!

The <!-- raw HTML omitted --> in your screenshot indicates a missing (required) parameter in your hugo.toml config.

Set unsafe = true under [markup.goldmark.renderer] in your hugo.toml config like below:

[markup.goldmark.renderer]
    unsafe = true
  • Without the unsafe = true setting, raw HTML in a Goldmark-flavored Markdown source file will be replaced with <!-- raw HTML omitted --> in the markdownifiedโ  destination file. This was introduced in Hugo v0.60.0 when Goldmark became the default library used for Markdown in Hugo. The markdown (%) alert shortcode won't render properly without this setting.

I'll document this ASAP and update the example hugo.toml in the repo.

from lotusdocs.

Nadine2016 avatar Nadine2016 commented on September 2, 2024

ah awesome! this worked like a charm. Thank you so much! :)

from lotusdocs.

colinwilson avatar colinwilson commented on September 2, 2024

You're welcome. ๐Ÿ‘

I'll close this once I've updated the docs and repo to reflect the config requirements for the theme.

from lotusdocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.