Skip to content

Commit

Permalink
Merge pull request #475 from translate-tools/464-create-landing-page
Browse files Browse the repository at this point in the history
Create landing page
  • Loading branch information
vitonsky authored Jun 24, 2024
2 parents 2a38e58 + be9446b commit 3d7becd
Show file tree
Hide file tree
Showing 27 changed files with 16,920 additions and 24 deletions.
78 changes: 63 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
"plugin:import/typescript"
],
"rules": {
"import/no-unresolved": [
"error",
{
"ignore": [
"^@theme",
"^@docusaurus",
"^@site"
]
}
],
"import/no-useless-path-segments": [
"error",
{
Expand All @@ -33,34 +43,61 @@
],
"import/export": "off",
"import/namespace": "warn",
"import/no-duplicates": ["error", { "prefer-inline": true }],
"import/newline-after-import": ["error", { "count": 1 }],
"import/no-duplicates": [
"error",
{
"prefer-inline": true
}
],
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"unused-imports/no-unused-imports": "error",
"simple-import-sort/imports": [
"error",
{
// docs: https://github.com/lydell/eslint-plugin-simple-import-sort#custom-grouping
"groups": [
// Side effect imports.
["^\\u0000"],
[
"^\\u0000"
],
// Node.js builtins prefixed with `node:`.
["^node:"],
[
"^node:"
],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^react", "^\\w", "^@\\w"],
[
"^react",
"^\\w",
"^@\\w"
],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
["^"],
[
"^"
],
// Relative imports.
["^../../"],
[
"^../../"
],
// Anything that starts with a dot.
["^../", "^./", "^\\."],
[
"^../",
"^./",
"^\\."
],
// Global CSS files at bottom
["\\.css$"]
[
"\\.css$"
]
]
}
],

// TODO: find option for specify immutable objects for improve consistency
// for example in `src/hooks/useLiveRef.ts` required as deps a `forceUpdate`
// but setter from `useState` is never required
Expand All @@ -71,7 +108,10 @@
"additionalHooks": "(useEqualMemo|useImmutableCallback|useIsomorphicLayoutEffect)"
}
],
"function-call-argument-newline": ["error", "consistent"],
"function-call-argument-newline": [
"error",
"consistent"
],
"no-var": "error",
"no-bitwise": "error",
"no-multi-spaces": "error",
Expand All @@ -81,7 +121,9 @@
"prefer-const": "error",
// off cuz eslint is dumb: https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/no-use-before-define": [
"error"
],
"valid-jsdoc": 0,
// Codestyle
"indent": [
Expand All @@ -94,10 +136,16 @@
"camelcase": [
"error",
{
"allow": ["^UNSAFE_", "^UNSTABLE_"]
"allow": [
"^UNSAFE_",
"^UNSTABLE_"
]
}
],
"arrow-parens": ["error", "always"],
"arrow-parens": [
"error",
"always"
],
"operator-linebreak": [
"error",
"after",
Expand All @@ -117,4 +165,4 @@
}
]
}
}
}
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,3 @@ jobs:
mkdir ./site
node ../scripts/genCrxUpdateManifest.js > ./site/chromium_updates.xml
# TODO: build index.html with landing page
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: [email protected]
build_dir: "./build/site"
branch: gh-pages
30 changes: 30 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Site

on:
push:
workflow_dispatch:

# TODO: run only for changes in `site` directory
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/prepare-build

- name: Build site
working-directory: "./site"
run: |
npm install
npm run build
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: Cecilapp/GitHub-Pages-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
email: [email protected]
build_dir: "./build"
branch: gh-pages
20 changes: 20 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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*
1 change: 1 addition & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Web site code for [linguist.io](https://linguist.io)
3 changes: 3 additions & 0 deletions site/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
29 changes: 29 additions & 0 deletions site/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Config } from '@docusaurus/types';

const config: Config = {
title: 'Linguist Translate',
tagline: 'Privacy focused translation',
favicon: 'favicon.svg',

// Set the production url of your site here
url: 'https://linguister.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

presets: [
[
'@docusaurus/preset-classic',
{
docs: false,
// docs: {
// path: '../docs',
// include: ['*.md', '*.mdx'],
// },
blog: false,
},
],
],
} satisfies Config;

export default config;
Loading

0 comments on commit 3d7becd

Please sign in to comment.