You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already searched for current issues, which does not help me.
Expected behavior
Only config in _config.next.yml, according to the theme's doc: Related-Popular-Posts
Actual behavior
When tried to customize the threshold & detailed weight config of the hexo-related-post plugin, I found that I need to config _config.yml and _config.next.yml both.
I've tried debug in WebStorm, when the plugin calculated the related posts, it would read from _config.yml, but when the theme rendered the pages, it would then read from _config.next.yml.
Steps to reproduce the behavior
Generate more than 5 posts.
Only config in _config.yml, use the following config:
This sample config set a very low filter_threshold (can set to 0 as well), but very high weight, so the expected result is that each post should have 5 related posts.
And we can see the plugin do calculate the related posts:
Debug Result:
However, the detailed pages didn't have these related posts.
Config in _config.next.yml as well, you can see the related posts then.
# Hexo Configuration## Docs: https://hexo.io/docs/configuration.html## Source: https://github.com/hexojs/hexo/# Sitetitle: Erispyu's Blogsubtitle: ''description: ''keywords:
author: Erispyulanguage: entimezone: ''# URL## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'url: https://erispyu.github.io#permalink: :year-:month-:day-:title/permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinkstrailing_html: true # Set to false to remove trailing '.html' from permalinks# Directorysource_dir: sourcepublic_dir: publictag_dir: tagsarchive_dir: archivescategory_dir: categoriescode_dir: downloads/codei18n_dir: :langskip_render:
# Writingnew_post_name: :title.md # File name of new postsdefault_layout: posttitlecase: false # Transform title into titlecaseexternal_link:
enable: true # Open external links in new tabfield: site # Apply to the whole siteexclude: ''filename_case: 0render_drafts: falsepost_asset_folder: falserelative_link: falsefuture: truehighlight:
enable: trueline_number: falseauto_detect: falsetab_replace: ''wrap: truehljs: falseprismjs:
enable: falsepreprocess: trueline_number: truetab_replace: ''# Home page setting# path: Root path for your blogs index page. (default = '')# per_page: Posts displayed per page. (0 = disable pagination)# order_by: Posts order. (Order by date descending by default)index_generator:
path: ''per_page: 10order_by: -date# Category & Tagdefault_category: uncategorizedcategory_map:
tag_map:
# Metadata elements## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/metameta_generator: true# Date / Time format## Hexo uses Moment.js to parse and display date## You can customize the date format as defined in## http://momentjs.com/docs/#/displaying/format/date_format: YYYY-MM-DDtime_format: HH:mm:ss## updated_option supports 'mtime', 'date', 'empty'updated_option: 'mtime'# Pagination## Set per_page to 0 to disable paginationper_page: 10pagination_dir: page# Include / Exclude file(s)## include:/exclude: options only apply to the 'source/' folderinclude:
exclude:
ignore:
# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: next# Deployment## Docs: https://hexo.io/docs/one-command-deploymentdeploy:
type: gitrepo: https://github.com/erispyu/erispyu.github.iobranch: hexoname: erispyuemail: erispyu@gmail.com# Post wordcount display settings# Dependencies: https://github.com/next-theme/hexo-word-countersymbols_count_time:
symbols: truetime: truetotal_symbols: truetotal_time: trueexclude_codeblock: falseawl: 4wpm: 275suffix: "mins."algolia:
applicationID: "2BILQUWIOA"apiKey: "f5aabb895c10440c28e6c77090f511eb"indexName: "github_page_erispyu"# https://github.com/ohroy/hexo-abbrlinkpermalink: posts/:abbrlink/abbrlink:
alg: crc32rep: hexdrafts: falseforce: falsewriteback: truerelated_posts:
enable: trueicon: fa fa-signs-postfilter_threshold: 0.001related_count: 5weight:
title: 0.1author: 2description: 0.08keywords: 0.05tags: 0.1categories: 0.05text: 1
NexT Configuration
# ---------------------------------------------------------------# Menu Settings# ---------------------------------------------------------------# Usage: `Key: /link/ || icon`# Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-sensitive.# Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon.# External url should start with http:// or https://menu:
home: / || fa fa-homeabout: /about/ || fa fa-usertags: /tags/ || fa fa-tagscategories: /categories/ || fa fa-tharchives: /archives/ || fa fa-archiveReading Progress: /reading-progress/ || fa fa-book-openStats: /stats/ || fa fa-bar-chart#schedule: /schedule/ || fa fa-calendar#sitemap: /sitemap.xml || fa fa-sitemap#commonweal: /404/ || fa fa-heartbeat# ---------------------------------------------------------------# Scheme Settings# ---------------------------------------------------------------# Schemesscheme: Muse# scheme: Mist# scheme: Pisces# scheme: Pisces# Dark Modedarkmode: true# ---------------------------------------------------------------# Site Information Settings# ---------------------------------------------------------------# Creative Commons 4.0 International License.# See: https://creativecommons.org/about/cclicenses/creative_commons:
# Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zerolicense: by-nc-sa# Available values: big | smallsize: bigsidebar: truepost: true# You can set a language value if you prefer a translated version of CC license, e.g. deed.zh# CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.orglanguage:
# ---------------------------------------------------------------# Sidebar Settings# See: https://theme-next.js.org/docs/theme-settings/sidebar# ---------------------------------------------------------------# Table of Contents in the Sidebar# Front-matter variable (nonsupport wrap expand_all).toc:
enable: true# Automatically add list number to toc.number: false# If true, all words will placed on next lines if header width longer then sidebar width.wrap: false# If true, all level of TOC in a post will be displayed, rather than the activated part of it.expand_all: false# Maximum heading depth of generated toc.max_depth: 6# ---------------------------------------------------------------# Custom Page Settings# See: https://theme-next.js.org/docs/theme-settings/custom-pages# ---------------------------------------------------------------# TagCloud settings for tags page.tagcloud:
min: 12# Minimum font size in pxmax: 30# Maximum font size in pxamount: 200# Total amount of tagsorderby: date # Order of tagsorder: 1# Sort order# ---------------------------------------------------------------# Misc Theme Settings# See: https://theme-next.js.org/docs/theme-settings/miscellaneous# ---------------------------------------------------------------codeblock:
# Add copy button on codeblockcopy_button:
enable: true# Available values: default | flat | macstyle: defaultback2top:
enable: true# Back to top in sidebar.sidebar: false# Scroll percent label in b2t button.scrollpercent: true# ---------------------------------------------------------------# Animation Settings# ---------------------------------------------------------------# Use the Canvas Nest animation# For more information: https://github.com/theme-next/theme-next-canvas-nestcustom_file_path:
#head: source/_data/head.swig#header: source/_data/header.swig#sidebar: source/_data/sidebar.swig#postMeta: source/_data/post-meta.swig#postBodyEnd: source/_data/post-body-end.swigfooter: source/_data/footer.swig#bodyEnd: source/_data/body-end.swig#variable: source/_data/variables.styl#mixin: source/_data/mixins.styl#style: source/_data/styles.stylsocial:
GitHub: https://github.com/erispyu || fab fa-githubE-Mail: mailto:erispyu@gmail.com || fa fa-envelopeGoodreads: https://www.goodreads.com/user/show/156410162-erispyu || fa fa-book-readerDouban: https://www.douban.com/people/erispyu00/ || fa fa-film# Algolia Searchalgolia_search:
enable: truehits:
per_page: 10tag_icon: true#related_posts:# enable: true# icon: fa fa-signs-post# filter_threshold: 0.001# related_count: 5# weight:# title: 0.1# author: 2# description: 0.08# keywords: 0.05# tags: 0.1# categories: 0.05# text: 1
Other Information
No response
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue, maintainers will get back to you as soon as possible!
erispyu
changed the title
need to config related_posts filter_threshold & weight both in _config.yml and _config.next.yml
need to config Related-Popular-Posts both in _config.yml and _config.next.yml
Jan 3, 2025
Issue Checklist
Expected behavior
Only config in
_config.next.yml
, according to the theme's doc: Related-Popular-PostsActual behavior
When tried to customize the
threshold
& detailedweight
config of the hexo-related-post plugin, I found that I need to config_config.yml
and_config.next.yml
both.I've tried debug in WebStorm, when the plugin calculated the related posts, it would read from
_config.yml
, but when the theme rendered the pages, it would then read from_config.next.yml
.Steps to reproduce the behavior
_config.yml
, use the following config:This sample config set a very low
filter_threshold
(can set to0
as well), but very highweight
, so the expected result is that each post should have 5 related posts.And we can see the plugin do calculate the related posts:
Debug Result:
![截屏2025-01-03 14 59 14](https://private-user-images.githubusercontent.com/57878455/399881997-950d92a5-f263-4884-b3fc-72db0d362ba9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzQyODQsIm5iZiI6MTczOTM3Mzk4NCwicGF0aCI6Ii81Nzg3ODQ1NS8zOTk4ODE5OTctOTUwZDkyYTUtZjI2My00ODg0LWIzZmMtNzJkYjBkMzYyYmE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE1MjYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg3YTMxODhlNGQ1YzU5YWY2NWU5NzYyYzA1ODYxMWRmOGQyYTg0YWRhYTM2N2NlZjEwNjViODJhOTU3ZmY0ODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Q1NLbvXAVkn5IPHOisd6uHNVbpPSpb3t3O-vGlwAPfk)
However, the detailed pages didn't have these related posts.
![截屏2025-01-03 15 00 10](https://private-user-images.githubusercontent.com/57878455/399882132-c0dc8dd1-271a-4c8e-a650-db8b904820d8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzQyODQsIm5iZiI6MTczOTM3Mzk4NCwicGF0aCI6Ii81Nzg3ODQ1NS8zOTk4ODIxMzItYzBkYzhkZDEtMjcxYS00YzhlLWE2NTAtZGI4YjkwNDgyMGQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE1MjYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAyZTU1YWEzNjQzNDYwMDYwYzA2ODUxNGUzYWRlYjI0YWY5MmU5OTg4MTZmYzU3ODRkZTZmYmFjZjk3ZjE3ODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HWGVLQitA7hgaIn0wV9nPGTYBp_Y-8DfTUarfzBAO_g)
_config.next.yml
as well, you can see the related posts then.Node.js and NPM Information
Package dependencies Information
Hexo Configuration
NexT Configuration
Other Information
No response
The text was updated successfully, but these errors were encountered: