- Resources page with descriptions and links to my repos etc.
build.py builds the whole site into _site/. The deploy workflow and local_test.sh both use it.
- Preview locally:
./local_test.shbuilds the site, serves it at http://localhost:8000 and removes_site/on Ctrl+C. Requiresmdbookand, for blog preview images, Pillow (pip install pillow). - Blog link previews: each post gets its own preview tags automatically. The title and description come from the posts table in the book's
introduction.md, and the image comes from the post's first image. A new post only needs its row in that table. - Add a page: create a top-level directory with an
index.html(e.g.projects/index.html). It is published automatically. - Shared markup: put it in
partials/and include it with<!-- @include partials/name.html -->on its own line. The nav and footer work this way. - Nav links: each link in
partials/nav.htmlneedsclass="nav-link" data-path="/section/". The build marks the current page's link as active. - Assets: reference files as
/assets/...insrc/hrefattributes. The build appends a content hash (?v=1a2b3c4d) so browsers always fetch the current version after a deploy.
Steps to build highlight.js:
-
Clone
highlight.jsproject:git clone https://github.com/highlightjs/highlight.js.git cd highlight.js -
Copy Q language file to
src/languages/cp .../src/blog/theme/q.js ./src/languages/.
-
Install dependenies:
npm install
-
Build with desired languages:
node tools/build.js -t browser javascript python bash c q -
Copy to project:
cp ./build/highlight.min.js .../src/blog/theme/highlight.js