沉冰浮水

沉冰浮水

做最终到的事,成为最终成为的人!
github
bilibili
mastodon
zhihu
douban

"Exploring" Git Submodules

It's Still Hexo#

Hugo claims to be fast, but its documentation is too incomplete, so I still chose Hexo;

Due to historical reasons, there is already a _posts folder and corresponding articles;

I used the submodule feature of Git to allow Hexo to read directly;


Also due to historical reasons, a small portion of the article tags are defined as follows:

tags:
 - tag1,tag2,tag3

Instead of making a bunch of modifications, I thought about writing a plugin to handle it automatically;

It seems like I managed to do it, but it still doesn't feel elegant enough;

wdssmq/hexo-split-tags: Separate tags with commas.:

Actually, it reads the article separately and adds it to the existing process, so each article is compiled twice. Therefore, I added a step to exclude the default generated articles by marking them;

So, is there a more suitable interface to intercept and process directly?

Git Submodule#

Note:

Clearly, other files in md2zb are not mapped to the source folder, but if they are not prefixed with _, they will still be copied to the publishing directory;

It may also be due to caching issues during testing? But sorting with an underscore prefix will make it appear at the beginning, which is just right;

cd ~/wwwroot/blog
git submodule add [email protected]:wdssmq/Markdown-To-Z-Blog.git _md2zb

cd ~/wwwroot/blog/source
# cd ../md2zb/_posts
rm -rf _posts

ln -si ../_md2zb/_posts _posts

Updating the submodule:

# Initialize the submodule (check out the specified commit from the parent project's record)
git submodule update --init --recursive

# _md2zb @ 06e4fa1

# Pull submodule updates
git submodule foreach 'git pull origin main'

# Update the current commit to the parent project
git status
git add _md2zb
git commit -m"up. Submodule update: _md2zb;"

# _md2zb @ 62619bb

Removing the submodule:

git submodule deinit -f _md2zb
git rm _md2zb

Using Submodules in Git - Zhihu

https://zhuanlan.zhihu.com/p/87053283

Keeping Two Git Repositories Separate#

cd ~/wwwroot
git clone [email protected]:wdssmq/Markdown-To-Z-Blog.git _md2zb

cd ~/wwwroot/blog/source
# cd ../../md2zb/_posts
rm -rf _posts

ln -si ../../_md2zb/_posts _posts

"Exploring" Caddy Easy Getting Started Tutorial_Computer Network_沉冰浮水:

https://www.wdssmq.com/post/20100604351.html

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.