add meta.ejs template
This commit is contained in:
parent
3a6216c41d
commit
9bf4c10a92
|
|
@ -2,6 +2,10 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<meta name="theme-color" content="#fff" />
|
||||
<%- include('src/templates/meta', meta) %>
|
||||
|
||||
<title><%= fn.getCVTitle(cv) %></title>
|
||||
<style>
|
||||
/* Note: if you add additional styles to this class, you should remove them in `@media print` to ensure .cv-container remains styleless when printing */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%- include('src/templates/meta', editorMeta) %>
|
||||
|
||||
<title>JSONCV Editor</title>
|
||||
<link rel="shortcut icon" href="../favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="../scss/editor/index.scss" />
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="theme-color" content="#fff" />
|
||||
<%- include('src/templates/meta', meta) %>
|
||||
|
||||
<link rel="shortcut icon" href="favicon.png" type="image/png">
|
||||
<title>JSONCV</title>
|
||||
<link rel="stylesheet" href="./scss/home.scss" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<meta name="description" content="<%= description %>">
|
||||
<meta property="og:title" content="<%= title %>">
|
||||
<meta property="og:description" content="<%= description %>">
|
||||
<meta property="og:type" content="website">
|
||||
<% if (locals.url) { %>
|
||||
<meta property="og:url" content="<%= url %>">
|
||||
<link rel="canonical" href="<%= url %>" />
|
||||
<% } %>
|
||||
<% if (locals.twitter) { %>
|
||||
<meta name="twitter:card" property="twitter:card" content="<%= twitter.card %>">
|
||||
<meta name="twitter:creator" property="twitter:creator" content="@<%= twitter.username %>">
|
||||
<meta name="twitter:title" property="twitter:title" content="<%= title %>">
|
||||
<meta name="twitter:description" property="twitter:description" content="<%= description %>">
|
||||
<% } %>
|
||||
|
|
@ -13,6 +13,10 @@ const data = require(dataFilename)
|
|||
const renderData = getRenderData(data)
|
||||
renderData.theme = process.env.THEME || 'reorx'
|
||||
renderData.isProduction = process.env.NODE_ENV === 'production'
|
||||
renderData.meta = {
|
||||
title: data.basics.name,
|
||||
description: data.basics.summary.replace('\n', ' '),
|
||||
}
|
||||
|
||||
|
||||
export default defineConfig({
|
||||
|
|
|
|||
|
|
@ -1,9 +1,30 @@
|
|||
import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
||||
|
||||
import { TransformEjs } from './src/lib/vite-plugins';
|
||||
|
||||
const rootDir = resolve(__dirname, 'src')
|
||||
const renderData = {
|
||||
meta: {
|
||||
title: "jsoncv",
|
||||
description: "A toolkit for building your CV with JSON and creating stylish HTML/PDF files.",
|
||||
url: "https://jsoncv.reorx.com",
|
||||
twitter: {
|
||||
card: "summary",
|
||||
username: "novoreorx",
|
||||
}
|
||||
},
|
||||
editorMeta: {
|
||||
title: "jsoncv Editor",
|
||||
description: "The online editor of the jsoncv project.",
|
||||
url: "https://jsoncv.reorx.com/editor/",
|
||||
twitter: {
|
||||
card: "summary",
|
||||
username: "novoreorx",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
root: 'src',
|
||||
|
|
@ -26,5 +47,14 @@ export default defineConfig({
|
|||
},
|
||||
plugins: [
|
||||
TransformEjs(),
|
||||
ViteEjsPlugin(
|
||||
renderData,
|
||||
{
|
||||
ejs: (viteConfig) => ({
|
||||
// ejs options goes here.
|
||||
views: [resolve(__dirname)],
|
||||
})
|
||||
}
|
||||
),
|
||||
],
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue