Merge pull request 'docs: Add meta tags for link preview and fix js loading issue.' (#1531) from Qubasa/clan-core:Qubasa-main into main
This commit is contained in:
17
docs/main.py
17
docs/main.py
@@ -16,15 +16,26 @@ def define_env(env: Any) -> None:
|
|||||||
@env.macro
|
@env.macro
|
||||||
def asciinema(name: str) -> str:
|
def asciinema(name: str) -> str:
|
||||||
return f"""<div id="{name}">
|
return f"""<div id="{name}">
|
||||||
<script src="{asciinema_dir}/asciinema-player.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
AsciinemaPlayer.create('{video_dir + name}',
|
// Function to load the script and then create the Asciinema player
|
||||||
document.getElementById("{name}"), {{
|
function loadAsciinemaPlayer() {{
|
||||||
|
var script = document.createElement('script');
|
||||||
|
script.src = "{asciinema_dir}/asciinema-player.min.js";
|
||||||
|
script.onload = function() {{
|
||||||
|
AsciinemaPlayer.create('{video_dir + name}', document.getElementById("{name}"), {{
|
||||||
loop: true,
|
loop: true,
|
||||||
autoPlay: true,
|
autoPlay: true,
|
||||||
controls: false,
|
controls: false,
|
||||||
speed: 1.5,
|
speed: 1.5,
|
||||||
theme: "solarized-light"
|
theme: "solarized-light"
|
||||||
}});
|
}});
|
||||||
|
}};
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}}
|
||||||
|
|
||||||
|
// Load the Asciinema player script
|
||||||
|
loadAsciinemaPlayer();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="{asciinema_dir}/asciinema-player.css" />
|
||||||
</div>"""
|
</div>"""
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
site_name: Clan Docs
|
site_name: Clan Documentation
|
||||||
site_url: https://docs.clan.lol
|
site_url: https://docs.clan.lol
|
||||||
repo_url: https://git.clan.lol/clan/clan-core/
|
repo_url: https://git.clan.lol/clan/clan-core/
|
||||||
repo_name: clan-core
|
repo_name: clan-core
|
||||||
@@ -105,7 +105,8 @@ theme:
|
|||||||
- content.code.copy
|
- content.code.copy
|
||||||
- content.tabs.link
|
- content.tabs.link
|
||||||
icon:
|
icon:
|
||||||
repo: fontawesome/brands/git
|
repo: fontawesome/brands/git-alt
|
||||||
|
custom_dir: overrides
|
||||||
|
|
||||||
palette:
|
palette:
|
||||||
# Palette toggle for light mode
|
# Palette toggle for light mode
|
||||||
@@ -128,8 +129,6 @@ theme:
|
|||||||
|
|
||||||
extra_css:
|
extra_css:
|
||||||
- static/extra.css
|
- static/extra.css
|
||||||
- static/asciinema-player/custom-theme.css
|
|
||||||
- static/asciinema-player/asciinema-player.css
|
|
||||||
|
|
||||||
extra:
|
extra:
|
||||||
social:
|
social:
|
||||||
|
|||||||
12
docs/overrides/main.html
Normal file
12
docs/overrides/main.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block extrahead %}
|
||||||
|
<meta property="og:title" content="Clan - Documentation, Blog & Getting Started Guide" />
|
||||||
|
<meta property="og:description" content="Documentation for Clan. The peer-to-peer machine deployment framework." />
|
||||||
|
<meta property="og:image" content="https://clan.lol/static/dark-favicon/128x128.png" />
|
||||||
|
<meta property="og:url" content="https://docs.clan.lol" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:site_name" content="Clan" />
|
||||||
|
<meta property="og:locale" content="en_US" />
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user