Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
markedpage
Advanced tools
Readme
A Markdown provider for my sveltekit static blog.
<!-- more -->
tag, it will add excerpt into frontmatterconst config = {
title: 'TestWebSite',
classifier: [
{ id: 'post', params: { path: '/_posts/' }, type: 'directory' },
{ id: 'tag', params: { keys: ['tag', 'tags'] }, type: 'frontmatter' }
],
marked: {
options: {},
extensions: {}
}
};
export default config;
/
|_docs
|_posts
|_2022-04-28-post1.md
// example.ts
import type { DirectoryClassifierResult } from 'markedpage';
import { getPage, classifiedSet } from 'markedpage';
import type { RequestHandler } from '@sveltejs/kit';
export const get: RequestHandler = async () => {
// Get list.
const pageSet: DirectoryClassifierResult = await classifiedSet('post');
const pages = pageSet.pages;
// Get page.
const page = await getPage('post1');
const context = await page.render();
return {
body: {
pages: pages,
metadata: page.frontMatter,
body: context
}
};
};
<!-- 2022-04-28-firstpage.md -->
title: FirstPost
tags:
- test
---
This is summary field.
<!-- more -->
This is context block.
It will be passed to
{
frontMatter: {
title: 'FirstPost',
tags: [ 'test' ],
excerpt: 'This is summary field.',
created: 2022-04-28T00:00:00.000Z
},
sourcePath: 'docs/2022-04-28-firstpage.md',
indexPath: 'docs/2022-04-28-firstpage',
render: [Function: render],
raw: [Function: raw],
slugKey: 'firstpage'
}
markedpageVitePlugin()
to config.plugins// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import { markedpageVitePlugin } from 'markedpage';
import siteConfig from './src/site.config.js';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit(), markedpageVitePlugin(siteConfig)]
};
export default config;
// src/routes/
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { onContentUpdate } from 'markedpage/helper';
onContentUpdate((payload) => {
let slug = $page.params.slug;
// update endpoint data.
invalidate(`/api/posts.json`);
invalidate(`/api/posts/${slug}.json`);
});
</script>
https://github.com/saweima12/markedpage-example
onContentUpdate
to markedpage/helper
[issues]_draft
field support in FrontMatter.(It will not be added to list in production)FAQs
Markdown source provider & classification utilities
The npm package markedpage receives a total of 54 weekly downloads. As such, markedpage popularity was classified as not popular.
We found that markedpage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.