Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主页及page里的文章,能在显示tag之外还显示category么? #188

Closed
shuyx opened this issue Nov 19, 2018 · 2 comments
Closed

Comments

@shuyx
Copy link

shuyx commented Nov 19, 2018

提出你对主题的建议(Suggest your idea)

主题很喜欢,但有个问题,主页和page页面里面,文章都只显示tag,没有显示目录。虽然在侧边栏我可以使用目录查看,但我希望每篇文章都能显示目录,这个功能可以做到么?是哪里需要修改一下么?

冒昧打扰,希望回复,多谢多谢

提出你觉得可行的解决方案 [可选](Describe the solution you'd like)

提出其他的你考虑到的点(Describe alternatives you've considered)

其他

@zchengsite
Copy link

zchengsite commented Dec 12, 2018

请问你是说每一篇文章页面右边显示的Catalog吗?
https://zcheng.site/sshkeys.html
如果你的需求是上面链接里文章展示的,只需要在你需要写成Catalog的字段上写上id
eg:
<h3 id="第一部分">一、第一部分</h3>
<h3 id="第二部分">二、第二部分</h3>
<h3 id="第三部分">三、第三部分</h3>

@LolipopJ
Copy link
Collaborator

LolipopJ commented Jul 7, 2021

以博客推送为例,在文章顶部通过如下代码引入标签:

<!-- layout/_partial/base-background-image.ejs -->
<!-- 文章页标签  -->
<% if(page.tags.length) { %>
    <%- partial('base-title-tags', {
        currPost: page,
        className: 'post-intro-tags'}) %>
<% } %>

其中,base-title-tags 代码如下:

<div class= <%- className %> >
    <% currPost.tags.forEach(function (tag, i) { %>
        <a class="post-tag" href="javascript:void(0);" data-tags = "<%- tag.name %>"><%- tag.name %></a>
    <% }) %>
</div>

对于传入的 page 对象里的 tags 属性中的每个值,渲染了一个 <a class="post-tag" href="javascript:void(0);" data-tags = "<%- tag.name %>"><%- tag.name %></a> 元素。

参考此实现,您可以自行编写显示 Category 的代码。

未来我们可能会加上此功能,并由用户决定要不要在显示 Tags 的基础上,显示 Category 信息。

LolipopJ added a commit that referenced this issue Jul 28, 2021
🛎️ One-click translation by Google. [中文更新内容](#305

## Merge PR

Merged #268 and #300.

## Feature

- Added **Dark mode** support, and can be switched by the button at \<header \/\>.
  Regarding the mode switch button, considering that the user is less likely to use it after use, it is put together with the link back to the home page and disappears after scrolling. In the future, you can put the same less frequently used search button or other helpful things here.
- Add **MathJax mathematical formula** support, and update related documents (#266).
- Added **Mermaid chart** support (#186).
- Add support for the personal information `sticky` of the homepage to scroll with the page (#202).
-Now you can set the category information of the corresponding article to be displayed on the homepage and article page (#188).
- It is now possible to hide the catalog of specific articles (#244).

## Change

- Adapt to Dark mode, adjust the spacing of text `padding`.
- For mobile, when scrolling to the top part of the page, add a dark background to the \<header \/\> part. Helps to avoid buttons being disturbed by page title information.
- The critical point of page scroll switching is selected as the junction of the header image and \<container \/\>.

## Optimization

- Add a fade-in and fade-out animation effect to the floating button.
- Add more configuration content for the timeliness of `outdated_threshold` articles. And keep the style sheet design consistent with the quote block part of the article.
- Add support for Hexo's `comments` property to the article. When set to `false`, the comment plugin will not be displayed for the article.
- When setting the post `sticky` property, the sticky icon will also be displayed.
- The Toc of the article page will be ready sooner.
- Optimize the configuration of Babel and Eslint.

## Fix

- When Algolia is enabled, the unprocessed icon content will no longer be displayed when the page has not been loaded.
- When opening the Algolia search interface, prevent page scrolling.
- Fix the alignment of social icon including Steam icon (#301).

## Chore

- Fixed the code format and indentation of all `.ejs` files in the `layout` directory.
- Use `const` instead of unnecessary `let` in the script file to make the code look more clever.
- Unify most of the CDN links as `cdn.jsdelivr.net`.
- Update third-party dependency packages including jQuery to fix compatibility issues; remove unnecessary or deprecated dependencies.
- Update the warehouse documentation and secondary development documentation.

## Known issues

In dark mode, when switching or refreshing the page, due to the reload of the `layout.ejs` file, the component \<div class="contain" \/\> will cause a short white screen. The expected situation is that in Dark mode, set its background color to dark before loading (such as \#121212)
Stark-X pushed a commit to Stark-X/hexo-theme-archer that referenced this issue Apr 1, 2024
🛎️ One-click translation by Google. [中文更新内容](fi3ework#305

## Merge PR

Merged fi3ework#268 and fi3ework#300.

## Feature

- Added **Dark mode** support, and can be switched by the button at \<header \/\>.
  Regarding the mode switch button, considering that the user is less likely to use it after use, it is put together with the link back to the home page and disappears after scrolling. In the future, you can put the same less frequently used search button or other helpful things here.
- Add **MathJax mathematical formula** support, and update related documents (fi3ework#266).
- Added **Mermaid chart** support (fi3ework#186).
- Add support for the personal information `sticky` of the homepage to scroll with the page (fi3ework#202).
-Now you can set the category information of the corresponding article to be displayed on the homepage and article page (fi3ework#188).
- It is now possible to hide the catalog of specific articles (fi3ework#244).

## Change

- Adapt to Dark mode, adjust the spacing of text `padding`.
- For mobile, when scrolling to the top part of the page, add a dark background to the \<header \/\> part. Helps to avoid buttons being disturbed by page title information.
- The critical point of page scroll switching is selected as the junction of the header image and \<container \/\>.

## Optimization

- Add a fade-in and fade-out animation effect to the floating button.
- Add more configuration content for the timeliness of `outdated_threshold` articles. And keep the style sheet design consistent with the quote block part of the article.
- Add support for Hexo's `comments` property to the article. When set to `false`, the comment plugin will not be displayed for the article.
- When setting the post `sticky` property, the sticky icon will also be displayed.
- The Toc of the article page will be ready sooner.
- Optimize the configuration of Babel and Eslint.

## Fix

- When Algolia is enabled, the unprocessed icon content will no longer be displayed when the page has not been loaded.
- When opening the Algolia search interface, prevent page scrolling.
- Fix the alignment of social icon including Steam icon (fi3ework#301).

## Chore

- Fixed the code format and indentation of all `.ejs` files in the `layout` directory.
- Use `const` instead of unnecessary `let` in the script file to make the code look more clever.
- Unify most of the CDN links as `cdn.jsdelivr.net`.
- Update third-party dependency packages including jQuery to fix compatibility issues; remove unnecessary or deprecated dependencies.
- Update the warehouse documentation and secondary development documentation.

## Known issues

In dark mode, when switching or refreshing the page, due to the reload of the `layout.ejs` file, the component \<div class="contain" \/\> will cause a short white screen. The expected situation is that in Dark mode, set its background color to dark before loading (such as \#121212)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants