quarto-dev / quarto-dev/quarto-cli

Conditional metada for different profiles on a website

Open
#4,516 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement projects
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/4455

Originally posted by iuryt February 21, 2023
Hi,

I am trying to write a multilingual web blog using Quarto. I think this software is amazing, but I am having trouble in defining different titles and categories for the blog posts depending on the language. I am using Quarto 1.2.1 CLI.

The post is

---
title: Trying Quarto
categories: News
author: "Iury Simoes-Sousa"
date: "2023-02-20"
---


::: {.content-visible when-profile="english"}

This is the first post in a Quarto blog. Welcome!

![](https://quarto.org/quarto.png)

I plan to post here my thoughts about Science, Technology and Music.
:::


::: {.content-visible when-profile="portuguese"}

Este é o meu primeiro post no meu blog usando Quarto. Seja bem vindo!

![](https://quarto.org/quarto.png)

Eu pretendo postar aqui as minhas idéias e tutoriais sobre ciência, tecnologia e música.

:::

which returns the following for english

image

and the blog page is

---
title: "My Blog"
listing:
  contents: posts
  sort: "date desc"
  type: default
  categories: true
  sort-ui: false
  filter-ui: false
page-layout: full
title-block-banner: true
---

image

Well, if I use what is suggested in #2822

The post will be:

---
title:  |
    ::: {.content-visible when-profile="english"}
    Trying Quarto
    :::
    ::: {.content-visible when-profile="portuguese"}
    Testando o Quarto
    :::
categories: News
author: "Iury Simoes-Sousa"
date: "2023-02-20"
---


::: {.content-visible when-profile="english"}

This is the first post in a Quarto blog. Welcome!

![](https://quarto.org/quarto.png)

I plan to post here my thoughts about Science, Technology and Music.
:::


::: {.content-visible when-profile="portuguese"}

Este é o meu primeiro post no meu blog usando Quarto. Seja bem vindo!

![](https://quarto.org/quarto.png)

Eu pretendo postar aqui as minhas idéias e tutoriais sobre ciência, tecnologia e música.

:::

Which returns the following for english:

image

and it messes up with the Blog page

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked discussion #4455 and the referenced issue #2822, then reproduce the profile-specific title and category examples in the Quarto CLI. Done means conditional metadata works for multilingual blog posts without corrupting the blog listing page.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
content, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.