tufu9441 / maupassant-hexo

A simple Hexo theme forked from icylogic.
https://www.haomwei.com
MIT License
2.63k stars 669 forks source link

Allow overriding menu, widgets, and links from outside theme directory #500

Closed jessemcdowell closed 2 years ago

jessemcdowell commented 3 years ago

I'd like to control my maupassant configuration outside of the theme directory (see https://hexo.io/docs/configuration#Alternate-Theme-Config). For most of the settings this works fine. For the menu, widgets, and links settings, however, the resulting merged config makes it impossible to remove items.

For example. In my _config.maupassant.yaml file, I have the following:

widgets:
- search
- tag
- links

In the themes/maupassant/_config.yaml file, there is the following default:

widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links.
  - search
  - category
  - tag
  - recent_posts
  - recent_comments
  - links

When I run hexo serve, I see the following list of widgets:

If I try appending - NULL to my lists, I get errors. The only workaround I've found so far is to comment out the contents in the themes/maupassant/_config.yaml file, but this obviously defeats the purpose.

I'm using:

tufu9441 commented 3 years ago

I am sorry that I haven't used the alternate-theme-config of Hexo yet, so I cannot clarify the reason for your problems at present, maybe there are some syntax conflicts in those .pug files of the widgets.