Content Thumbnail default breakpoint
This commit is contained in:
+18
-3
@@ -3,9 +3,21 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Process markdown content with enhanced features
|
||||
* Format date consistently across the markdown pipeline
|
||||
* Uses "Month Year" format (e.g., "April 2025")
|
||||
*/
|
||||
export function formatDate(dateString) {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Process markdown content and extract metadata
|
||||
* @param {string} markdown - Raw markdown content
|
||||
* @returns {Object} Processed content with metadata
|
||||
* @returns {object} Processed content with metadata
|
||||
*/
|
||||
export function processMarkdown(markdown) {
|
||||
if (!markdown) {
|
||||
@@ -33,9 +45,12 @@ export function processMarkdown(markdown) {
|
||||
const wordCount = calculateWordCount(markdown);
|
||||
const readingTime = calculateReadingTime(wordCount);
|
||||
|
||||
// Convert markdown to HTML
|
||||
const htmlContent = markdownToHtml(markdown);
|
||||
|
||||
return {
|
||||
content: markdown,
|
||||
htmlContent: markdownToHtml(markdown),
|
||||
htmlContent,
|
||||
wordCount,
|
||||
readingTime,
|
||||
headings,
|
||||
|
||||
Reference in New Issue
Block a user