Skip to content

Commit

Permalink
feat: prep for pkgdown light switch
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Jun 28, 2024
1 parent fdbec4d commit cc80a2a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 52 deletions.
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ url: https://docs.ropensci.org/rotemplate

template:
package: rotemplate
light-switch: true

destination: docs

Expand Down
4 changes: 2 additions & 2 deletions inst/pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ template:
dropdown-link-hover-bg: "#64a4ef"
dropdown-link-hover-color: "white"
dropdown-link-active-color: "white"
headings-color: "#5c677e"
headings-color-light: "#484f5e"
navbar-brand-font-size: "2rem"
navbar-light-color: "white"
navbar-light-brand-color: "white"
Expand All @@ -23,7 +23,7 @@ template:
navbar:
structure:
left:
right: [search, intro, reference, articles, tutorials, news, github]
right: [search, intro, reference, articles, tutorials, news, github, lightswitch]


authors:
Expand Down
1 change: 0 additions & 1 deletion inst/pkgdown/extra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ main h1 img {
/* Because ProximaNova is very thin by default */
h1, h2, h3, h4, h5, h6 {
font-weight: 700;
color: #484f5e;
code {
font-weight: 500;
}
Expand Down
84 changes: 35 additions & 49 deletions inst/pkgdown/templates/head.html
Original file line number Diff line number Diff line change
@@ -1,75 +1,52 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{#opengraph}}
{{#description}}
<meta name="description" content="{{.}}" />
{{/description}}
{{/opengraph}}
<title>{{{pagetitle}}} • {{#site}}{{title}}{{/site}}</title>

<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon.png">
{{#has_favicons}}
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="{{#site}}{{root}}{{/site}}favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{#site}}{{root}}{{/site}}favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{{#site}}{{root}}{{/site}}apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="{{#site}}{{root}}{{/site}}apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="{{#site}}{{root}}{{/site}}apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="{{#site}}{{root}}{{/site}}apple-touch-icon-60x60.png" />
{{/has_favicons}}

{{#lightswitch}}<script src="{{#site}}{{root}}{{/site}}lightswitch.js"></script>{{/lightswitch}}
{{#uses_katex}}<script src="{{#site}}{{root}}{{/site}}katex-auto.js"></script>{{/uses_katex}}

{{{headdeps}}}
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />

<!-- bootstrap-toc -->
<script src="https://docs.ropensci.org/bootstrap-toc.min.js"></script>

<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>

<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>

<!-- search -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script>
{{#includes}}{{{head}}}{{/includes}}

<!-- pkgdown -->
<script src="{{#site}}{{root}}{{/site}}pkgdown.js"></script>

{{#extra}}
{{#css}}<link href="{{#site}}{{root}}{{/site}}extra.css" rel="stylesheet">{{/css}}
{{#js}}<script src="{{#site}}{{root}}{{/site}}extra.js"></script>{{/js}}
{{/extra}}

<meta property="og:title" content="{{{pagetitle}}}" />
{{#opengraph}}
{{#description}}
<meta property="og:description" content="{{.}}" />
<meta name="description" content="{{.}}" />
<meta property="og:description" content="{{.}}" />
{{/description}}
{{#image}}
<meta property="og:image" content="{{{src}}}" />
{{#alt}}
<meta property="og:image:alt" content="{{{.}}}" />
{{/alt}}
<meta property="og:image" content="{{{src}}}" />
{{#alt}}<meta property="og:image:alt" content="{{{.}}}" />{{/alt}}
{{/image}}
{{#twitter}}
{{#card}}
<meta name="twitter:card" content="{{{.}}}" />
{{/card}}
{{^card}}
<meta name="twitter:card" content="summary" />
{{/card}}
{{#creator}}
<meta name="twitter:creator" content="{{{.}}}" />
{{/creator}}
{{#site}}
<meta name="twitter:site" content="{{{.}}}" />
{{/site}}
{{#card}}<meta name="twitter:card" content="{{{.}}}" />{{/card}}
{{#creator}}<meta name="twitter:creator" content="{{{.}}}" />{{/creator}}
{{#site}}<meta name="twitter:site" content="{{{.}}}" />{{/site}}
{{/twitter}}
{{/opengraph}}

{{#yaml}}{{#noindex}}<meta name="robots" content="noindex" />{{/noindex}}{{/yaml}}
{{#development}}{{#in_dev}}<meta name="robots" content="noindex">{{/in_dev}}{{/development}}

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

{{#yaml}}{{#mathjax}}
<!-- Mathjax -->
<script type="text/javascript" id="MathJax-script" async
Expand All @@ -84,7 +61,6 @@
<noscript><p><img src="https://ropensci.matomo.cloud/matomo.php?idsite=1&amp;rec=1" style="border:0;" alt="" /></p></noscript>

<!-- End Matomo Code -->

{{#has_trailingslash}}
<!-- See https://stackoverflow.com/questions/1865837/whats-the-difference-between-window-location-and-window-location-replace — we use .replace() because we don't want the old url to appear in the browser history. -->
<script>
Expand All @@ -97,3 +73,13 @@
<!-- dependencies from examples -->
{{{dependencies}}}
{{/has_deps}}

{{#development}}{{#in_dev}}<meta name="robots" content="noindex">{{/in_dev}}{{/development}}

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->



0 comments on commit cc80a2a

Please sign in to comment.