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);
|
||||
}
|
||||
|
||||
/* Post's title */
|
||||
header > h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
/* Date's title */
|
||||
header > p {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
::selection {
|
||||
color: rgb(255, 255, 255);
|
||||
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>
|
||||
{{#posts}}
|
||||
<li onclick="location.href='/blog/{{url}}';">
|
||||
<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>
|
||||
{{>blog/date.html}}
|
||||
<div class="content">
|
||||
<h2>{{title}}</h2>
|
||||
{{#desc}}
|
||||
|
|
|
@ -6,10 +6,15 @@
|
|||
{{#data}} {{#post}} {{#metadata}}
|
||||
{{#math}}{{>libs/katex_head.html}}{{/math}}
|
||||
{{#syntax_highlight}}{{>libs/hljs_head.html}}{{/syntax_highlight}}
|
||||
{{/metadata}} {{/post}}
|
||||
</head>
|
||||
<body class="index">
|
||||
<header></header>
|
||||
<header>
|
||||
{{#info}}
|
||||
<h1>{{title}}</h1>
|
||||
{{#date}}
|
||||
<p>{{>blog/date.html}}</p>
|
||||
{{/date}} {{/info}} {{/metadata}} {{/post}}
|
||||
</header>
|
||||
<main>
|
||||
{{^post}}
|
||||
<p>This post doesn't exist... sorry</p>
|
||||
|
|
Loading…
Reference in a new issue