Skip to content

heptarri/heptarri.github.io

Repository files navigation

Heptari's Notes

A tiny, dependency-light static blog. No framework — just Node, markdown-it, and a few hundred lines of plain JavaScript and CSS. Visual style is minimalist and cool-toned (slate / steel blue), inspired by the plainness of https://www.1a-insec.net/.

What makes it tick

  • The directory is the table of contents. Drop a .md file into any folder under blog/ and it becomes a page; the sidebar and the /all/ index are generated from the disk tree.
  • One config file. Everything you'd reasonably want to tweak — site title, navigation, home page intro, sidebar pinning / rename rules — lives in site.config.mjs.
  • Zero client-side runtime. Pure static HTML + one CSS file. No JS shipped to the browser. No fonts loaded from a CDN. No tracking.

Project layout

.
├── site.config.mjs         # USER CONFIG — edit this for content / navigation
├── build.mjs               # the static site generator (walks blog/ → dist/)
├── serve.mjs               # tiny zero-dep preview server
├── templates/              # HTML templates
│   ├── layout.mjs          # base shell (header / sidebar / footer)
│   ├── home.mjs            # home page renderer
│   ├── page.mjs            # article renderer
│   ├── filetree.mjs        # /all/ page + sidebar renderer
│   └── util.mjs            # HTML escaping, inline markdown
├── theme/
│   └── style.css           # cool-toned theme (light + dark via media query)
├── blog/                   # YOUR CONTENT
│   ├── about.md            # becomes /about/
│   ├── ARM Cortex-M/       # any folder = a category
│   │   ├── ARM 汇编.md     # any .md = a page
│   │   └── assets/         # `assets/` next to articles is copied verbatim
│   └── ...
└── dist/                   # build output (gitignored)

Usage

npm install        # install dev deps: markdown-it, anchor, attrs, chokidar
npm run build      # build dist/
npm run serve      # build, then serve dist/ at http://localhost:4000
npm run watch      # rebuild on every change

Customizing

Open site.config.mjs. Everything is documented inline. Highlights:

  • site.title, site.description, site.lang, site.author
  • site.nav — top-bar links
  • site.socialLinks — footer links
  • home.taglines — the rotating one-liner shown above the intro (first one is the current; the rest go into a "[Past taglines]" disclosure)
  • home.intro — your free-form intro paragraphs (inline markdown OK)
  • home.sections — bulleted lists shown below the intro
  • sidebar.ignore — basenames to exclude from the sidebar / /all/ index
  • sidebar.order — top-level categories pinned to the top of the sidebar
  • sidebar.rename — display-name overrides (e.g. translate folder names)

Add a new category by creating a new folder under blog/. Add a new article by dropping a .md file anywhere under blog/. No config changes are required for new content.

License

Theme CSS and the SSG (build script, templates, server): MIT. Your prose under blog/ is yours; the example content here is licensed CC BY-SA 4.0.

About

Heptari's Docs about developments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors