Website for SymbioticLab.
Built using Hexo.
The news entry on the front page are simply posts with the special News category. New posts can be created
by running
node_modules/.bin/hexo new news "News Title"
nvm is recommended.
You can start a server locally.
npm start
It will automatically pick up most modifications to posts. So a simple refresh will show the latest content.
When it's not picking up your modifications, do a clean build:
npm run clean && npm start
Source code is in the develop branch. Commits to this branch will be automatically built and pushed to the master branch, which will then be served at https://SymbioticLab.github.io.
The site is based on hexo-theme-next, with the following tweaks:
- Small tweaks in css styling are in custom/*.styl. They are read by the theme and merged with theme's own styling.
- Publist tag plugin provided by hexo-next-publist. This powers the publication list inpublication/index.md.
- Custom page layout injected using hexo-extend-theme. The templatescustom/layouts/*.njkcan be used by setting the layout name in the front matter.
- Paginated front page with news. This uses a simple generator in scripts/front-page-generator.jsto generate multiple routes which are then rendered using a custom page layoutcustom/front.njk. The generator also reads insource/_front.mdfor contents before the news section.
- Posts with empty body are skipped. They will only show up in the list, but no link is generated. This is done by scripts/skip-empty.js.
- A fix to the pjax scroll position restoration, by replacing the theme layout file _scripts/index.njkwith our own version. Ideally, we only want to replace_scripts/pjax.njk, but due to limitations inhexo-extend-theme, that's not possible. Becausepjax.njkis pulled in by theincludetag, rather than thepartialhelper.
Page styles can be modified in custom/styles.styl and custom/variables.styl. More is possible and the theme-next documentation has more details.
This is a standalone plugin hexo-next-publist. The plugin provides a publist tag which can be used as normal
in the markdown.
Tweaks can be made in its own repo. @Aetf will maintain the plugin.
hexo-extend-theme makes it possible to develop or override theme's layout templates.
Layout templates in custom/layouts/*.njk will have higher priority than theme's builtin ones in node_modules/hexo-theme-next/layouts/*.
By default, a post (source/_posts/*.md) uses post.njk and other markdowns uses page.njk.
To create a new page with custom layout, follow the steps below:
- Create a new layout template under custom/layouts/my-custom.njk
- Create a new markdown file at desired location under sourceand setlayout: my-customin front matter
---
title: A new page
layout: my-custom
date: 2020-01-01
---
This is my new page!