Project template·Pro
Markdown static site
Write pages in Markdown and build them into a static HTML site with a shared layout and menu. The build is about 110 lines of Node.js you can edit, and its only package is marked. You open the result in the DevBrowser. The first npm install needs the Linux environment.
You need PocketCode Pro to install it.
If PocketCode is installed on your Android device, this opens the page in the app.
Preview
Files
README.md
build.js
content/about.md
content/guide.md
content/index.md
lib/site.js
package-lock.json
package.json
static/style.css
templates/layout.html
test/site.test.jsREADME.md
# Markdown site: static pages built with Node.js Write pages in Markdown and turn them into a small static site: every file in `content/` becomes an HTML page with the same layout and a menu that links them all. `build.js` and `lib/site.js` add up to about 110 lines you can read and change, and the only package is [marked](https://marked.js.org), the Markdown parser. The output is plain HTML and CSS, with no JavaScript, so it works on any static host. Comes with tests. ## Run it in PocketCode 1. Install marked once. Open the terminal in this project's folder (Open Terminal Here, in the editor menu) and run this in the app's Linux environment with Node.js and npm (the Developer pack in Terminal › Linux); it needs internet: ```sh npm install ``` 2. Build the site: open `build.js` and tap Run, or in the terminal: ```sh npm run build ``` The output lists the pages it wrote to `site/`. 3. Open `site/index.html` in the editor and tap the DevBrowser button to see it. The menu links work between pages. After you edit a Markdown file, build again and reload the DevBrowser. In the terminal, `npm run watch` builds again on every save. ## Add a page Create a file in `content/`, for example `content/projects.md`: ```markdown --- title: Projects order: 3 --- # Projects What I am working on. See the [about page](about.md). ```This preview is shortened. You get the full content when you install it.
Changes in 1.0.0
First version.