This commit is contained in:
parent
c03be32b94
commit
2bec742bb2
4 changed files with 35 additions and 19 deletions
|
@ -36,6 +36,16 @@ html {
|
||||||
background-color: var(--bg);
|
background-color: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Post's title */
|
||||||
|
header > h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Date's title */
|
||||||
|
header > p {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
::selection {
|
::selection {
|
||||||
color: rgb(255, 255, 255);
|
color: rgb(255, 255, 255);
|
||||||
background: var(--selection);
|
background: var(--selection);
|
||||||
|
|
17
templates/blog/date.html
Normal file
17
templates/blog/date.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<span>
|
||||||
|
{{#date}}
|
||||||
|
<script>
|
||||||
|
{
|
||||||
|
const date = new Date(+"{{year}}", +"{{month}}", +"{{day}}");
|
||||||
|
document.currentScript.outerHTML = date.toLocaleDateString(
|
||||||
|
navigator.language || navigator.userLanguage,
|
||||||
|
{
|
||||||
|
year: "numeric",
|
||||||
|
month: "long",
|
||||||
|
day: "numeric",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{{/date}}
|
||||||
|
</span>
|
|
@ -15,23 +15,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{{#posts}}
|
{{#posts}}
|
||||||
<li onclick="location.href='/blog/{{url}}';">
|
<li onclick="location.href='/blog/{{url}}';">
|
||||||
<span>
|
{{>blog/date.html}}
|
||||||
{{#date}}
|
|
||||||
<script>
|
|
||||||
{
|
|
||||||
const date = new Date(+"{{year}}", +"{{month}}", +"{{day}}");
|
|
||||||
document.currentScript.outerHTML = date.toLocaleDateString(
|
|
||||||
navigator.language || navigator.userLanguage,
|
|
||||||
{
|
|
||||||
year: "numeric",
|
|
||||||
month: "long",
|
|
||||||
day: "numeric",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{{/date}}
|
|
||||||
</span>
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h2>{{title}}</h2>
|
<h2>{{title}}</h2>
|
||||||
{{#desc}}
|
{{#desc}}
|
||||||
|
|
|
@ -6,10 +6,15 @@
|
||||||
{{#data}} {{#post}} {{#metadata}}
|
{{#data}} {{#post}} {{#metadata}}
|
||||||
{{#math}}{{>libs/katex_head.html}}{{/math}}
|
{{#math}}{{>libs/katex_head.html}}{{/math}}
|
||||||
{{#syntax_highlight}}{{>libs/hljs_head.html}}{{/syntax_highlight}}
|
{{#syntax_highlight}}{{>libs/hljs_head.html}}{{/syntax_highlight}}
|
||||||
{{/metadata}} {{/post}}
|
|
||||||
</head>
|
</head>
|
||||||
<body class="index">
|
<body class="index">
|
||||||
<header></header>
|
<header>
|
||||||
|
{{#info}}
|
||||||
|
<h1>{{title}}</h1>
|
||||||
|
{{#date}}
|
||||||
|
<p>{{>blog/date.html}}</p>
|
||||||
|
{{/date}} {{/info}} {{/metadata}} {{/post}}
|
||||||
|
</header>
|
||||||
<main>
|
<main>
|
||||||
{{^post}}
|
{{^post}}
|
||||||
<p>This post doesn't exist... sorry</p>
|
<p>This post doesn't exist... sorry</p>
|
||||||
|
|
Loading…
Reference in a new issue