在 Hugo 使用 Obsidian 编辑
导入
左侧边栏 导入其他库 > 打开库文件 ,导入 hugo文件夹,其实只有 /content/post 用得到,想直接使用hugo自定义的模版就导入所有目录。
头字段 FrontMatter
Markdown 最前面的头字段,类似于这样
title = 'spf13-vim 3.0 release and new website'
date = '2023-05-24'
categories = ['Development', 'VIM']
description = 'spf13-vim is a cross platform distribution of vim plugins and resources for Vim.'
slug = 'spf13-vim-3-0-release-and-new-website'
tags = ['.vimrc', 'plugins', 'spf13-vim', 'vim']
通常储模板文件存在 /archetypes 中,用hugo命令 hugo new posts/XXX.md 就会自动搜索和套用, HUgo 官方教程
在 Obsidian 设置 > 核心插件 > 模版 添加 /archetypes ,就可以在左侧边栏直接插入头字段了。
其他设置
还有一些第三方插件,应该会更方便一些
Obsidian Git:可以在 Obsidian 内就可以实现 git commit 以及 push 的操作,直接用command+p打开命令面板,分别执行git commit命令与git push即可。File Tree:目录右键Focuse on Folder过滤文件夹