Skip to content

Commit

Permalink
Update theme
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Mar 6, 2024
1 parent 6c5b008 commit 8899a61
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
39 changes: 39 additions & 0 deletions book/theme/head.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXW2P6CCF3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NXW2P6CCF3');
</script>

<script>
(function () {
// See these pages for details:
// https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
// https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics
let base = "https://doc.veryl-lang.org/book";
{{#if (eq language "en")}}
let canonical_href = `${base}/{{ path }}`;
{{else}}
let canonical_href = `${base}/{{ language }}/{{ path }}`;
{{/if}}
// mdbook gives us a string ending in ".md", we replace it with ".html":
canonical_href = canonical_href.slice(0, -"md".length) + "html";
if (canonical_href.endsWith("/index.html")) {
canonical_href = canonical_href.slice(0, -"index.html".length);
}
let link = document.createElement("link");
link.rel = "canonical";
link.href = canonical_href;
document.head.appendChild(link);
})()
</script>

<meta property="og:url" content="https://github.com/veryl-lang/veryl" />
<meta property="og:title" content="Veryl: A Modern Hardware Description Language" />
<meta property="og:description" content="Veryl is a hardware description language which is designed as a SystemVerilog alternative." />
<meta property="og:image" content="https://github.com/veryl-lang/veryl/raw/master/support/logo/veryl_ogp.png" />
18 changes: 0 additions & 18 deletions book/theme/index.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<!DOCTYPE HTML>
<html lang="{{ language }}" class="{{ default_theme }}" dir="{{ text_direction }}">
<head prefix="og: http://ogp.me/ns#">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXW2P6CCF3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NXW2P6CCF3');
</script>

<link rel="alternate" hreflang="en" href="https://doc.veryl-lang.org/book/" />
<link rel="alternate" hreflang="ja" href="https://doc.veryl-lang.org/book/ja/" />

<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>{{ title }}</title>
Expand All @@ -32,11 +19,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">

<meta property="og:url" content="https://github.com/veryl-lang/veryl" />
<meta property="og:title" content="Veryl: A Modern Hardware Description Language" />
<meta property="og:description" content="Veryl is a hardware description language which is designed as a SystemVerilog alternative." />
<meta property="og:image" content="https://github.com/veryl-lang/veryl/raw/master/support/logo/veryl_ogp.png" />

{{#if favicon_svg}}
<link rel="icon" href="{{ path_to_root }}favicon.svg">
{{/if}}
Expand Down

0 comments on commit 8899a61

Please sign in to comment.