-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ tags: | |
- 博客 | ||
--- | ||
|
||
::: zh-CN | ||
|
||
死掉了快一年的博客堂堂复活 记录一下折腾的过程 | ||
|
||
其实本来在今年4月份的时候想复活一下 不过拖了下来 | ||
|
@@ -136,3 +138,117 @@ tags: | |
|
||
以上。 | ||
|
||
::: | ||
|
||
::: en | ||
|
||
Resurrecting the long-dead blog after almost a year. Documenting the process of tinkering. | ||
|
||
Originally, I planned to revive it in April of this year, but it got delayed. | ||
|
||
# Resurrecting Node.js | ||
|
||
Since I forgot that I installed `Node.js` with `Brew`, it got deleted after I completely uninstalled `Brew`. It wasn't until I ran `npm --version` and got "Command not found" that I realized my foolish mistake. This time, I skipped using `Brew` and downloaded the pkg package from the [USTC Mirror](https://mirrors.ustc.edu.cn/node/latest-v20.x/). | ||
|
||
# Reinstalling the Theme | ||
|
||
Here comes this damn process again. It's time to release this meme once more. | ||
|
||
 | ||
|
||
But I've become a bit smarter this time and used `pnpm`. One significant issue with `npm` is that it doesn't tell you anything when installing packages; it just silently works. For example, it might throw a classic line like "sill idealTree buildDeps" and then ignore you. `pnpm` is better at this; it outputs lines like "Progress: resolved 553, reused 532, downloaded 0, added 0," at least letting you know it's not stuck. | ||
|
||
Of course, there's another reason here. | ||
|
||
## Migrating from Hexo to Valaxy | ||
|
||
I opened my familiar [hexo-theme-yun](https://github.com/YunYouJun/hexo-theme-yun) and exclaimed, "WTF." | ||
|
||
This is why I delayed so much. In April, `Valaxy` and `valaxy-theme-yun` were not complete, and the theme documentation was basically nonexistent. In my state of confusion, I attempted to migrate configurations and ended up failing. | ||
|
||
In December, near the end of 2023, when I revisited it, the documentation ([Migration Configuration Guide](https://valaxy.site/migration/hexo#%E8%BF%81%E7%A7%BB%E9%85%8D%E7%BD%AE)) had improved a lot. The kind YunYouJun even added type hints (thank you so much). | ||
|
||
So, I copied the configurations line by line from my previous `hexo` setup. During this process, I encountered several issues. Here are the main ones: | ||
|
||
### Changing the Sidebar Background Image | ||
|
||
Originally, this setting was in `_config.yun.yaml`. The corresponding file should be `valaxy.config.ts`, but I couldn't find it. It wasn't until I dug into the documentation in the obscure location `node_modules/.pnpm/[email protected]/node_modules/valaxy-theme-yun/docs/zh-CN/config.md` that I found a line: | ||
|
||
> You can create `styles/css-vars.scss` to override default CSS variables. | ||
Along with the code example: | ||
|
||
> ```scss | ||
> :root { | ||
> /* Background image */ | ||
> --yun-bg-img: url("https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg"); | ||
> /* Sidebar background image */ | ||
> --yun-sidebar-bg-img: url("https://cdn.yunyoujun.cn/img/bg/alpha-stars-timing-1.webp"); | ||
> } | ||
> ``` | ||
I was dumbfounded. | ||
### ICP Filing Default Hyperlink Issue | ||
The theme provided a location for the filing number. Clicking on the filing number would link to https://beian.miit.gov.cn/, which looked good. However, being a "moe" person, I was using [Moe Country ICP Filing](https://icp.gov.moe/). So, I checked if I could change it. | ||
It wasn't until I looked into the file `YunFooter.vue`, an easily accessible file, and found these lines of code: | ||
```vue | ||
<div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2"> | ||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener"> | ||
{{ themeConfig.footer.beian.icp }} | ||
</a> | ||
</div> | ||
``` | ||
I don't know how many times I died on the spot. | ||
|
||
This issue is still unresolved, but probably no one has the time to play around with filing numbers. | ||
|
||
### Magical Github Actions | ||
|
||
When I was exhausted from migrating all configurations and ready to deploy, another problem arose. I happily connected to the remote branch and did a `git commit` and `git push origin main`. | ||
|
||
I opened the blog homepage and was confused. Why didn't it change??? | ||
|
||
My first thought was whether Actions didn't run, so I casually looked at the repository and saw that Actions had indeed run. But the problem was here. | ||
|
||
At that time, I vaguely saw an Actions running and just closed the tab. Later, I really wanted to ask myself at that time, did you check the name of the Actions? (See the image below) | ||
|
||
 | ||
|
||
So, I checked the local project's `.github/workflows/gh-pages.yml` file and couldn't find the problem after looking for a long time. | ||
|
||
Just when I was puzzled, I thought of putting this problem aside. Because I saw that `.DS_Store` was uploaded. | ||
|
||
So, I deleted this file from the remote repository and added a line to the `.gitignore` file locally. | ||
|
||
Suddenly, I glanced at a familiar name. | ||
|
||
 | ||
|
||
Deng deng dong. | ||
|
||
I'm not sure whose fault it is, but it's probably VSCode's doing. | ||
|
||
After deleting it and uploading again, I realized that I mistook Github Pages' default Actions for my own. | ||
|
||
## About the Comment System | ||
|
||
I've been using the `utterances` comment system, but it's a bit uncomfortable, so I switched to `Twikoo`. | ||
|
||
The official [documentation](https://twikoo.js.org/) is very clear, so I won't go into details here. In short, it's useful, very useful. I experienced the joy of having a backend because of this. It even made me want to join the `Wordpress` camp (because `Node.js` is almost driving me crazy). | ||
|
||
# Summary and Outlook | ||
|
||
In general, `Valaxy` is flourishing, and I hope it gets even better. | ||
|
||
Thanks to the free space and domain from `GitHub` and the free database from `Atlas`, my blog has been completely free so far. | ||
|
||
Of course, the contributions of developers to the open-source community are indispensable. They provide beautiful themes and a variety of plugins. | ||
|
||
That's all. | ||
|
||
::: |