|
42 | 42 | <link id="syntax_highlight" href="#" rel="stylesheet"> |
43 | 43 | #} |
44 | 44 |
|
| 45 | + {#- Custom variables prefixed with 'c_' -#} |
| 46 | + |
| 47 | + {%- if section -%} |
| 48 | + {%- set c_page_title = section.title -%} |
| 49 | + {%- elif page -%} |
| 50 | + {%- set c_page_title = page.title | replace(from='~', to=' ') -%} |
| 51 | + {%- else -%} |
| 52 | + {#- Includes 404.html, which has only a 'config' metadata; see __tera_context variable -#} |
| 53 | + {%- set c_page_title = config.title -%} |
| 54 | + {%- endif -%} |
| 55 | + |
| 56 | + {%- set c_page_summary = 'godot-rust' -%} |
| 57 | + {%- set c_page_image = get_url(path='godot-ferris-og-dark.png') -%} |
| 58 | + |
| 59 | + {# Page title #} |
45 | 60 | <title> |
46 | | - {% block title %} |
47 | | - {{ config.title }} |
48 | | - {% endblock title %} |
| 61 | + {%- block title -%} |
| 62 | + {{ c_page_title }} |
| 63 | + {%- endblock title -%} |
49 | 64 | </title> |
50 | | - </head> |
| 65 | + |
| 66 | + {# |
| 67 | + OpenGraph meta tags for social media preview |
| 68 | + Can be tested on https://www.opengraph.xyz or https://metatags.io. |
| 69 | + #} |
| 70 | + <!-- OpenGraph meta tags for social media preview --> |
| 71 | + |
| 72 | + <!-- Discord, Facebook, etc. --> |
| 73 | + <meta property="og:url" content="{{ get_url(path='.') | safe }}"> |
| 74 | + <meta property="og:type" content="website"> |
| 75 | + <meta property="og:title" content="{{ c_page_title }}"> |
| 76 | + <meta property="og:description" content="{{ c_page_summary }}"> |
| 77 | + <meta property="og:image" content="{{ c_page_image | safe }}"> |
| 78 | + |
| 79 | + <!-- Twitter Meta Tags --> |
| 80 | + <meta name="twitter:card" content="summary_large_image"> |
| 81 | + <meta property="twitter:domain" content="godot-rust.github.io"> |
| 82 | + <meta property="twitter:url" content="{{ get_url(path='.') | safe }}"> |
| 83 | + <meta name="twitter:title" content="{{ c_page_title }}"> |
| 84 | + <meta name="twitter:description" content="{{ c_page_summary }}"> |
| 85 | + <meta name="twitter:image" content="{{ c_page_image | safe }}"> |
| 86 | + |
| 87 | + </head> |
51 | 88 | <body class="body-background dark:body-background flex flex-col h-screen justify-between"> |
52 | 89 | <!----------------------------------------------------------> |
53 | 90 | <!------------------------- NAVBAR -------------------------> |
|
0 commit comments