I use the next theme, but I don’t want to modify the source files, so I use git submodule to check out the next theme. However, I want to add some JavaScript code to the page.

Actually, if you look at _config.next.yml, you will find out how to change it.

  • Create a _data folder under source
  • Create a footer.swig file under the _data folder
  • Add your JavaScript code to the footer.swig file
  • Change custom_file_path in _config.next.yml and add the footer.swig file to it

Done~
I simply added the coinimp code, and it was blocked by AdBlock as expected. Anyway, it is only for testing. Adjusted the throttle to 0.1 and turned on the prompt. If it’s blocked, let it be blocked…

我用的是next主题,但我不想修改源文件,所以用的gitsubmodule的方式引入next主题,但是我想在页面中添加一些JavaScript代码

其实看一下_config.next.yml就会发现怎么改。

  • 在source下创建一个_data文件夹
  • 在_data文件夹下创建一个footer.swig文件
  • 在footer.swig文件中添加你的JavaScript代码
  • 更改_config.next.yml文件中的custom_file_path,将footer.swig文件添加进去

完成~
我简单添加了一下coinimp的代码,然后果然被AdBlock拦截了,反正也只是测试用。截流调整到0.1,打开提示。拦截就被拦截吧……

I did a lot of things.

Learned Vue3 and Nuxt, tried dynamic routing, SSR and PWA, service worker is fun.
Learned React and Next.
Used Vercel, migrated blog from Netlify to Cloudflare Pages.

Watch an episode of anime tonight to relax. Continue to look at SSR tomorrow, then finish the AI project. Finally, everything back on track?

TODO:

  • Gym
  • Learn English
  • Go to supermarket
  • Update Resume
  • LeetCode

That should be it for now, quite a lot.

PS: Tried Cloudflare’s automatic deployment, it’s okay.

Supplement, problems encountered when deploying Hexo on Cloudflare Pages:
The default output directory is public, but the default directory of Cloudflare Pages is dist, so you need to modify the configuration file and change publicDir to dist.

做了好多事情啊。

Vue3学习使用了Nuxt,尝试使用了动态路由,ssr和pwa都尝试了一下,service worker挺好玩的
React学习使用了Next
使用了vercel,blog从netlify迁移到了cloudflare pages

今晚再看集动画放松一下,明天要把ssr继续看一下,然后把AI的那个项目搞了,最后的最后一切回归正轨?

TODO:

  • 健身
  • 学习英语
  • 去超市
  • 更新简历
  • LeetCode

应该就先这些吧,挺多的了

PS:试了下cloudflare的自动部署,还好

补充一下,cloudflare pages的部署Hexo遇到的问题:
默认产出的目录是public,但是cloudflare pages的默认目录是dist,所以需要修改一下配置文件,修改publicDir为dist即可

Sorted alphabetically.

Extension Description
Angular Language Service Angular Language Service
Apollo GraphQL for VS Code Apollo GraphQL
Auto Close Tag Auto Close Tag
Auto Complete Tag Auto Complete Tag
Auto Rename Tag Auto Rename Tag
Formatter extension for Visual Studio Code using autopep8 Python Code Formatter
Chinese (Simplified) Language Pack for Visual Studio Code Chinese (Simplified) Language Pack
Code Runner Code Runner
Conventional Commits Conventional Commits
CSScomb CSScomb
Dart Dart
Debugger for Java Java Debugger
Dev Containers Dev Containers
Docker Docker
Dracula Official Dracula Theme
ES7+ React/Redux/GraphQL/React-Native snippets React Snippets
ESLint ESLint
Extension Pack for Java Java Extension Pack
GitHub Copilot GitHub Copilot
GitHub Pull Requests and Issues GitHub Pull Requests and Issues
GitHub Theme GitHub Theme
GitLens — Git supercharged GitLens
Gradle for Java Gradle
Import Cost Import Cost
indent-rainbow Indent Rainbow
IntelliCode IntelliCode
IntelliCode API Usage Examples IntelliCode API Usage Examples
JSON JSON
Language Support for Java(TM) by Red Hat Java Language Support
Live Server Live Server
Makefile Tools Makefile
Markdown All in One Markdown All in One
Markdown Preview Enhanced Markdown Preview Enhanced
Maven for Java Maven
PHP Server PHP Server
Prettier - Code formatter Prettier
Prettify JSON Prettify JSON
Project Manager for Java Java Project Manager
Pylance Pylance
Python Python
Red Hat Dependency Analytics Red Hat Dependency Analytics
Remote - SSH SSH
Remote - SSH: Editing Configuration Files SSH Config Editor
Remote - Tunnels SSH Tunneling
Remote Development Remote Development
Remote Explorer Remote Explorer
REST Client REST Client
Tabnine: AI Code Completion Tabnine
Test Runner for Java Java Test Runner
TODO Highlight TODO Highlight
VSCode Great Icons VSCode Great Icons
vscode-icons VSCode Icons
vscode-pdf PDF
Vue Language Features Vue Language Features
WSL WSL

按照字母顺序排列。

插件 说明
Angular Language Service Angular 语言服务
Apollo GraphQL for VS Code Apollo GraphQL
Auto Close Tag 自动闭合标签
Auto Complete Tag 自动补全标签
Auto Rename Tag 自动重命名标签
Formatter extension for Visual Studio Code using autopep8 Python 代码格式化
Chinese (Simplified) Language Pack for Visual Studio Code 中文语言包
Code Runner 代码运行
Conventional Commits Conventional Commits
CSScomb CSScomb
Dart Dart
Debugger for Java Java 调试器
Dev Containers Dev Containers
Docker Docker
Dracula Official Dracula 主题
ES7+ React/Redux/GraphQL/React-Native snippets React 代码片段
ESLint ESLint
Extension Pack for Java Java 扩展包
GitHub Copilot GitHub Copilot
GitHub Pull Requests and Issues GitHub Pull Requests and Issues
GitHub Theme GitHub 主题
GitLens — Git supercharged GitLens
Gradle for Java Gradle
Import Cost Import Cost
indent-rainbow 缩进彩虹
IntelliCode IntelliCode
IntelliCode API Usage Examples IntelliCode API Usage Examples
JSON JSON
Language Support for Java(TM) by Red Hat Java 语言支持
Live Server Live Server
Makefile Tools Makefile
Markdown All in One Markdown All in One
Markdown Preview Enhanced Markdown Preview Enhanced
Maven for Java Maven
PHP Server PHP Server
Prettier - Code formatter Prettier
Prettify JSON Prettify JSON
Project Manager for Java Java 项目管理器
Pylance Pylance
Python Python
Red Hat Dependency Analytics Red Hat Dependency Analytics
Remote - SSH SSH
Remote - SSH: Editing Configuration Files SSH 配置文件编辑
Remote - Tunnels SSH 端口转发
Remote Development 远程开发
Remote Explorer 远程资源管理器
REST Client REST Client
Tabnine: AI Code Completion Tabnine
Test Runner for Java Java 测试运行器
TODO Highlight TODO 高亮
VSCode Great Icons VSCode Great Icons
vscode-icons VSCode Icons
vscode-pdf PDF
Vue Language Features Vue 语言特性
WSL WSL
0%