diff --git a/_config.yml b/_config.yml index 07fd7cf..8d17857 100755 --- a/_config.yml +++ b/_config.yml @@ -78,6 +78,12 @@ TianliGpt: wiki: true api: 5Q5mpqRK5DkwT1X9Gi5e +# 代码块 +CodeBlock: + show_copy: true + default_text: 'copy' + success_text: 'copied' + search: service: local_search # local_search, todo... local_search: # 在 front-matter 中设置 indexing:false 来避免被搜索索引 diff --git a/layout/_partial/main/copycode.ejs b/layout/_partial/main/copycode.ejs new file mode 100644 index 0000000..557d0da --- /dev/null +++ b/layout/_partial/main/copycode.ejs @@ -0,0 +1,86 @@ +<% if (theme.CodeBlock.show_copy) { %> + + + +<% } %> + diff --git a/layout/layout.ejs b/layout/layout.ejs index 1e1e36b..c2daa04 100755 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -16,6 +16,7 @@