Local variables are used for template rendering, which is the site
variable in templates.
Variable | Description |
---|---|
posts |
All posts |
pages |
All pages |
categories |
All categories |
tags |
All tags |
hexo.locals.get('posts')
hexo.locals.set('posts', function(){
return ...
});
hexo.locals.remove('posts');
hexo.locals.toObject();
hexo.locals.invalidate();