Skip to content

Commit

Permalink
Make nin compile template in demo title in normal title tag as well
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanb committed May 21, 2017
1 parent f87344c commit 07d6922
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion nin/backend/blank-project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset=utf8>
NIN_WILL_REPLACE_THIS_TAG_WITH_AUTOGENERATED_COMMENT_TAGS
<title>My project</title>
<style>
* {
font-family: sans-serif;
Expand Down
6 changes: 4 additions & 2 deletions nin/backend/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ async function collect(projectPath, data) {
.map(key => `<!-- ${key}: ${metadata[key]} -->`)
.join('\n');

const escapedTitle = utils.unsafeHTMLEscape(metadata.Title);
const ogTags =
`<meta property="og:title" content="${utils.unsafeHTMLEscape(metadata.Title)}" />
`<meta property="og:title" content="${escapedTitle}" />
<meta property="og:description" content="${utils.unsafeHTMLEscape(metadata.Description)}" />
<meta property="og:image" content="${metadata.previewImage}" />
<meta name="author" content="${utils.unsafeHTMLEscape(metadata.Author)}" />`;
<meta name="author" content="${utils.unsafeHTMLEscape(metadata.Author)}" />
<title>${escapedTitle}</title>`;

const htmlPreamble =
fs.readFileSync(projectPath + '/index.html', {encoding: 'utf8'})
Expand Down

0 comments on commit 07d6922

Please sign in to comment.