Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
EINDEX committed Sep 22, 2024
1 parent e3b5e05 commit d744230
Show file tree
Hide file tree
Showing 68 changed files with 15,397 additions and 32,336 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- run: cd docs

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand All @@ -26,31 +24,27 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
# cache: 'pnpm'
# cache-dependency-path: '/docs/pnpm-lock.yaml'
cache: 'pnpm'

- name: Install dependencies
run: cd docs && pnpm install
run: pnpm install

- name: Update changelog
run: cd docs && node changelog.js

- name: Build
run: cd docs && pnpm build
run: pnpm docs:build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 162c9bc5d98e73ac9c64f756da29d06d
projectName: logseq-copilot-page
directory: build
directory: dist/build
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main
# Optional: Change the working directory
workingDirectory: docs
# workingDirectory: docs
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: '3'
22 changes: 2 additions & 20 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
/.vitepress/cache
/.vitepress/dist
109 changes: 109 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Logseq Copilot',
description: 'Connect Browser and Logseq',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Documents', link: '/doc' },
{ text: 'Sponsor', link: '/sponsor' },
],
logo: '/favicon.png',

sidebar: [
{
text: 'Documents',
items: [
{ text: 'Introduce', link: '/doc' },
{ text: 'Setup', link: '/doc/setup' },
{ text: 'Changelogs', link: '/changelogs' },
],
},
{
text: 'Community',
items: [
{
text: 'Github Discussions',
link: 'https://github.com/EINDEX/logseq-copilot/discussions',
},
{ text: 'Twitter(X)', link: 'https://x.com/eindex' },
],
},
{
text: 'More',
items: [
{ text: 'Sponsor', link: '/sponsor' },
{ text: 'Author', link: 'https://eindex.me' },
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/eindex/logseq-copilot' },
],
footer: {
copyright: 'Copyright © 2022-present EINDEX',
},
editLink: {
pattern: 'https://github.com/eindex/logseq-copilot/edit/main/docs/:path',
},
search: {
provider: 'local',
},
},
sitemap: {
hostname: 'https://logseq-copilot.eindex.me',
},
lastUpdated: true,
head: [
['link', { rel: 'icon', href: '/favicon.png' }],
[
'link',
{
rel: 'preconnect',
href: 'https://fonts.googleapis.com',
},
],
[
'link',
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
},
],
[
'link',
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100..900;1,100..900&display=swap',
},
],
[
'script',
{
'data-website-id': '6728c810-c8a8-43ae-b072-4788d1ec7cc9',
src: 'https://umami.eindex.me/script.js',
defer: 'true',
async: 'true',
},
],
[
'script',
{
async: '',
src: 'https://www.googletagmanager.com/gtag/js?id=G-23WMVW5BP4',
},
],
[
'script',
{},
`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-23WMVW5BP4');`,
],
],
});
41 changes: 0 additions & 41 deletions docs/README.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/[changelogs].md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelogs

<!-- @content -->
47 changes: 47 additions & 0 deletions docs/[changelogs].paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import axios from 'axios';

const changelogsModule = {
async paths() {
const formatBody = (body) => {
let ret = body.trim().replaceAll(/<img.*src="(.*?)".*?>/g, '![]($1)');
ret = ret.replaceAll(
/https:\/\/github.com\/EINDEX\/logseq-copilot\/(issues|pull)\/(\d+)/g,
'[$1 #$2](https://github.com/EINDEX/logseq-copilot/$1/$2)',
);
const re = new RegExp(/^#{1,2} /gm);
while (ret.match(re)) {
ret = ret.replaceAll(/^(#+ )/gm, '#$1');
}
ret = ret.replaceAll(/@([\w\-_]+)/g, '[@$1](https://github.com/$1)');
return ret;
};

const resp = await axios({
method: 'GET',
url: 'https://api.github.com/repos/EINDEX/logseq-copilot/releases',
headers: {
Accept: 'application/vnd.github+json',
'X-Github-Api-Version': '2022-11-28',
},
});

if (resp.status !== 200) {
return;
}

let ret = '';
for (const item of resp.data) {
ret += `## [${item.name}](${item.url})
${formatBody(item.body)}\n`;
}
return [
{
params: { changelogs: 'changelogs' },
content: ret,
},
];
},
};

export default changelogsModule;
3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

40 changes: 0 additions & 40 deletions docs/changelog.js

This file was deleted.

2 changes: 0 additions & 2 deletions docs/changelog.template.md

This file was deleted.

Loading

0 comments on commit d744230

Please sign in to comment.