Skip to content

Commit

Permalink
feat: set up vuepress
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Nov 24, 2024
1 parent 35aa013 commit 6aee183
Show file tree
Hide file tree
Showing 10 changed files with 3,258 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ module.exports = {
},
overrides: [
{
files: ["**.js", "**.cjs"],
files: ["**.js", "**.cjs", "**.mjs"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"quotes": [ "error", "double" ],
"semi": [ "error", "always" ],
"eol-last": [ "error", "always" ],
"no-async-promise-executor": "off",
"indent": ["error", 2, { "ignoredNodes": ["VariableDeclaration[declarations.length=0]"] }],
"comma-dangle": ["error", "only-multiline"],
},
},
],
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:

strategy:
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
language: ["javascript-typescript"]
# CodeQL supports "c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -42,4 +42,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
51 changes: 51 additions & 0 deletions .github/workflows/deploy-docs.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy Docs

on:
workflow_dispatch:

permissions:
contents: write

jobs:
deploy-gh-pages:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

env:
DEPLOY_BRANCH: gh-pages

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# if your docs needs submodules, uncomment the following line
# submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: true
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Build
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm run build-docs
> www/docs/.vuepress/dist/.nojekyll

- name: Deploy on GH Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: ${{ env.DEPLOY_BRANCH }}
folder: www/docs/.vuepress/dist
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ test.ts
node_modules/
*.log
out/

**/.vuepress/.temp
**/.vuepress/.cache
**/.vuepress/dist
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "geniurl",
"version": "1.3.3",
"version": "2.0.0",
"description": "Simple JSON and XML REST API to search for song metadata, the lyrics URL and lyrics translations on genius.com",
"main": "src/index.ts",
"scripts": {
"start": "tsc && node --enable-source-maps out/src/index.js",
"dev": "nodemon -e \"ts,d.ts\" -x \"pnpm start\""
"dev": "nodemon -e \"ts,d.ts\" -x \"pnpm start\"",
"dev-docs": "cd www && pnpm run dev",
"build-docs": "cd www && pnpm run build"
},
"repository": {
"type": "git",
Expand Down
18 changes: 18 additions & 0 deletions www/docs/.vuepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defaultTheme } from "@vuepress/theme-default"
import { defineUserConfig } from "vuepress/cli"
import { viteBundler } from "@vuepress/bundler-vite"

export default defineUserConfig({
lang: "en-US",

title: "geniURL Homepage and Docs",
description: "geniURL is a simple JSON and XML REST API to search for song metadata, the lyrics URL and lyrics translations on genius.com",

theme: defaultTheme({
logo: "https://vuejs.press/images/hero.png",

navbar: ["/", "/get-started"],
}),

bundler: viteBundler(),
})
33 changes: 33 additions & 0 deletions www/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
home: true
title: Home
heroImage: https://vuejs.press/images/hero.png
actions:
- text: Get Started
link: /getting-started.html
type: primary

- text: Introduction
link: https://vuejs.press/guide/introduction.html
type: secondary

features:
- title: Simplicity First
details: Minimal setup with markdown-centered project structure helps you focus on writing.
- title: Vue-Powered
details: Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue.
- title: Performant
details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
- title: Themes
details: Providing a default theme out of the box. You can also choose a community theme or create your own one.
- title: Plugins
details: Flexible plugin API, allowing plugins to provide lots of plug-and-play features for your site.
- title: Bundlers
details: Default bundler is Vite, while Webpack is also supported. Choose the one you like!

footer: MIT Licensed | Copyright © 2018-present VuePress Community
---

This is the content of home page. Check [Home Page Docs][default-theme-home] for more details.

[default-theme-home]: https://vuejs.press/reference/default-theme/frontmatter.html#home-page
46 changes: 46 additions & 0 deletions www/docs/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Get Started

This is a normal page, which contains VuePress basics.

## Pages

You can add markdown files in your vuepress directory, every markdown file will be converted to a page in your site.

See [routing][] for more details.

## Content

Every markdown file [will be rendered to HTML, then converted to a Vue SFC][content].

VuePress support basic markdown syntax and [some extensions][synatex-extensions], you can also [use Vue features][vue-feature] in it.

## Configuration

VuePress use a `.vuepress/config.js`(or .ts) file as [site configuration][config], you can use it to config your site.

For [client side configuration][client-config], you can create `.vuepress/client.js`(or .ts).

Meanwhile, you can also add configuration per page with [frontmatter][].

## Layouts and customization

Here are common configuration controlling layout of `@vuepress/theme-default`:

- [navbar][]
- [sidebar][]

Check [default theme docs][default-theme] for full reference.

You can [add extra style][style] with `.vuepress/styles/index.scss` file.

[routing]: https://vuejs.press/guide/page.html#routing
[content]: https://vuejs.press/guide/page.html#content
[synatex-extensions]: https://vuejs.press/guide/markdown.html#syntax-extensions
[vue-feature]: https://vuejs.press/guide/markdown.html#using-vue-in-markdown
[config]: https://vuejs.press/guide/configuration.html#client-config-file
[client-config]: https://vuejs.press/guide/configuration.html#client-config-file
[frontmatter]: https://vuejs.press/guide/page.html#frontmatter
[navbar]: https://vuejs.press/reference/default-theme/config.html#navbar
[sidebar]: https://vuejs.press/reference/default-theme/config.html#sidebar
[default-theme]: https://vuejs.press/reference/default-theme/
[style]: https://vuejs.press/reference/default-theme/styles.html#style-file
20 changes: 20 additions & 0 deletions www/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "geniurl-docs",
"version": "0.1.0",
"description": "Homepage and Documentation of geniURL, a simple JSON and XML REST API to search for song metadata, the lyrics URL and lyrics translations on genius.com",
"license": "MIT",
"type": "module",
"scripts": {
"build": "vuepress build docs",
"clean-dev": "vuepress dev docs --clean-cache",
"dev": "vuepress dev docs",
"update-package": "pnpm dlx vp-update"
},
"devDependencies": {
"@vuepress/bundler-vite": "^2.0.0-rc.7",
"@vuepress/theme-default": "^2.0.0-rc.11",
"sass": "^1.81.0",
"vue": "^3.4.0",
"vuepress": "^2.0.0-rc.7"
}
}
Loading

0 comments on commit 6aee183

Please sign in to comment.