next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.38k stars 421 forks source link

Add a timer(添加时间统计功能) #280

Closed lipcaty closed 3 years ago

lipcaty commented 3 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

希望网页具有计时器功能。我想添加一个恋爱时间统计的东西,但是我不知道怎么写代码,也不知道有没有这个功能。我有看到很多html网页有这个功能,但不是通过hexo渲染.md文件生成的。

如果能帮我把下面的html文件转换成可用的md文件也非常感谢!想要转换的html文件内容如下:

<!doctype html>

love

njzjz commented 3 years ago

Markdown supports HTML tags, so it's not necessary to convert it.

lipcaty commented 3 years ago

Markdown supports HTML tags, so it's not necessary to convert it.

What do you mean?I know Markdown support some html tags, while the above html code deals with some functions, which seems not supported by Markdown. I copied the above code into the body part of "index.md", but after I ran the command "hexo g&& hexo s", it appeared nothing!

Can you help me modify the above code, which was copied from the page https://blog.csdn.net/webhhhhhh/article/details/103795746, into a markdown file that can be successfully executed? Thanks in advance!

njzjz commented 3 years ago

There may be some render problems to use inline scripts. However, it's not a problem to use some external scripts. For example, you may add script tag into markdown file

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/njzjz/gist@next-280/280.min.css">
<h1 id="h1"></h1>
<canvas></canvas>
<script src="https://cdn.jsdelivr.net/gh/njzjz/gist@next-280/280.min.js"></script>

and the script will works fine.

image

Note that this style may break the NexT theme.

lipcaty commented 3 years ago

Yes, now the script works, but I want to change the Chinese sentences "哈哈,....". Can I use a local script?

@.***

发件人: Jinzhe Zeng 发送时间: 2021-05-24 21:17 收件人: next-theme/hexo-theme-next 抄送: Li Pengcheng; Author 主题: Re: [next-theme/hexo-theme-next] Add a timer(添加时间统计功能) (#280) There may be some render problems to use inline scripts. However, it's not a problem to use some external scripts. For example, you may add script tag into markdown file <link rel="stylesheet" @.***/280.min.css">

<script @.***/280.min.js"> and the script will works fine. Note that this style may break the NexT theme. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jiangtj commented 3 years ago

https://developer.mozilla.org/zh-CN/

This is the document I often read

ljcbaby commented 3 years ago

Yes, now the script works, but I want to change the Chinese sentences "哈哈,....". Can I use a local script? @. 发件人: Jinzhe Zeng 发送时间: 2021-05-24 21:17 收件人: next-theme/hexo-theme-next 抄送: Li Pengcheng; Author 主题: Re: [next-theme/hexo-theme-next] Add a timer(添加时间统计功能) (#280) There may be some render problems to use inline scripts. However, it's not a problem to use some external scripts. For example, you may add script tag into markdown file <link rel="stylesheet" @./280.min.css">

<script @.***/280.min.js"> and the script will works fine. Note that this style may break the NexT theme. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Obviously can. You can place the js file and the css file in the appropriate location under the _source folder and reference it.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.