-
Notifications
You must be signed in to change notification settings - Fork 27
/
home.html
97 lines (93 loc) · 3.65 KB
/
home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{% import 'macros/math.html' as macro_math -%}
{% extends "_base.html" %}
{% block page %}homepage{% endblock page%}
{% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %}
{% block title %}{{ config.title }}{% endblock title %}
{% block desc %}
<meta name="description" content="{{ config.description }}">
{% endblock desc %}
{% block head %}
{% if config.markdown.highlight_theme == "css" %}
<link id="hl" rel="stylesheet" type="text/css" href="/hl-{% if config.extra.force_theme == "dark" %}dark{% else %}light{% endif %}.css" />
{% endif %}
{% if section.extra.math %}
{{ macro_math::math_render(style = section.extra.math) }}
{% endif %}
{% endblock head %}
{% block content %}
<div id="wrapper">
<main>
<section id="info">
{% if config.extra.display_avatar %}
<img src="{{ config.extra.avatar }}" alt="avatar">
{% endif %}
<div id="text">
<div>
<span id="name">{{ config.extra.name }}</span>
{% if config.extra.display_id %}
<span id="id">@{{ config.extra.id }}</span>
{% endif %}
</div>
{% if config.extra.display_bio %}
<div id="bio"> {{ config.extra.bio }} </div>
{% endif %}
</div>
</section>
<section id="links">
<div id="left">
{% for section in config.extra.sections %}
<a href="{{ section.path }}" {% if section.is_external %}target="_blank" rel='noreferrer noopener'{% else %}class="instant"{% endif %}>{{ section.name }}</a>
{% endfor %}
</div>
<div id="right">
{% for link in config.extra.links %}
<a href="{{ link.url }}" aria-label="{{ link.name }}" target="_blank" rel='noreferrer noopener'>
{% set icon_path = "static/icon/" ~ link.icon ~ ".svg" %}
{% set icon = load_data(path=icon_path) %}
{{ icon | safe }}
</a>
{% endfor %}
{% if not config.extra.force_theme %}
{% set moon_icon = load_data(path="static/icon/moon.svg") %}
{% set sun_icon = load_data(path="static/icon/sun.svg") %}
<button id="theme-toggle" aria-label="theme switch">
<span class="moon-icon">{{ moon_icon | safe }}</span>
<span class="sun-icon">{{ sun_icon | safe }}</span>
</button>
{% endif %}
</div>
</section>
<section id="brief" class="prose">
{{ section.content | trim | safe }}
</section>
{% if config.extra.recent %}
{% set blog_section_path = config.extra.blog_section_path | trim_start_matches(pat="/") %}
{% set section_md_path = blog_section_path ~ "/_index.md" %}
{% set blog_section = get_section(path=section_md_path) %}
<section class="layout-list">
<div class="post-list">
{% for post in blog_section.pages | slice(end=config.extra.recent_max) %}
<a class="post instant {% if post.extra.featured %}featured{% endif %}" href="{{ post.permalink }}">
<span>{{ post.title }}</span>
<span class="line"></span>
<span class="date">{{ post.date | date}}</span>
</a>
{% endfor %}
</div>
<div class="read-more">
<a class="instant" href="{{ config.extra.blog_section_path }}">{{ config.extra.recent_more_text }}</a>
</div>
</section>
{% endif %}
</main>
</div>
{% endblock content %}
{% block script %}
<script src="/js/lightense.min.js"></script>
{% if section.extra.mermaid %}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
{% endif %}
{% endblock script %}