quarto-dev / quarto-actions

GNU General Public License v2.0
228 stars 53 forks source link

Option for adding noindex tag in preview? #96

Open maelle opened 10 months ago

maelle commented 10 months ago

I wonder whether the render and publish actions could have a parameter for adding a noindex,nofollow meta tag in the website head (that one could activate for preview workflows). Sorry if I missed something equivalent.

cderv commented 10 months ago

Do you do that already locally using some quarto configuration ?

Just wondering if you have a current way to do that and you would like it to be automated ...

I am thinking your project profile you can be able to add this in your website. And then this is just a matter of using the action with the right profile.

maelle commented 10 months ago

I don't do that at all yet, I was exploring how I can do it.

I was thinking about includes https://quarto.org/docs/reference/formats/pdf.html#includes but I don't think any of them adds something to the head. :thinking:

cderv commented 10 months ago

this is doc for PDF. So probably not what you were looking.

You want in the <head> of Quarto website ?

include-in-header for format: html does not work ?

maelle commented 10 months ago

@cderv Thank you! What works:

format:
  html:
    include-in-header:
      - text: |
          <meta name="robots" content="noindex">

I was confused by the option name, because I think of head and header as two different things.

I used this solution, with project profiles, in https://github.com/cynkra/cynkrablog/pull/41

I still wonder whether it could be more "built-in" as an option of the action, since it might be a rather common need?

cderv commented 10 months ago

I was confused by the option name, because I think of head and header as two different things.

Name is based on Pandoc flag --include-in-header, and close to header-includes in R Markdown ecosystem.

So basically, this insert above the the body part, which in HTML means in <head>.

I used this solution, with project profiles

Looks good !

I still wonder whether it could be more "built-in" as an option of the action, since it might be a rather common need?

So it would mean for example

🤔