File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
docs/blog/posts/about_model Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ categories:
77comments : true
88hide :
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
Original file line number Diff line number Diff line change 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+ )
Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ extra:
140140 version :
141141 provider : mike
142142
143+ hooks :
144+ - hooks/socialmedia.py
145+
143146nav :
144147 - 概览 : index.md
145148 - 快速开始 : quickstart.md
You can’t perform that action at this time.
0 commit comments