Skip to content

Commit 06f4984

Browse files
committed
docs: update files
1 parent e073ac5 commit 06f4984

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

docs/blog/posts/about_model/adapt_PP-OCRv5_mobile_det.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ categories:
77
comments: true
88
hide:
99
- toc
10+
links:
11+
- 开源OCR模型对比: blog/posts/about_model/model_summary.md
12+
- RapidOCR集成PP-OCRv4_server_rec_doc模型记录: git blog/posts/about_model/adapt_PP-OCRv4_server_rec_doc.md
1013
---
1114

1215

hooks/socialmedia.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import re
2+
import urllib.parse
3+
from textwrap import dedent
4+
5+
x_intent = "https://x.com/intent/tweet"
6+
fb_sharer = "https://www.facebook.com/sharer/sharer.php"
7+
include = re.compile(r"blog/[1-9].*")
8+
9+
10+
def on_page_markdown(markdown, **kwargs):
11+
page = kwargs["page"]
12+
config = kwargs["config"]
13+
if not include.match(page.url):
14+
return markdown
15+
16+
page_url = config.site_url + page.url
17+
page_title = urllib.parse.quote(page.title + "\n")
18+
19+
return markdown + dedent(
20+
f"""
21+
[Share on :simple-x:]({x_intent}?text={page_title}&url={page_url}){{ .md-button }}
22+
[Share on :simple-facebook:]({fb_sharer}?u={page_url}){{ .md-button }}
23+
"""
24+
)

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ extra:
140140
version:
141141
provider: mike
142142

143+
hooks:
144+
- hooks/socialmedia.py
145+
143146
nav:
144147
- 概览: index.md
145148
- 快速开始: quickstart.md

0 commit comments

Comments
 (0)