记录遇到的问题的 notion 笔记本.

The way to avoid confilcts when building hexo with netlify

Issues descriptions

When building hexo blog with some external themes (e.g. nexT) in netlify, some buliding conflicts may occour that say:

1:15:31 PM: Preparing Git Reference refs/heads/master
1:15:32 PM: Error checking out submodules: fatal: No url found for submodule path 'themes/next' in .gitmodules
1:15:32 PM: Failing build: Failed to prepare repo
1:15:32 PM: failed during stage 'preparing repo': Error checking out submodules: fatal: No url found for submodule path 'themes/next' in .gitmodules
: exit status 128
1:15:32 PM: Finished processing build request in 5.417924351s

Generally speaking, this confilct happens when you hexo theme folder has .git file which may leads to git workflow mismatchs with netlify.

One simple way to solve conflict issues

There are two basic princlples there, one is building hexo normally with netlify, another is that we can control the version of nexT theme.

According to the Data Files Feature, we simplely solve as below.

First Step

Download the nexT theme via the official methods, make sure download the source codes of nexT theme without .git file (e.g. download with Option one).

Second Step

Using Data Files feature to set your own preferences setting in _config.yml in ****the main hexo folder rather than setting the theme configuation _config.yml inside nexT theme folder.

For example, we add like below, remeber the two indents spaces

# Data-file type setting for theme

theme_config:
    # Schemes
    scheme: Pisces

We do not need to modify the stuffs inside the nexT theme folder, we can just copy the setting statments we want to the main hexo _config.yml.

Next time, when the nexT theme is updated, replacing it is just ok without touching our preferences setting.