Add support for link preview.
This commit is contained in:
parent
6197930c8f
commit
e932940df7
3 changed files with 15 additions and 3 deletions
|
|
@ -16,6 +16,11 @@ eleventyConfig.addNunjucksFilter("alternateLanguages", function(collection, post
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eleventyConfig.addFilter("absoluteUrl", function(path) {
|
||||||
|
const base = "https://adrianvic.github.io";
|
||||||
|
return base + path;
|
||||||
|
});
|
||||||
|
|
||||||
eleventyConfig.addNunjucksFilter("smartTitle", function(str) {
|
eleventyConfig.addNunjucksFilter("smartTitle", function(str) {
|
||||||
if (!str) return "";
|
if (!str) return "";
|
||||||
const smallWords = ["a","an","and","at","but","by","for","in","nor","of","on","or","so","the","to","up","yet",
|
const smallWords = ["a","an","and","at","but","by","for","in","nor","of","on","or","so","the","to","up","yet",
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ module.exports = {
|
||||||
back: "back",
|
back: "back",
|
||||||
hideBackground: "Hide background",
|
hideBackground: "Hide background",
|
||||||
options: "Options",
|
options: "Options",
|
||||||
alsoAvailableAsVideo: "Also available as video"
|
alsoAvailableAsVideo: "Also available as video",
|
||||||
|
websiteDescription: "Personal website/blog of Adrian Victor."
|
||||||
},
|
},
|
||||||
pt: {
|
pt: {
|
||||||
language: "português",
|
language: "português",
|
||||||
|
|
@ -98,6 +99,7 @@ module.exports = {
|
||||||
back: "voltar",
|
back: "voltar",
|
||||||
hideBackground: "Esconder imagem de fundo",
|
hideBackground: "Esconder imagem de fundo",
|
||||||
options: "Opções",
|
options: "Opções",
|
||||||
alsoAvailableAsVideo: "Também disponível em vídeo"
|
alsoAvailableAsVideo: "Também disponível em vídeo",
|
||||||
|
websiteDescription: "Website/blog pessoal de Adrian Victor."
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
|
||||||
<link rel="manifest" href="/static/site.webmanifest">
|
<link rel="manifest" href="/static/site.webmanifest">
|
||||||
<script src="https://keepandroidopen.org/banner.js" defer></script>
|
<script src="https://keepandroidopen.org/banner.js" defer></script>
|
||||||
|
<meta property="og:title" content="Adrian Victor{% if pageTitle or postTitle %} - {{ pageTitle or postTitle }}{% endif %}">
|
||||||
|
<meta property="og:description" content="{{ description or i18n[langKey].websiteDescription }}">
|
||||||
|
<meta property="og:type" content="article">
|
||||||
|
<meta property="og:url" content="{{ page.url | url | absoluteUrl }}">
|
||||||
|
<meta property="og:image" content="{{ ('/static/images/' ~ (background or 'bear.jpg')) | absoluteUrl }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -20,7 +25,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div id="everythingHelper">
|
<div id="everythingHelper">
|
||||||
<img src="/static/images/{{ background or "bear.jpg" }}" class="bg">
|
<img src="/static/images/{{ background or "bear.jpg" }}" class="bg">
|
||||||
{% include "header.njk" %}
|
{% include "header.njk" %}
|
||||||
<div id="mainHelper">
|
<div id="mainHelper">
|
||||||
{{ content | safe }}
|
{{ content | safe }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue