Skip to content

Commit

Permalink
Merge pull request #323 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu committed Jul 11, 2024
2 parents 03a71aa + a8c18db commit 5455ef4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-solitude",
"version": "1.13.2",
"version": "1.13.3",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"main": "package.json",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/filter/randomPosts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hexo.extend.filter.register('after_render:html', function (data) {
const posts = hexo.locals.get('posts').filter(post => post.random !== false).map(post => post.path);
data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ pjax.loadUrl('/'+posts[Math.floor(Math.random()*posts.length)]); }</script>`;
data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ pjax.loadUrl(GLOBAL_CONFIG.root+posts[Math.floor(Math.random()*posts.length)]); }</script>`;
return data;
});

0 comments on commit 5455ef4

Please sign in to comment.