
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
A simple static website generator built for your docs
directory.
docship
in your docs
directory. That's it.src/pages
or _posts
directories. Place your markdown files as you like.docship --watch
.docs
into HTMLs in a single command, with good default config.docship --watch
.npm install -g docship # Install docship
cd path/to/docs # Move to your docs directory
docship # Generate HTML files ("output" directory by default)
If you want to preview your website with a local server:
docship --watch
vercel.json
in your project root:{
"framework": null,
"buildCommand": "docship",
"installCommand": "npm i -g docship",
"outputDirectory": "output",
"cleanUrls": true,
"trailingSlash": false,
"github": {
"silent": true
}
}
20.x
or higher.docship
will look for markdown and asset files recursively in the input directory._
are ignored./blog/why-you-should-visit-kumamoto.md
will be output to /blog/why-you-should-visit-kumamoto.html
._layouts
directory. The layout for a page is determined by the layout
field in the markdown front-matter.├── favicon.ico -- Static files are copied as-is
├── index.md -- /index.html (you may also use README.md for /index.html)
├── docship.mjs -- Configuration file (optional)
├── _layouts/ -- Layouts directory
│ ├── blog.jsx -- Layout for "blog" pages
│ └── index.jsx -- Layout for "index" page
└── blog/ -- "blog" directory
├── why-you-should-visit-kumamoto.md -- A public blog post
├── best-cappucino-in-rome.md -- Another post
└── _lessons-learned-from-my-life.md -- A draft (ignored) post
Front-matter is a block of YAML at the beginning of a file that specifies metadata about the file. For example:
---
title: Best cappucino in Rome
layout: blog
date: 2024-11-30
---
Fields can be any valid YAML but the following fields are used by docship
:
Name | Type | Description |
---|---|---|
layout | string | The layout name in the _layouts directory. Required. |
title | string | The title of the page. |
date | string | The date of the page. |
_layouts
directory.async
to fetch data from external sources. If you're familiar with Next.js, it's somewhat similar to getStaticProps
.export function Blog({ meta, children }) {
return (
<html>
<head>
<title>{meta.title}</title>
</head>
<body>
<header>
<h1>{meta.title}</h1>
<p>{meta.date}</p>
</header>
<main>
{children}
</main>
</body>
</html>
);
}
Name | Type | Description |
---|---|---|
meta | Record<string, boolean | number | string | any> | Front-matter of the markdown file. |
children | Element | The content of the markdown file. |
pages | Page[] | An array of all pages. Useful for generating an index page. |
[!NOTE]
Limitations:
- React is not available. We use JSX as a templating language to generate fully static HTML files.
- Importing components is not (yet) supported. You can only use Node.js built-in modules.
docship
can generate an Atom feed for your website. To enable the feed, add the following to your docship.mjs
:
export default {
baseUrl: "https://seiya.me",
feedOptions: {
title: "seiya.me",
id: "https://seiya.me",
link: "https://seiya.me",
author: {
name: "Seiya Nuta",
}
},
callbacks: {
filterFeed(page) {
// Don't include the index page in the feed.
return page.href != "/index";
},
}
}
The feed file will be generated at /feed.xml
.
FAQs
A simple static website generator built for your `docs` directory.
The npm package docship receives a total of 0 weekly downloads. As such, docship popularity was classified as not popular.
We found that docship demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.