2026-05-16 04:24:10 +08:00

8 lines
325 B
JavaScript

hexo.extend.helper.register('get_path', function() {
if (!this.page) return '/';
if (this.page.__post) return '/post/';
if (this.page.__index) return this.config.root || '/';
if (this.page.archive) return '/archives/';
if (this.page.category) return '/category';
if (this.page.tag) return '/tags/';
})