Skip to content

Commit

Permalink
feat: support hugo and doks as github pages (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
l10178 authored Oct 8, 2023
1 parent 513014e commit 3e6166e
Show file tree
Hide file tree
Showing 132 changed files with 8,673 additions and 25 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assets/js/vendor
node_modules
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"no-console": 0,
"quotes": ["error", "single"],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
]
}
}
37 changes: 37 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: deploy github pages

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: [20.x]

- name: Install dependencies
run: npm ci

- name: Run linters
run: npm run lint --if-present

- name: Build site
run: npm run build

- name: Deploy github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
37 changes: 13 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
.eslintcache
.stylelintcache
.netlify
.hugo_build.lock
yarn-error.log
node_modules
public
resources
pnpm-lock.yaml

.idea
.vscode
.impl
12 changes: 12 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Source:
# - https://github.com/gitpod-io/template-hugo
# - https://www.gitpod.io/docs/configure/workspaces/tasks#one-line-tasks

tasks:
- name: Run development server
init: pnpm install
command: pnpm dev

ports:
- port: 1313
onOpen: open-preview
14 changes: 14 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"config": {
"default": true,
"MD013": false,
"MD022": false,
"MD024": false,
"MD025": false,
"MD026": false,
"MD033": false,
"MD034": false,
"MD036": false
},
"ignores": ["node_modules", "CHANGELOG.md", "README.md"]
}
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
public
resources
.netlify
.hugo_build.lock
yarn-error.log
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enable-pre-post-scripts = true
auto-install-peers = true
node-linker = hoisted
prefer-symlinked-executables = false
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assets/scss/vendor
node_modules
37 changes: 37 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"no-empty-source": null,
"string-quotes": "double",
"scss/comment-no-empty": null,
"max-line-length": null,
"scss/at-extend-no-missing-placeholder": null,
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"extend",
"at-root",
"debug",
"warn",
"error",
"if",
"else",
"for",
"each",
"while",
"mixin",
"include",
"content",
"return",
"function",
"tailwind",
"apply",
"responsive",
"variants",
"screen"
]
}
]
}
}
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# satellites-labs.github.io
# xlabs-club.github.io

This is the source of [xlabs.club][].

卫星实验室,一个专注于研究卫星以及 CRM 的开源组织。

## 本地开发

本项目使用 [Hugo](https://gohugo.io/) 开发,使用 [Doks]((https://github.com/gethyas/doks)) 作为主题,本地开发时先安装 Nodejs,然后使用 npm(或 pnpm) 安装 Hugo。

```bash

# 安装 npm 依赖包
npm install

# 启动 Web,然后浏览器访问 http://localhost:1313/即可浏览效果,更多命令请参考 package.json
npm run dev

```

## License

本文档采用 [CC BY-NC 4.0][] 许可协议。

[xlabs.club]: https://www.xlabs.club
[CC BY-NC 4.0]: https://creativecommons.org/licenses/by-nc/4.0/
7 changes: 7 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// disable docs links, see https://www.docsy.dev/docs/adding-content/repository-links/
.td-page-meta--view { display: none !important; }
.td-page-meta--edit { display: none !important; }
.td-page-meta--child { display: none !important; }
.td-page-meta--issue { display: none !important; }
.td-page-meta--project-issue { display: none !important; }
86 changes: 86 additions & 0 deletions config/_default/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
title = "XLabs"
baseurl = "/"
canonifyURLs = false
disableAliases = true
disableHugoGeneratorInject = true
# disableKinds = ["taxonomy", "term"]
enableEmoji = true
enableGitInfo = true
enableRobotsTXT = true
languageCode = "zh-CN"
paginate = 10
rssLimit = 10
summarylength = 20 # 70 (default)

# Multilingual
defaultContentLanguage = "zh"
disableLanguages = ["en"]
defaultContentLanguageInSubdir = false

copyRight = "Copyright (c) 2020-2023 Henk Verlinde"

[social]
twitter = "getdoks"

[outputs]
home = ["HTML", "RSS", "searchIndex"]
section = ["HTML", "RSS", "SITEMAP"]

[outputFormats.searchIndex]
mediaType = "application/json"
baseName = "search-index"
isPlainText = true
notAlternative = true

# Add output format for section sitemap.xml
[outputFormats.SITEMAP]
mediaType = "application/xml"
baseName = "sitemap"
isHTML = false
isPlainText = true
noUgly = true
rel = "sitemap"

[sitemap]
changefreq = "monthly"
filename = "sitemap.xml"
priority = 0.5

[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = "30m"

[taxonomies]
contributor = "contributors"
category = "categories"
tag = "tags"

[permalinks]
blog = "/blog/:slugorfilename/"
docs = "/docs/:sections[1:]/:slugorfilename/"
# docs = "/docs/1.0/:sections[1:]/:slug/"

[minify.tdewolff.html]
keepWhitespace = false

[related]
threshold = 80
includeNewer = true
toLower = false
[[related.indices]]
name = "categories"
weight = 100
[[related.indices]]
name = "tags"
weight = 80
[[related.indices]]
name = "date"
weight = 10

[imaging]
anchor = "Smart"
bgColor = "#ffffff"
hint = "photo"
quality = 75
resampleFilter = "Box"
Loading

0 comments on commit 3e6166e

Please sign in to comment.