Improve deployment and talk quoting
自动部署 / deploy (push) Failing after 42s

This commit is contained in:
biss committed 2026-11-30 20:30:37 +08:00
1 parent f21702031e
commit f80e901b21
2 files changed
+20 -12

No files matched your search

+7 -4
View File
@@ -33,18 +33,21 @@ jobs:
- name: 检查部署密钥
env:
DEPLOY_HOOK_KEY: ${{ secrets.DEPLOY_HOOK_KEY }}
run: test -n "$DEPLOY_HOOK_KEY"
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: test -n "$DEPLOY_HOOK_KEY" && test -n "$DEPLOY_TOKEN"
- name: 部署到 page 分支
env:
COMMIT_MESSAGE: ${{ gitea.event.head_commit.message }}
DEPLOY_ACTOR: ${{ gitea.actor }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
cd ./dist
git init
git config user.name "${{ gitea.actor }}"
git config user.email "${{ gitea.actor }}@noreply.gitea.io"
git config user.name "$DEPLOY_ACTOR"
git config user.email "$DEPLOY_ACTOR@noreply.gitea.io"
git add .
git commit -m "${COMMIT_MESSAGE:-Deploy} -- [$(date +"%Z %Y-%m-%d %A %H:%M:%S")]"
git push --force --quiet "https://${{ gitea.actor }}:${{ secrets.DEPLOY_TOKEN }}@git.biss.click/biss/blog.git" master:page
git push --force --quiet "https://${DEPLOY_ACTOR}:${DEPLOY_TOKEN}@git.biss.click/biss/blog.git" HEAD:refs/heads/page
- name: 触发服务器部署
env:
DEPLOY_HOOK_KEY: ${{ secrets.DEPLOY_HOOK_KEY }}
+13 -8
View File
@@ -298,7 +298,7 @@ function renderTalks() {
date,
location: '',
tags: Array.isArray(item.tags) && item.tags.length ? item.tags.map(t => t.name) : ['无标签'],
text: content.replace(/\[(.*?)\]\((.*?)\)/g, '[链接]')
text: String(item.content || '').replace(/\[(.*?)\]\((.*?)\)/g, '$1')
};
};
@@ -343,8 +343,9 @@ function renderTalks() {
//tags.appendChild(loc);
const commentLink = document.createElement('a');
commentLink.href = 'javascript:;';
commentLink.onclick = () => goComment(item.text);
commentLink.href = '#post-comment';
commentLink.setAttribute('aria-label', '引用这条说说到评论区');
commentLink.onclick = (event) => { event.preventDefault(); goComment(item.text); };
const icon = document.createElement('span');
icon.className = 'icon';
icon.innerHTML = '<i class="fa-solid fa-message fa-fw"></i>';
@@ -360,11 +361,15 @@ function renderTalks() {
return talkItem;
};
const goComment = (e) => {
const match = e.match(/<div class="talk_content_text">([\s\S]*?)<\/div>/);
const textContent = match ? match[1] : "";
const textarea = document.querySelector("#twikoo .el-textarea__inner");
textarea.value = `> ${textContent}\n\n`;
const goComment = (text) => {
const textarea = document.querySelector('#twikoo-wrap textarea');
if (!textarea) {
document.getElementById('post-comment')?.scrollIntoView({ behavior: 'smooth' });
btf.snackbarShow('评论区尚未加载完成,请稍后再试');
return;
}
textarea.value = `${text.split(/\r?\n/).map(line => `> ${line}`).join('\n')}\n\n`;
textarea.dispatchEvent(new Event('input', { bubbles: true }));
textarea.focus();
btf.snackbarShow("已为您引用该说说,不删除空格效果更佳");
};