惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

梓言堂 - Yuk's Blog

魔改PaperMod主题和博客改动 Android 提取boot.img 并安装Magisk Android抓包和中间人攻击实现HTTP数据拦截篡改 从Wordpress迁移到Hexo,我都做了些什么 脚本助手:云手机上跑脚本的好伙伴 Caddy搭建Typecho并用脚本监控重启 Sony Xperia XZ1(G8342)强刷笔记 Android软件数据备份以及管理优化 记一次使用Crontab的错误排查 以更低的价格购买和续费域名 使用AirtestIDE和iOS-Tagent实现iOS端自动化测试 Python虚拟环境大杂烩
使用Obsidian优雅地写Hugo博客文章
Yuk · 2024-08-22 · via 梓言堂 - Yuk's Blog

曾经的我嗤之以鼻,现在的我逐帧学习!Obsidian 插件太强大了。乐于折腾的咱,笔记软件也不知道换了几个了,下次再详细介绍一下吧。

这篇先侧重与 Obsidian 基本配置,以及和 Hugo 的联动~

本文不是手把手教你如何配置的,更多的是提供成品参考以及个人记录。

亮点抢先看:自动精简图片成 webp,多端同步,使用模板一键生成 Hugo 文章属性,推送文章到 Github,一键统一文章格式,链接自动获取标题等等

用到的插件一览:

一、Enveloppe 推送文章

目前我的 Hugo 是基于 Github 和 Vercel 自动部署的,可以参考我之前的文章 从Wordpress迁移到Hexo,我都做了些什么,不过用的已经不是 Github Action 了,Vercel 那边的已经有集成的 Hugo 的预配置了。

因此我只需要将 Hugo 整个项目保存在 Git 仓库里,Vercel 会自动使用 Hugo 命令生成 public 各种静态文件。那么我只需要将我写的文章推送到 Git 仓库的 content/posts 下面就可以啦。

目前我的文章结构如下:

content
│  └─posts
│      └─post-name
│         ├─index.md
│         ├─pics
│            └─xxx.webp

每个文章创建文件夹,文章所有图片放在 pics 下面。

我添加几个正则替换,按需使用。

GitHub 拷贝 settings.json 设置,然后粘贴导入插件:

配置具体相关可以参考: Github Publisher 插件适配 Hugo 的配置

---
# 注意:这个模板需要Templater插件,且需用alt+e来插入
title: <%tp.file.title%>
# url设置
slug: magisk-patch-boot
date: <% tp.date.now("YYYY-MM-DD HH:mm:ss Z") %>
summary: 博客吃灰,回来修整
tags:
  - blog
  - hugo
  - themes
categories:
  - 技术
series:
  - 系列名字
cover:
  image: pics/xxx.webp
  caption: 图片描述xxxxxxxx
# Enveloppe插件开关
share: false
# Enveloppe插件中要存到content下面地址
dir: posts/<%tp.file.title%>
# Linter插件自动维护修改日期
lastmod: 2024-08-14 10:15:06 +08:00
---

这里使用到了 Templater 和 Linter 插件,前者可以给模板拓展很多常用的变量,后者主要是用在维护 lastmod 最后修改日期这个属性。

Templater 插件只需要配置好模板文件夹即可。

Linter 插件打开”修改日期“相关配置即可。

三、一句话介绍

  • Auto Link Title:粘贴链接时转变成 markdown 格式并自动获取标题。
  • Code Styler:在代码块上添加 fold,可以折叠长代码。
  • Image Converter:自动将图片存放到当前目录的 pics 下,且精简体积转换成 webp。
  • Linter:除开在模板中,还规定了一些文章统一的样式,比如添加各种空格。
  • Remotely Save:这里我使用 InfiniCLOUD 实现了多平台的同步。

四、小尾巴

说实话这种配置文章不太好写,一是我嫌麻烦自己懒得写详细的一步步的介绍,二是我觉得能看到这篇文章的人多多少少都有自己动手能力。

每个人自己的需求大不相同,且这种文章往往时效性比较强,就比如我参考的文章里面插件名字已经从 Github Publisher 变成了 Enveloppe。

不过如果你对文中有些配置比较困惑,可以评论一起讨论。