mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: include tags in exported note (#1345)
Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
This commit is contained in:
@@ -89,7 +89,8 @@ export default class Note {
|
||||
title: this.title,
|
||||
editedOn: this.dateEdited,
|
||||
headline: this.headline,
|
||||
createdOn: this.data.dateCreated
|
||||
createdOn: this.data.dateCreated,
|
||||
tags: this.tags.join(", ")
|
||||
};
|
||||
const contentItem = await this._db.content.raw(this._note.contentId);
|
||||
if (!contentItem) return false;
|
||||
|
||||
@@ -37,7 +37,7 @@ function generateMetaTags(metadata, createMetaTag) {
|
||||
export function buildPage(
|
||||
template,
|
||||
createMetaTag,
|
||||
{ metadata, title, headline, content, createdOn, editedOn }
|
||||
{ metadata, title, headline, content, createdOn, editedOn, tags }
|
||||
) {
|
||||
let page = template;
|
||||
|
||||
@@ -52,5 +52,6 @@ export function buildPage(
|
||||
page = page.replace(/{{content}}/g, content);
|
||||
page = page.replace(/{{createdOn}}/g, formatDate(createdOn));
|
||||
page = page.replace(/{{editedOn}}/g, formatDate(editedOn));
|
||||
page = page.replace(/{{tags}}/g, tags);
|
||||
return page;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ const template = `<!DOCTYPE html>
|
||||
name="description"
|
||||
content="{{headline}}"
|
||||
/>
|
||||
<title>{{title}} - Notesnook</title>
|
||||
<title>{{title}} - Notesnook</title>
|
||||
<meta name="created-on" content="{{createdOn}}" />
|
||||
<meta name="last-edited-on" content="{{editedOn}}" />
|
||||
<meta name="tags" content="{{tags}}" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{title}}</h1>
|
||||
{{content}}
|
||||
<br/>
|
||||
Created on: <b>{{createdOn}}</b><br/>
|
||||
Edited on: <b>{{editedOn}}</b>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
@@ -22,7 +22,5 @@ const template = `# {{title}}
|
||||
{{content}}
|
||||
---
|
||||
|
||||
_Created on: {{createdOn}}_
|
||||
|
||||
_Edited on: {{editedOn}}_`;
|
||||
_Tags: {{tags}}_`;
|
||||
export default template;
|
||||
|
||||
@@ -23,7 +23,6 @@ const template = `{{title}}
|
||||
{{content}}
|
||||
|
||||
----------
|
||||
Created on: {{createdOn}}
|
||||
Edited on: {{editedOn}}`;
|
||||
Tags: {{tags}}`;
|
||||
|
||||
export default template;
|
||||
|
||||
Reference in New Issue
Block a user