Skip to content
No description, website, or topics provided.
CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
default.yaml
index.js
moon-menu.styl
moon-menu.swig
package.json
yarn.lock

README.md

hexo-cake-moon-menu

This plugin from hexo-theme-inside, thank ike-c.

npm Theme Theme

Want to use in muse/mist see moon-menu-for-muse-mist-example

Preview

image image image image

How to use

yarn add hexo-cake-moon-menu

Config

You can config by moon_menu in hexo theme or data config files.

In hexo or theme:

moon_menu:
  back2top:
    enable: true
  back2bottom:
    enable: true

In moon_menu.yml data file:

back2top:
  enable: true
back2bottom:
  enable: true

You can find more info in default config file.

Custom

It's easy to add new button in moon-menu.

Here's an example about add gitter sidecar.

  1. Add custom head
hexo.extend.filter.register('theme_inject', function(injects) {
  injects.head.file('sidecar', 'views/sidecar.swig', {}, {cache: true});
});
  1. In views/sidecar.swig, create custom function
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
<script>
  ((window.gitter = {}).chat = {}).options = {
    room: 'your-room-name',
    activationElement: false
  };
  // create custom function
  var openGitter = function() {};
  document.addEventListener('gitter-sidecar-ready', function(e) {
    var GitterChat = e.detail.Chat;
    var chat = new GitterChat({
      room: 'your-room-name',
      activationElement: false
    });
    openGitter = () => {
      chat.toggleChat(true);
    }
  });
</script>
  1. Add config
moon_menu:
  chat:
    icon: fa fa-comments
    func: openGitter

Debug

# init this project
yarn install
yarn link
# get example
git clone --recursive git@github.com:jiangtj-lab/hexo-theme-cake-example.git example
cd example
yarn install
# add test link
yarn add hexo-cake-moon-menu
yarn link hexo-cake-moon-menu
# run, see http://localhost:4000
hexo s
You can’t perform that action at this time.