
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Sitedown turns a folder with Markdown files into a static HTML site.
. build/
āā README.md ==> āā index.html
āā about.md ==> āā about/
ā ā āā index.html
ā ā
āā docs/ āā docs/
ā āā README.md ==> ā āā index.html
ā āā ref.md ==> ā āā ref/
ā ā āā index.html
ā ā
āā assets/ āā assets/
āā cat.jpg ==> āā cat.jpg
It takes all markdown files in the current folder (and subfolders) and generates a new site in the build
directory.
README.md
files into indexes (index.html
).CHANGELOG.md
=> changelog/index.html
).layout.html
).assets
folder).dev
mode that starts a server and watches for changes for easy local development.Sitedown's website was built with sitedown, so you know it's for real.
Read the Usage section for a full overview of options and defaults.
npm install sitedown
Usage: sitedown [source] [options]
Example: sitedown . -b dist -l layout.html
source path to source directory (default: current working directory)
--build, -b path to build directory (default: "build")
--pretty use directory indexes for pretty URLs (default: true)
--el, -e css selector for target element (default: ".markdown-body")
--layout, -l path to layout file
--github-headings, -g add anchors to headings just like GitHub (default: false)
--no-hljs-class don't add the hljs class to codeblocks (default: false)
--silent, -s make less noise during build
--watch, -w watch a directory or file (experimental)
--dev, -d start development server (experimental) (default: false)
--assets, -a assets folder to copy (default: "assets")
--version, -v show version information
--help, -h show help
var sitedown = require('sitedown')
var options = {
source: '.', // path to source directory default: cwd
build: 'build', // path to build directory default: 'build' in cwd
pretty: true, // use directory indexes for pretty URLs default: true
el: '.markdown-body', // css selector for target element default: '.markdown-body'
layout: 'layout.html', // path to layout default: none
githubHeadings: false, // add anchors to headings just like GitHub default: false
noHljsClass: false, // don't add hljs class to codeblocks default: false
silent: false // make less noise during build default: false
}
sitedown(options, function (err) {
if (err) return console.error(err)
console.log('success')
})
All files are wrapped in a layout.html
file. Markdown content is appended to the first .markdown-body
element, and the page title (<title>
in <head>
) is set to the text of the first h1
element.
The default layout is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="https://unpkg.com/style.css">
</head>
<body>
<main class="markdown-body"></main>
</body>
</html>
The default layout comes bundled with style.css
, a classless stylesheet for markdown documents.
Markdown files ($f.md
, $f.markdown
) are lowercased and parsed into $f/index.html
files. Directory indexes can be disabled with the pretty: false
option. README.md
files are always converted to directory indexes (index.html
).
Relative links that point to markdown files ($f.md
, $f.markdown
) are rewritten as $f/
to point to their $f/index.html
equivalent.
Contributions welcome! Please read the contributing guidelines first.
Page image is from emojipedia.
5.1.3 - 2023-01-20
Maintenance update. Resolves security warnings for underlying dependency.
FAQs
Minimalist Markdown-based static site generator
The npm package sitedown receives a total of 54 weekly downloads. As such, sitedown popularity was classified as not popular.
We found that sitedown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Ā It has 3 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.