《在线分享插件》帮助文档索引
这里是在线分享的帮助文档。
我在 B 站录制了一些视教程频,希望对大家有帮助!我的 B 站主页:https://space.bilibili.com/19450592
我也会持续解决 bug 以及添加新特性。
视频教程
思源笔记-在线分享插件使用教程
1.
插件直接使用
1.1 公共分享(鉴于安全问题和思源笔记新版本限制,公共分享将采用和授权码模式一样的静态分享模式)
1.2 授权码模式分享
2.
docker 部署
2.1 独立部署
2.2 和思源笔记一起部署
3.
vercel 部署
详细教程
1. docker 部署相关
2.1 独立部署
直接使用已打包的,参考 ​docker-compose-hub.yml ,可能需要配置 ​.env.docker​​ ,可以复制 ​.env.docker.example​​ ,然后修改即可
2.2 和思源笔记一起部署
搭配思源:https://github.com/terwer/my-note-docker/blob/main/docker-compose.yml
2. vercel 部署相关
1 部署 docker 版本的思源笔记
https://github.com/terwer/my-note-docker/blob/main/docker-compose.yml
yaml
## docker-compose.yml version: '3' services: public-note: stdin_open: true tty: true image: b3log/siyuan:v2.9.3 ports: - "6808:6806" environment: - "TZ=CST-8" volumes: - ./workspace:/home/siyuan restart: "no"
启动
bash
## dev启动 ## docker compose up --build ## 后台运行 docker compose up -d --build
2 nginx 反向代理
yaml
## nginx.conf server{ listen 9001; listen 9000 ssl http2; server_name siyuan.terwergreen.com; index index.php index.html index.htm default.php default.htm default.html; root /var/www/html; if ($server_port !~ 9000){ rewrite ^(/.*)$ https://$host$1 permanent; } # HTTP_TO_HTTPS_END ssl_certificate /etc/ssl/siyuan.pem; ssl_certificate_key /etc/ssl/siyuan.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; error_page 497 https://$host$request_uri; # SSL-END location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://[ip]:[端口]; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'Upgrade'; client_max_body_size 100m; } location /ws { proxy_pass http://[ip]:[端口]; proxy_read_timeout 60s; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'Upgrade'; } }
docker 版 nginx
yaml
# docker-compose.yml version: '3' services: siyuan-nginx: image: siyuan/nginx:1.15.9 container_name: siyuan-nginx build: context: ./siyuan-nginx dockerfile: Dockerfile ports: - "9000:9000" - "9001:9001" volumes: - ./siyuan-nginx/nginx.conf:/etc/nginx/conf.d/default.conf - ./siyuan-nginx/data/nginx/log:/var/log/nginx - ./siyuan-nginx/ssl/siyuan.pem:/etc/ssl/siyuan.pem - ./siyuan-nginx/ssl/siyuan.key:/etc/ssl/siyuan.key restart: "no"
启动方式同上
3 vercel 生产环境构建
(1) 注册登录 vercel 账号。https://vercel.app
(2)新建项目
为了简单,可以直接先 fork 我的 git 仓库
https://github.com/terwer/siyuan-plugin-blog
把这个仓库 fork 到你自己的 Github 账号。
接下来,在 vercel 新建项目
导入
然后配置
yaml
## Build Command pnpm vercelBuild ## Output Directory dist ## Install Command pnpm install
然后设环境变量
properties
## 等待时间 NUXT_PUBLIC_WAIT_TIME=0 ## 博客类型 NUXT_PUBLIC_DEFAULT_TYPE=siyuan ## 思源地址 NUXT_PUBLIC_SIYUAN_API_URL= ## 思源的 API token NUXT_SIYUAN_AUTH_TOKEN= ## vercel BUILD_TYPE=vercel
点击 Deploy 。
4 在 vercel 绑定自己的域名。参考站点:https://blog.terwer.space/
等会,别走开呀!
咳咳,下面是彩蛋功能~
​vercel​ 部署模式和 ​docker​ 部署模式下,博文的 url 除了支持 ​/s/[d]​ ,还支持其他格式哟~
例如,下面的都是合法的博文地址:
https://blog.terwer.space/s/20230621001422-xsimx5v
https://blog.terwer.space/s/20230621001422-xsimx5v.html
https://blog.terwer.space/p/20230621001422-xsimx5v
https://blog.terwer.space/p/20230621001422-xsimx5v.html
https://blog.terwer.space/post/20230621001422-xsimx5v
https://blog.terwer.space/post/20230621001422-xsimx5v.html
开发进度
无序列表样式适配
支持单页面设置分享密码
支持开启授权码下的分享(实验性)
支持展示任务列表
集成目前已有的热门主题
支持文档别名访问
支持替换图片链接
支持设置自定义域名
支持内部链接和外部链接
支持显示 MD 原文
支持显示 KMD 原文
子文档文档树
页面大纲
标签、摘要
自定义属性
图片放大效果
Latex 公式渲染
plantuml 图表支持
echats 图表支持
支持思源自带的 svg
未完待续