chore: use idoc build website.

This commit is contained in:
jaywcjlove 2022-05-11 03:33:59 +08:00
parent 3899f860fa
commit c7ac0f2c38
11 changed files with 59 additions and 171 deletions

View File

@ -13,7 +13,7 @@ jobs:
node-version: 14
- run: npm install
- run: npm run create:html
- run: npm run build
- run: npm run create:ast
- name: Deploy
@ -26,14 +26,13 @@ jobs:
- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.2.1
uses: jaywcjlove/create-tag-action@v1.3.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-path: ./package.json
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.8
uses: jaywcjlove/changelog-generator@v1.5.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{steps.create_tag.outputs.version}}

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
node_modules/
dist/*.html
dist/*.json
dist
npm-debug.log*
package-lock.json

View File

@ -16,6 +16,8 @@ Awesome Mac
![App Store][app-store Icon] 表示 **App store** 连接地址;\
![Awesome List][awesome-list Icon] 表示项目的相应 **Awesome list** 的超链接;
<!--idoc:ignore:start-->
## 目录
- [Awesome Mac](#awesome-mac)
@ -81,6 +83,7 @@ Awesome Mac
- [License](#license)
<!--start-->
<!--idoc:ignore:end-->
## 开发者工具
@ -1054,3 +1057,9 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
[![Creative Commons License](http://i.creativecommons.org/l/by/4.0/88x31.png)](https://creativecommons.org/licenses/by/4.0/)
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).Ax
<!--idoc:config:
title: Awesome Mac 应用分享推荐 -
description: 收集分享大量非常好用的Mac应用程序、软件以及工具主要面向开发者和设计师。 - Awesome Mac
-->

View File

@ -24,6 +24,8 @@ Any comments, suggestions? [Let us know!](https://github.com/jaywcjlove/awesome-
[![Get it on macOS](http://jaywcjlove.github.io/sb/download/macos.svg)](https://github.com/jaywcjlove/amac/releases)
<!--idoc:ignore:start-->
## Contents
- [Awesome Mac](#awesome-mac)
@ -96,6 +98,7 @@ Any comments, suggestions? [Let us know!](https://github.com/jaywcjlove/awesome-
- [License](#license)
<!--start-->
<!--idoc:ignore:end-->
## Reading and Writing Tools
@ -1100,3 +1103,9 @@ This work is licensed under a [Creative Commons Attribution 4.0 International Li
[Freeware Icon]: https://jaywcjlove.github.io/sb/ico/min-free.svg "Freeware"
[app-store Icon]: https://jaywcjlove.github.io/sb/ico/min-app-store.svg "App Store Software"
[awesome-list Icon]: https://jaywcjlove.github.io/sb/ico/min-awesome.svg "Awesome List"
<!--idoc:config:
title: Awesome Mac application sharing recommendation -
description: A curated list of awesome applications, softwares, tools and shiny things for Mac osx. - Awesome Mac
-->

View File

@ -1,5 +1,5 @@
import { toVFile } from 'to-vfile'
import remark from 'remark'
import { remark } from 'remark'
import gfm from 'remark-gfm'
import FS from 'fs-extra'

View File

@ -1,154 +0,0 @@
import FS from 'fs-extra';
import { create } from 'markdown-to-html-cli';
const gitalk = [
{
type: 'element',
tagName: 'div',
properties: { id: 'gitalk-container' },
children: [],
}, {
type: 'element',
tagName: 'script',
properties: {
src: 'https://utteranc.es/client.js',
repo: 'jaywcjlove/awesome-mac',
'issue-term': 'homepage',
crossorigin: true,
async: true,
theme: 'github-light',
},
children: [],
}, {
type: 'element',
tagName: 'a',
properties: { className: 'totop', href: '#totop' },
children: [{ type: 'text', value: 'Top' }],
}
];
const topmenuElm = {
type: 'element',
tagName: 'div',
properties: { className: 'topmenu' },
children: [
{
type: 'element',
tagName: 'a',
properties: { href: 'index.html' },
children: [{ type: 'text', value: 'Home' }],
}, {
type: 'element',
tagName: 'a',
properties: { href: 'https://github.com/jaywcjlove/awesome-mac/issues' },
children: [{ type: 'text', value: 'Recommended' }],
}, {
type: 'element',
tagName: 'a',
properties: { href: 'https://github.com/jaywcjlove/awesome-mac/issues' },
children: [{ type: 'text', value: 'Link failure Report' }],
}
]
}
const style = `
a { text-decoration: none; }
.totop { position: fixed; bottom: 20px; right: 20px; display: inline-block; background: rgba(0, 0, 0, 0.74); padding: 10px; border-radius: 3px; z-index: 9999; color: #fff; font-size: 10px; }
.topmenu { position: fixed; left: 5px; top: 5px; display: flex; }
.topmenu a { background: #00000073; padding: 1px 5px; font-size: 12px; border-radius: 2px; margin-right: 5px; color: #fff; }
.topmenu a:hover, .totop:hover { background: #2186ff; color: #fff; }
.markdown-body { max-width: 760px; }
`;
const options = {
'github-corners': 'https://github.com/jaywcjlove/awesome-mac.git',
document: {
style,
link: [
{ rel: 'shortcut icon', href: './favicon.ico' },
{ rel: 'stylesheet', href: '//unpkg.com/gitalk/dist/gitalk.css' }
]
},
reurls: {
'editor-plugin.md': 'editor-plugin.html',
'editor-plugin.md#atom-plugin': 'editor-plugin.html#atom-plugin',
'editor-plugin.md#vim-plugin': 'editor-plugin.html#vim-plugin',
'editor-plugin-zh.md': 'editor-plugin-zh.html',
'editor-plugin-zh.md#atom-plugin': 'editor-plugin-zh.html#atom-plugin',
'editor-plugin-zh.md#vim-plugin': 'editor-plugin-zh.html#vim-plugin',
'editor-plugin-zh.md#sublime-text-plugin': 'editor-plugin-zh.html#sublime-text-plugin',
'editor-plugin-zh.md#vscode-plugin': 'editor-plugin-zh.html#vscode-plugin',
'README-zh.md': 'index.zh.html',
'README.md': 'index.html'
},
rewrite: (node) => {
if (node.type === 'element' && node.tagName === 'body') {
node.properties = { ...node.properties, id: 'totop' };
node.children = [topmenuElm, ...node.children, ...gitalk];
}
}
}
;(async () => {
await FS.ensureDir('./dist');
let markdown = await FS.readFile('./README.md');
let html = create({
markdown, ...options,
document: {
title: "Awesome Mac application sharing recommendation - Awesome Mac",
...options.document,
meta: [
{ description: 'A curated list of awesome applications, softwares, tools and shiny things for Mac osx. - Awesome Mac' },
{ keywords: 'mac,osx,app,softwares,applications,mac softwares,awesome mac,free softwares,Freeware' }
]
}
});
await FS.writeFile('./dist/index.html', html);
console.log(' create file: \x1b[32;1m ./dist/index.html \x1b[0m');
markdown = await FS.readFile('./README-zh.md');
html = create({
markdown, ...options,
document: {
title: "Awesome Mac 应用分享推荐 - Awesome Mac",
...options.document,
meta: [
{ description: '收集分享大量非常好用的Mac应用程序、软件以及工具主要面向开发者和设计师。 - Awesome Mac' },
{ keywords: 'mac,osx,app,mac软件,awesome mac,苹果软件下载,免费软件,mac免费软件下载,精品mac应用' }
]
}
});
await FS.writeFile('./dist/index.zh.html', html);
console.log(' create file: \x1b[32;1m ./dist/index.zh.html \x1b[0m');
markdown = await FS.readFile('./editor-plugin.md');
html = create({
markdown, ...options,
document: {
title: "Editors Plugin Sharing Recommendation - Awesome Mac",
...options.document,
meta: [
{ description: 'Editors Plugin Sharing Recommendation' },
{ keywords: 'mac,osx,app,softwares,applications,editor,plugin,editor-plugin,mac softwares,awesome mac,free softwares,Freeware' }
]
}
});
await FS.writeFile('./dist/editor-plugin.html', html);
console.log(' create file: \x1b[32;1m ./dist/editor-plugin.html \x1b[0m');
markdown = await FS.readFile('./editor-plugin-zh.md');
html = create({
markdown, ...options,
document: {
title: "Editors Plugin 分享推荐 - Awesome Mac",
...options.document,
meta: [
{ description: 'Editors Plugin 分享推荐。 - Awesome Mac' },
{ keywords: 'mac,osx,app,softwares,applications,editor,plugin,editor-plugin,mac softwares,awesome mac,free softwares,Freeware' }
]
}
});
await FS.writeFile('./dist/editor-plugin-zh.html', html);
console.log(' create file: \x1b[32;1m ./dist/editor-plugin-zh.html \x1b[0m');
})();

View File

@ -8,7 +8,6 @@ Editors Plugin
## Atom Plugin
* 通用
* [relative-numbers](https://atom.io/packages/relative-numbers) - 显示相对行号。
* [trailing-spaces](https://atom.io/packages/trailing-spaces) - 高亮多余的空格。
* [terminal-plus](https://atom.io/packages/terminal-plus) - 内嵌式全功能控制台。
@ -29,9 +28,7 @@ Editors Plugin
* [project-plus](https://atom.io/packages/project-plus) - 项目管理, 可以快速切换不同项目,多项目同时工作利器。
* [regex-railroad-diagram](https://atom.io/packages/regex-railroad-diagram) - 可以图形化显示正则表达式。
* [tree-view-search-bar](https://atom.io/packages/tree-view-search-bar/) - 文件列表快速查找工具。
* 前端
* [Nuclide](http://nuclide.io) - 用于编写 React Native代码提示各种很厉害的样子。[![Open-Source Software][OSS Icon]](https://github.com/facebook/nuclide)
* [TypeScript](https://github.com/TypeStrong/atom-typescript) - 支持TypeScript编译。
* [Emmet](https://atom.io/packages/emmet) - 快速编写HTML。
@ -42,9 +39,7 @@ Editors Plugin
* [pigments](https://atom.io/packages/pigments) - 把你文件中的颜色代码展示出来。
* [atom-html-preview](https://atom.io/packages/atom-html-preview) - 内置Chrome浏览器写移动端非常棒。
* [tree-view-copy-relative-path](https://atom.io/packages/tree-view-copy-relative-path) - 可以跟当前文件输出目标文件的相对路径,适合多文件相互调用。
* Python
* [autocomplete-python](https://atom.io/packages/autocomplete-python) - 对Python提示进行增强。
* [linter-flake8](https://atom.io/packages/linter-flake8) - Python 语法检查。
* [python-tools](https://atom.io/packages/python-tools) - 一些有用的 Python 开发工具集。
@ -138,3 +133,9 @@ Editors Plugin
[OSS Icon]: https://jaywcjlove.github.io/sb/ico/min-oss.svg
[Freeware Icon]: https://jaywcjlove.github.io/sb/ico/min-free.svg
[app-store Icon]: https://jaywcjlove.github.io/sb/ico/min-app-store.svg
<!--idoc:config:
title: Editors Plugin 分享推荐 -
description: Editors Plugin 分享推荐 - Awesome Mac
-->

View File

@ -115,3 +115,8 @@ Editors Plugin
[OSS Icon]: https://jaywcjlove.github.io/sb/ico/min-oss.svg
[Freeware Icon]: https://jaywcjlove.github.io/sb/ico/min-free.svg
[app-store Icon]: https://jaywcjlove.github.io/sb/ico/min-app-store.svg
<!--idoc:config:
title: Editors Plugin Sharing Recommendation -
description: Editors Plugin Sharing Recommendation - Awesome Mac
-->

14
idoc.yml Normal file
View File

@ -0,0 +1,14 @@
site: Awesome Mac
description:  This repo is a collection of awesome Mac applications and tools for developers and designers.
keywords: mac,osx,app,softwares,applications,mac softwares,awesome mac,free softwares,Freeware
favicon: ./logo.svg
logo: ./logo.svg
dir: ./doc
sideEffectFiles:
- README-zh.md
- editor-plugin.md
- editor-plugin-zh.md

3
logo.svg Normal file
View File

@ -0,0 +1,3 @@
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<path d="M25.565,9.785c-0.123,0.077-3.051,1.702-3.051,5.305c0.138,4.109,3.695,5.55,3.756,5.55 c-0.061,0.077-0.537,1.963-1.947,3.94C23.204,26.283,21.962,28,20.076,28c-1.794,0-2.438-1.135-4.508-1.135 c-2.223,0-2.852,1.135-4.554,1.135c-1.886,0-3.22-1.809-4.4-3.496c-1.533-2.208-2.836-5.673-2.882-9 c-0.031-1.763,0.307-3.496,1.165-4.968c1.211-2.055,3.373-3.45,5.734-3.496c1.809-0.061,3.419,1.242,4.523,1.242 c1.058,0,3.036-1.242,5.274-1.242C21.394,7.041,23.97,7.332,25.565,9.785z M15.001,6.688c-0.322-1.61,0.567-3.22,1.395-4.247 c1.058-1.242,2.729-2.085,4.17-2.085c0.092,1.61-0.491,3.189-1.533,4.339C18.098,5.937,16.488,6.872,15.001,6.688z"/>
</svg>

After

Width:  |  Height:  |  Size: 724 B

View File

@ -5,8 +5,9 @@
"homepage": "https://jaywcjlove.github.io/awesome-mac",
"main": "dist/awesome-mac.json",
"scripts": {
"start": "npm run create:html && npm run create:ast",
"create:html": "node build/create.mjs",
"start": "npm run build && npm run create:ast",
"doc": "idoc --watch",
"build": "idoc",
"create:ast": "node build/ast.mjs"
},
"repository": {
@ -30,10 +31,10 @@
"url": "https://github.com/jaywcjlove/awesome-mac/issues"
},
"devDependencies": {
"fs-extra": "10.0.0",
"remark": "13.0.0",
"remark-gfm": "1.0.0",
"markdown-to-html-cli": "3.1.5",
"to-vfile": "7.0.0"
"fs-extra": "^10.1.0",
"idoc": "^1.18.0",
"remark": "^14.0.2",
"remark-gfm": "^3.0.1",
"to-vfile": "^7.2.3"
}
}