blogdown + hugo, tabbed codeblock doesn't show up with theme tranquilpeak

337 views Asked by At

I use blogdown with hugo (theme tranquilpeak). When I add a tabbed codeblock in my .Rmd file, the codeblock doesn't show up as intended, it is shown as normal text. Any idea why?

2017-09-02-tabbed-codeblock.Rmd

---
title: tabbed-codeblock
author: 
date: "2017-09-02"
output: 
html_document: 
  keep_md: yes
---

### Testing tabbed codeblock

{{< tabbed-codeblock >}}
    <!-- tab js -->
    var test = 'test';
    <!-- endtab -->
    <!-- tab css -->
     .btn {
        color: red;
    }
    <!-- endtab -->
{{< /tabbed-codeblock >}}
1

There are 1 answers

0
Yihui Xie On BEST ANSWER

See Section 2.3.2 of the blogdown book:

Shortcodes are supposed to work in plain Markdown documents only. To use shortcodes in R Markdown instead of plain Markdown, you have to call the function blogdown::shortcode().

And please read the R help page of the function blogdown::shortcode() if it is not clear to you.