Implement localization
This commit is contained in:
parent
5016ced432
commit
506c0203d9
12 changed files with 218 additions and 36 deletions
|
|
@ -1,15 +0,0 @@
|
|||
-- source: https://stackoverflow.com/a/76048743
|
||||
|
||||
local title
|
||||
|
||||
function Header(e)
|
||||
if title then return end
|
||||
title = pandoc.utils.stringify(e) .. " • jutty.dev"
|
||||
end
|
||||
|
||||
function Meta(e)
|
||||
if not e.pagetitle then
|
||||
e.pagetitle = title
|
||||
return e
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
#!/usr/bin/env utop
|
||||
|
||||
let args = "--css ../../assets/style.css -s --to html5 " ^
|
||||
"--highlight-style zenburn " ^ "--lua-filter filters/title.lua "
|
||||
let args = "--css ../assets/style.css --standalone " ^
|
||||
"--from markdown+yaml_metadata_block " ^ "--to html5 " ^
|
||||
"--highlight-style zenburn " ^ "--template=template.html "
|
||||
|
||||
|
||||
let vert md = begin
|
||||
let filename_split = String.split_on_char '.' md in
|
||||
Sys.command (
|
||||
"pandoc " ^ args ^ " md/" ^ md ^ " -o " ^ List.nth filename_split 0
|
||||
"pandoc " ^ args ^ " md/" ^ md ^ " -o " ^ List.nth filename_split 0 ^ ".html"
|
||||
)
|
||||
end ;;
|
||||
|
||||
|
|
|
|||
39
posts/hello-worldling.html
generated
Normal file
39
posts/hello-worldling.html
generated
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<meta name="author" content="Juno Takano" />
|
||||
<meta name="dcterms.date" content="2024-05-20" />
|
||||
<title>Hello, Worldling • jutty.dev</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../assets/style.css" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://blog.jutty.dev/feed.rss"/>
|
||||
<script src="../assets/js/post-l10n.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Hello, Worldling</h1>
|
||||
</header>
|
||||
<p>Oh hi</p>
|
||||
<footer>
|
||||
<hr/>
|
||||
<div class="footer-text">
|
||||
<span class="author">Juno Takano</span>,
|
||||
<span class="date">May 20, 2024</span>
|
||||
<span class="footer-back" aria-role="nav" aria-label="Navigate back">
|
||||
↩ <a id="footer-back-link" href="../index.html">Voltar</a>
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
7
posts/md/hello-worldling.md
Normal file
7
posts/md/hello-worldling.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: Hello, Worldling
|
||||
author: Juno Takano
|
||||
date: May 20, 2024
|
||||
---
|
||||
|
||||
Oh hi
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
# Scripts em OCaml
|
||||
---
|
||||
title: Scripts em OCaml
|
||||
author: Juno Takano
|
||||
date: 23 de fevereiro de 2024
|
||||
---
|
||||
|
||||
Este blog gera suas postagens com o Pandoc, mas quem faz o trabalho lógico de identificar os arquivos e montar os comandos é um pequeno script em OCaml.
|
||||
|
||||
|
|
|
|||
19
posts/scripts-em-ocaml.html
generated
19
posts/scripts-em-ocaml.html
generated
|
|
@ -4,6 +4,7 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<meta name="author" content="Juno Takano" />
|
||||
<title>Scripts em OCaml • jutty.dev</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
|
|
@ -76,10 +77,14 @@
|
|||
code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../../assets/style.css" />
|
||||
<link rel="stylesheet" href="../assets/style.css" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://blog.jutty.dev/feed.rss"/>
|
||||
<script src="../assets/js/post-l10n.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="scripts-em-ocaml">Scripts em OCaml</h1>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Scripts em OCaml</h1>
|
||||
</header>
|
||||
<p>Este blog gera suas postagens com o Pandoc, mas quem faz o trabalho
|
||||
lógico de identificar os arquivos e montar os comandos é um pequeno
|
||||
script em OCaml.</p>
|
||||
|
|
@ -121,5 +126,15 @@ a directory/Non-recursively - Rosetta Code</a></li>
|
|||
<li><a href="https://jez.io/pandoc-markdown-css-theme/">Pandoc Markdown
|
||||
CSS Theme</a></li>
|
||||
</ul>
|
||||
<footer>
|
||||
<hr/>
|
||||
<div class="footer-text">
|
||||
<span class="author">Juno Takano</span>,
|
||||
<span class="date">23 de fevereiro de 2024</span>
|
||||
<span class="footer-back" aria-role="nav" aria-label="Navigate back">
|
||||
↩ <a id="footer-back-link" href="../index.html">Voltar</a>
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
80
posts/template.html
generated
Normal file
80
posts/template.html
generated
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
$for(author-meta)$
|
||||
<meta name="author" content="$author-meta$" />
|
||||
$endfor$
|
||||
$if(date-meta)$
|
||||
<meta name="dcterms.date" content="$date-meta$" />
|
||||
$endif$
|
||||
$if(keywords)$
|
||||
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
|
||||
$endif$
|
||||
$if(description-meta)$
|
||||
<meta name="description" content="$description-meta$" />
|
||||
$endif$
|
||||
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ • jutty.dev</title>
|
||||
<style>
|
||||
$styles.html()$
|
||||
</style>
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="$css$" />
|
||||
$endfor$
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://blog.jutty.dev/feed.rss"/>
|
||||
<script src="../assets/js/post-l10n.js" defer></script>
|
||||
$for(header-includes)$
|
||||
$header-includes$
|
||||
$endfor$
|
||||
$if(math)$
|
||||
$math$
|
||||
$endif$
|
||||
</head>
|
||||
<body>
|
||||
$for(include-before)$
|
||||
$include-before$
|
||||
$endfor$
|
||||
$if(title)$
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">$title$</h1>
|
||||
$if(subtitle)$
|
||||
<p class="subtitle">$subtitle$</p>
|
||||
$endif$
|
||||
$if(abstract)$
|
||||
<div class="abstract">
|
||||
<div class="abstract-title">$abstract-title$</div>
|
||||
$abstract$
|
||||
</div>
|
||||
$endif$
|
||||
</header>
|
||||
$endif$
|
||||
$if(toc)$
|
||||
<nav id="$idprefix$TOC" role="doc-toc">
|
||||
$if(toc-title)$
|
||||
<h2 id="$idprefix$toc-title">$toc-title$</h2>
|
||||
$endif$
|
||||
$table-of-contents$
|
||||
</nav>
|
||||
$endif$
|
||||
$body$
|
||||
$for(include-after)$
|
||||
$include-after$
|
||||
$endfor$
|
||||
<footer>
|
||||
<hr/>
|
||||
<div class="footer-text">
|
||||
$for(author)$
|
||||
<span class="author">$author$</span>,
|
||||
$endfor$
|
||||
$if(date)$
|
||||
<span class="date">$date$</span>
|
||||
<span class="footer-back" aria-role="nav" aria-label="Navigate back">
|
||||
↩ <a id="footer-back-link" href="../index.html">Voltar</a>
|
||||
</span>
|
||||
$endif$
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue