Data Files
Sometimes you may need to use some data in templates which is not directly available in your posts, or you want to reuse the data elsewhere. For such use cases, Hexo 3 introduced the new Data files. This feature loads YAML or JSON files in source/_data folder so you can use them in your site. For example, add menu.yml in source/_data folder. Home: / Gall..
Read moreFront-matter
Front-matter is a block of YAML or JSON at the beginning of the file that is used to configure settings for your writings. Front-matter is terminated by three dashes when written in YAML or three semicolons when written in JSON. YAML --- title: Hello World date: 2013/7/13 20:46:25 --- JSON "title": "Hello World", "date": "2013/7/13 20:46:25" ;;; Settin..
Read moreGenerating
Generating static files with Hexo is quite easy and fast. $ hexo generate Watch for File ChangesHexo can watch for file changes and regenerate files immediately. Hexo will compare the SHA1 checksum of your files and only write if file changes are detected. $ hexo generate --watch Deploy After GeneratingTo deploy after generating, you can run one of the..
Read moreGitHub Pages
In this tutorial, we use GitHub Actions to deploy GitHub Pages. It works in both public and private repository. Skip to the One-command deployment section if you prefer not to upload your source folder to GitHub. Create a repo named username.github.io, where username is your username on GitHub. If you have already uploaded to other repo, rename the repo i..
Read moreGitLab Pages
Create a new repository named username.gitlab.io, where username is your username on GitLab. If you have already uploaded to other repo, rename the repo instead. Enable Shared Runners via Settings -> CI / CD -> Shared Runners. Push the files of your Hexo folder to the repository. The public/ folder is not (and should not be) uploaded by default, mak..
Read more