Quote when using hugo shortcode #1657
Unanswered
linogaliana
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
Up to now I was using
quarto v0.97.3. I wanted to upgrade my version to latest (v1.0.37).I noticed a change of behavior in the quote parameter when using hugo shortcodes in newest quarto version that makes hugo fail to build websites. I use wowchemy academic theme but I think my problem is not related to the theme.
Example
In my
index.qmdfile, I was using a shortcode in the following fashion:See the complete example!
{{< tabs tabTotal="4" >}} {{% tab tabName="boto3" %}} Avec `boto3`, on créé d'abord un client puis on exécute des requêtes dessus. Pour initialiser un client, il suffit, en supposant que l'url du dépôt S3 est `"https://minio.lab.sspcloud.fr"`, de faire: ```python import boto3 s3 = boto3.client("s3",endpoint_url = "https://minio.lab.sspcloud.fr") ``` {{% /tab %}} {{% tab tabName="S3FS" %}} La logique est identique avec `s3fs`. Si on a des jetons d'accès à jour et dans les variables d'environnement adéquates: ```python import s3fs fs = s3fs.S3FileSystem( client_kwargs={'endpoint_url': 'https://minio.lab.sspcloud.fr'}) ``` {{% /tab %}} {{% tab tabName="Arrow" %}} La logique d'`Arrow` est proche de celle de `s3fs`. Seuls les noms d'arguments changent Si on a des jetons d'accès à jour et dans les variables d'environnement adéquates: ```python from pyarrow import fs s3 = fs.S3FileSystem(endpoint_override="http://"+"minio.lab.sspcloud.fr") ``` {{% /tab %}} {{% tab tabName="Snakemake" %}} La logique de `Snakemake` est, quant à elle, plus proche de celle de `boto3`. Seuls les noms d'arguments changent Si on a des jetons d'accès à jour et dans les variables d'environnement adéquates: ```python from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider S3 = S3RemoteProvider(host = "https://" + os.getenv('AWS_S3_ENDPOINT')) ``` {{% /tab %}} {{< /tabs >}}(I don't think you need to have the
tabs.htmlfile I use to understand the problem I am going to mention. It is really in the.qmd->.mdtransformation)Problem
After using
quarto index.qmd --to hugo, I end up withindex.mdthat is going to be used byhugo. However, with newest hugo,hugo buildfails (while it were not when using quarto v0.97.3 forindex.qmd->index.md)Problem seems to be on the way
quartowrites the shortcode (a conflict with quarto shortcode ?). The quote characters written on my.mdfile (“which is U+201C for instance) are not recognized by hugo as quote for shortcode parameters.What is written on
index.mdis{{< tabs tabTotal=“4” >}}while it should be
{{< tabs tabTotal="4" >}}If I replace incriminated quote parameters with an-adhoc solution (in my case
re.sub(r"(“|”)",'"',content)in a script that scans content of.mdfiles and overwrite them), hugo works fine.Note this does not happen when using
{{% %}}shortcode format (probably no conflict with hugo shortcodes) but sometimes I can't use themBeta Was this translation helpful? Give feedback.
All reactions