Hexo + NexT Tips: Simplified Custom Pages Config that Doesn't Break Things
Regular custom pages
NexT documentation suggests creating a directory for each page and putting the content in the index.md
file under it:
# _config.next.yml |
The directory structure looks like:
. |
With this setting, both leading and trailing slashes in _config.next/yml
are optional.
A more elegant way to achieve the same behavior is:
. |
There's no need for subdirectory and index.md
; simply put page.md
under the source
directory. The configuration in _config.next.yml
stays the same.
Custom pages with header tabs
NexT Docs achieves a two-level header tabs style with the following configuration:
# _config.next.yml |
The directory structure looks like this:
. |
Apparently the authors used path of generated .html
files in the public
directory to access the tabs. The annoyance of having several subdirectories with only index.md
inside arises again when we only need a single level of header tabs. A more elegant configuration is as follows:
# _config.next.yml |
The directory structure looks like this:
. |
Suffix the path with .html
is still needed if you want to keep the header on top!
Note that in this scenario, both leading and trailing slashes are needed in the default:
path for the header tabs to be loaded.