diff --git a/config/_default/params.toml b/config/_default/params.toml index c7a8b8d4..344bf747 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -1,6 +1,10 @@ # Description for social sharing and search engines. description = "A collection of R packages for modeling and machine learning using tidyverse principles." +# Enable copy-to-clipboard for all code? +# Can also enable by content section in _index.md file +copy_clipboard = false + # Default image for social sharing and search engines. Place image in `static/images/` folder and specify image name here. sharing_image = "feature_summary_large_image.jpg" twitter_image = "feature_summary_large_image.jpg" diff --git a/content/learn/_index.md b/content/learn/_index.md index 8dbb371c..4505443c 100644 --- a/content/learn/_index.md +++ b/content/learn/_index.md @@ -2,6 +2,7 @@ title: Learn description: "Learn how to go farther with tidymodels in your modeling and machine learning projects." icon_attribution: "Icons made by [Becris](https://www.flaticon.com/authors/becris) from www.flaticon.com" +copy_clipboard: false --- After you know [what you need to get started](/start/) with tidymodels, you can learn more and go further. Find articles here to help you solve specific problems using the tidymodels framework. Articles are organized into four categories: diff --git a/content/start/_index.md b/content/start/_index.md index be4746ab..56cfe366 100644 --- a/content/start/_index.md +++ b/content/start/_index.md @@ -2,6 +2,7 @@ title: Get Started subtitle: Welcome! description: "What do you need to know to start using tidymodels? Learn what you need in 5 articles." +copy_clipboard: true --- Here, learn what you need to get started with tidymodels in five articles, starting with how to create a model and ending with a beginning-to-end modeling case study. After you are comfortable with these basics, you can [learn how to go farther with tidymodels](/learn/). diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html index dc4d47a7..63d26510 100644 --- a/layouts/partials/head_custom.html +++ b/layouts/partials/head_custom.html @@ -1,6 +1,15 @@ +{{ $clipboard_site := $.Site.Params.copy_clipboard }} +{{ $page := . }} + + +{{ with $page.FirstSection }} + {{ if or (.Params.Copy_clipboard) ($clipboard_site) }} + + {{ end }} +{{ end }}