devfolio-page 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseMarkdown, highlightCode, parseBio } from './markdown.js';
|
|
1
|
+
import { parseMarkdown, parseMarkdownProse, highlightCode, parseBio } from './markdown.js';
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import Mustache from 'mustache';
|
|
@@ -262,7 +262,7 @@ async function generateAboutPage(portfolio, themePath, outputDir, theme) {
|
|
|
262
262
|
site_name: portfolio.meta.name,
|
|
263
263
|
tagline: portfolio.meta.tagline,
|
|
264
264
|
avatar: portfolio.meta.avatar,
|
|
265
|
-
about_content:
|
|
265
|
+
about_content: parseMarkdownProse(portfolio.about?.long || portfolio.about?.short || ''),
|
|
266
266
|
contact: portfolio.contact,
|
|
267
267
|
hasContact: !!(portfolio.contact?.email || portfolio.contact?.github || portfolio.contact?.linkedin || portfolio.contact?.twitter || portfolio.contact?.website),
|
|
268
268
|
skills: skillsArray,
|
|
@@ -848,7 +848,7 @@ async function generateAboutPageInMemory(portfolio, themePath, theme, files) {
|
|
|
848
848
|
site_name: portfolio.meta.name,
|
|
849
849
|
tagline: portfolio.meta.tagline,
|
|
850
850
|
avatar: portfolio.meta.avatar,
|
|
851
|
-
about_content:
|
|
851
|
+
about_content: parseMarkdownProse(portfolio.about?.long || portfolio.about?.short || ''),
|
|
852
852
|
contact: portfolio.contact,
|
|
853
853
|
hasContact: !!(portfolio.contact?.email || portfolio.contact?.github || portfolio.contact?.linkedin || portfolio.contact?.twitter || portfolio.contact?.website),
|
|
854
854
|
skills: skillsArray,
|
|
@@ -10,6 +10,18 @@ marked.setOptions({
|
|
|
10
10
|
export function parseMarkdown(content) {
|
|
11
11
|
return marked.parse(content);
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Parse markdown content to HTML without converting single newlines to <br>
|
|
15
|
+
* Use this for prose content like about pages where normal paragraph flow is expected
|
|
16
|
+
*/
|
|
17
|
+
export function parseMarkdownProse(content) {
|
|
18
|
+
// Temporarily disable breaks for this parse
|
|
19
|
+
const originalBreaks = marked.defaults.breaks;
|
|
20
|
+
marked.setOptions({ breaks: false });
|
|
21
|
+
const result = marked.parse(content);
|
|
22
|
+
marked.setOptions({ breaks: originalBreaks });
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
13
25
|
/**
|
|
14
26
|
* Parse inline markdown (no block elements like <p>)
|
|
15
27
|
*/
|