forked from axios/axios-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.ejs
207 lines (198 loc) · 11 KB
/
post.ejs
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="<%= locale.lang %>" dir="<%= locale.dir %>">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= data.attributes.title %> | <%= locale.title || config.custom.title %></title>
<link rel="stylesheet" href="/style/index.css" />
<style>
* {
<%= locale.fontSans ? 'font-family: ' + locale.fontSans + ';' : '' %>
}
</style>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X"
crossorigin="anonymous"
/>
<link
rel="preload"
as="style"
onload="this.rel='stylesheet'"
href="https://fonts.googleapis.com/css2?family=<%= locale.fontSans || 'DM+Sans' %>:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
/>
<link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon" />
<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/css/splide.min.css">
<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide-extension-auto-scroll.min.js"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
</head>
<body>
<script>
let isDarkThemeActive = false;
const userDefaultTheme = localStorage.getItem("@axios-docs:theme");
if (userDefaultTheme && userDefaultTheme == "true") {
document.body.classList.add("dark");
isDarkThemeActive = true;
}
</script>
<header>
<div></div>
<div class="left">
<button id="hamburger">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
id="hamburgerIcon"
>
<path d="M3 8V6H21V8H3Z" fill="currentColor" />
<path d="M3 13H21V11H3V13Z" fill="currentColor" />
<path d="M3 18H21V16H3V18Z" fill="currentColor" />
</svg>
</button>
</div>
</header>
<aside>
<div>
<a href="<%= locale.prefix %>" id="logo">
<svg width="188" height="28" viewBox="0 0 188 28" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M93.295 3.65206L86.356 9.30495H90.8876V27.68L93.295 25.7411V3.65206Z" fill="currentColor"/>
<path d="M95.295 24.0997L102.356 18.305H97.6975V0.350052L95.295 2.02275V24.0997Z" fill="currentColor"/>
<path d="M182.695 6.95295C183.495 7.36895 184.071 7.72095 184.423 8.00895L186.919 3.25695C185.671 2.48895 184.167 1.80095 182.407 1.19295C180.679 0.584955 178.807 0.280952 176.791 0.280952C174.871 0.280952 173.095 0.600952 171.463 1.24095C169.863 1.88095 168.583 2.82495 167.623 4.07295C166.695 5.32095 166.231 6.87295 166.231 8.72895C166.231 10.809 166.887 12.409 168.199 13.529C169.543 14.617 171.591 15.513 174.343 16.217C176.551 16.793 178.327 17.321 179.671 17.801C181.047 18.249 181.735 19.001 181.735 20.057C181.735 21.625 180.263 22.409 177.319 22.409C175.847 22.409 174.455 22.233 173.143 21.881C171.831 21.529 170.679 21.097 169.687 20.585C168.727 20.073 168.039 19.609 167.623 19.193L165.031 24.233C166.695 25.289 168.599 26.121 170.743 26.729C172.887 27.337 175.047 27.641 177.223 27.641C179.111 27.641 180.871 27.385 182.503 26.873C184.135 26.329 185.447 25.465 186.439 24.281C187.463 23.065 187.975 21.4649 187.975 19.4809C187.975 17.8489 187.591 16.537 186.823 15.545C186.087 14.521 185.015 13.705 183.607 13.097C182.231 12.489 180.599 11.945 178.711 11.465C176.567 10.953 174.935 10.489 173.815 10.073C172.727 9.65695 172.183 8.95295 172.183 7.96095C172.183 6.26495 173.687 5.41695 176.695 5.41695C177.815 5.41695 178.903 5.57695 179.959 5.89695C181.015 6.18495 181.927 6.53695 182.695 6.95295Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M132.182 27.497C130.07 27.497 128.15 27.129 126.422 26.393C124.694 25.625 123.205 24.601 121.957 23.321C120.709 22.009 119.749 20.537 119.077 18.905C118.406 17.273 118.069 15.593 118.069 13.865C118.069 12.105 118.421 10.409 119.125 8.77695C119.829 7.14495 120.822 5.70496 122.102 4.45695C123.382 3.17695 124.885 2.16895 126.613 1.43295C128.341 0.696953 130.229 0.328949 132.277 0.328949C134.389 0.328949 136.31 0.728952 138.038 1.52895C139.766 2.29695 141.238 3.33695 142.454 4.64895C143.702 5.92895 144.661 7.38495 145.333 9.01695C146.005 10.649 146.342 12.3129 146.342 14.0089C146.342 15.7689 145.99 17.465 145.286 19.097C144.582 20.697 143.589 22.137 142.309 23.417C141.061 24.665 139.574 25.657 137.846 26.393C136.118 27.129 134.23 27.497 132.182 27.497ZM123.925 13.913C123.925 15.353 124.262 16.729 124.934 18.041C125.605 19.321 126.549 20.361 127.765 21.161C129.013 21.961 130.501 22.361 132.229 22.361C133.989 22.361 135.477 21.945 136.693 21.113C137.91 20.249 138.837 19.177 139.477 17.8969C140.117 16.5849 140.438 15.241 140.438 13.865C140.438 12.425 140.102 11.0649 139.43 9.78495C138.758 8.50495 137.798 7.48095 136.549 6.71295C135.333 5.91295 133.878 5.51295 132.182 5.51295C130.422 5.51295 128.917 5.92895 127.669 6.76095C126.453 7.59295 125.525 8.64896 124.885 9.92896C124.245 11.209 123.925 12.537 123.925 13.913Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 27.305L11.712 0.472954H16.464L28.128 27.305H21.984L19.296 21.017H8.88L6.192 27.305H0ZM14.112 7.52895L10.176 15.977H17.904L14.112 7.52895Z" fill="currentColor"/>
<path d="M50.8211 0.472954L58.2131 9.97695L65.6051 0.472954H71.8931L61.2851 14.057L71.5571 27.305H65.2691L58.2131 18.185L51.2051 27.305H44.8211L55.1411 14.057L44.4851 0.472954H50.8211Z" fill="currentColor"/>
</svg>
</a>
</div>
<details class="dropdown-language">
<summary>
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>
<%= locale.display %>
</div>
<svg id="chevron" xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>
</summary>
<div class="options">
<% config.custom.langs.forEach(lang => { %> <% if (lang.prefix !==
locale.prefix) { %>
<a href="<%= lang.prefix %>docs/<%= file.withoutExtension %>"><%= lang.config.display %></a>
<% } %> <% }) %>
</div>
</details>
<div class="aside-container">
<% locale.sidebar.forEach(side => { %>
<% if (side.type === 'link') { %>
<a href="<%= side.href.startsWith('/') ? (locale.prefix + side.href.slice(1)) : side.href %>"><%= side.text %></a>
<% } else { %>
<h3 class="group-name"><%= side.text %></h3>
<% } %>
<% }) %>
</div>
<section id="sponsors" aria-label="Axios sponsors">
</section>
<div class="button-container">
<button class="theme">
<div class="light">
<svg
viewBox="0 0 24 24"
width="16"
height="16"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
fill="none"
shape-rendering="geometricPrecision"
style="color: currentcolor"
>
<circle cx="12" cy="12" r="5"></circle>
<path d="M12 1v2"></path>
<path d="M12 21v2"></path>
<path d="M4.22 4.22l1.42 1.42"></path>
<path d="M18.36 18.36l1.42 1.42"></path>
<path d="M1 12h2"></path>
<path d="M21 12h2"></path>
<path d="M4.22 19.78l1.42-1.42"></path>
<path d="M18.36 5.64l1.42-1.42"></path>
</svg>
</div>
<div class="slider">
<span aria-hidden="true" class="roller"></span>
</div>
<div class="dark">
<svg
viewBox="0 0 24 24"
width="16"
height="16"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
fill="none"
shape-rendering="geometricPrecision"
style="color: currentcolor"
>
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
</svg>
</div>
</button>
</div>
</aside>
<main>
<div class="body">
<h1 class="title"><%= data.attributes.title %></h1>
<p class="description"><%= data.attributes.description %></p>
<%- data.body %>
<div class="links">
<% if (data.attributes.prev_link) { %>
<a href="<%= data.attributes.prev_link %>" class="next-link">
<span>« <%= locale.t['Previous'] || 'Previous' %></span>
<span class="l"> <%= data.attributes.prev_title %> </span>
</a>
<% } %>
<span>
</span>
<% if (data.attributes.next_link) { %>
<a href="<%= data.attributes.next_link %>" class="next-link">
<span><%= locale.t['Next'] || 'Next' %> »</span>
<span class="l"> <%= data.attributes.next_title %> </span>
</a>
<% } %>
</div>
</div>
<div class="col-right"></div>
</main>
<script>
document.querySelector("#hamburger").addEventListener("click", () => {
document.body.classList.toggle("show-aside");
});
document.querySelector("button.theme").addEventListener("click", () => {
isDarkThemeActive = !isDarkThemeActive;
localStorage.setItem("@axios-docs:theme", isDarkThemeActive);
document.body.classList.toggle("dark");
document.querySelector("button.theme").classList.toggle("dark");
});
// switch `dir` of those RTL oriented elements that start with an
// English letter, assuming they are not intended to be RTL aligned.
if (document.dir === "rtl") {
document.querySelectorAll("*").forEach(element => {
if (/[a-zA-Z]/.test(element.textContent.charAt(0))) {
element.dir = "ltr"
}
})
}
window.onload = () => {
if (isDarkThemeActive) {
document.querySelector("button.theme").classList.toggle("dark");
}
document.documentElement.style.setProperty('--transition-delay', '300ms');
};
</script>
</body>
</html>