feat: add admin publishing workflow and yar theme
Add Go/Postgres admin APIs, Angular admin UI, manual build flow, asset uploads, markdown import/export, configurable slug generation, and the Yar reading theme. Exclude local docs and generated development artifacts from version control.
This commit is contained in:
parent
b78f4b39c9
commit
f0b50d13ea
121 changed files with 27139 additions and 550 deletions
40
content/posts/blog-transfer-complete.md
Normal file
40
content/posts/blog-transfer-complete.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
id: d45ebe08-3f81-474f-a284-93170d866f5a
|
||||
slug: blog-transfer-complete
|
||||
title: 博文转移完毕
|
||||
summary: ""
|
||||
status: published
|
||||
tags: []
|
||||
cover: ""
|
||||
version: 1
|
||||
slug_source: manual
|
||||
slug_locked: true
|
||||
published_at: "2023-02-24T00:56:03+08:00"
|
||||
created_at: "2023-02-24T00:56:03+08:00"
|
||||
updated_at: "2026-01-07T18:11:03+08:00"
|
||||
---
|
||||
|
||||
由于之前的博客存储在了 sqlite3 数据库里,显然是没办法直接导入 Hexo 所识别的格式的,所以用 python 写了
|
||||
一个小脚本,方便博文的转移。
|
||||
|
||||
```python
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
conn = sqlite3.connect("Hsunr.db")
|
||||
cursor = conn.cursor()
|
||||
|
||||
cursor.execute('select * from post')
|
||||
values = cursor.fetchall()
|
||||
for item in values:
|
||||
file_name = "{}-{}.md".format(item[5],item[1].replace(' ','-'))
|
||||
dt_obj = datetime.strptime(item[0], '%Y%m%d%H%M%S')
|
||||
content = "---\\n" \\
|
||||
"title: {}\\n" \\
|
||||
"date: {}\\n" \\
|
||||
"tags:\\n" \\
|
||||
"categories: {}\\n" \\
|
||||
"---\\n"\\
|
||||
"{}".format(item[1],dt_obj,item[3],item[2])
|
||||
f = open(file_name,'w');
|
||||
f.write(content)
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue