Skip to content

Commit

Permalink
✨ feat: Add developer portal
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabubenik committed May 30, 2024
1 parent e75b1fc commit cbbedef
Show file tree
Hide file tree
Showing 40 changed files with 3,745 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release CI

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
deploy-docs:
name: Deploy Docs
runs-on: [self-hosted, Linux]
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build Docs
run: |
cd docs
npm ci
npm run build
- name: Update Docs Branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/.vitepress/dist
1 change: 1 addition & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fund=false
1 change: 1 addition & 0 deletions docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
32 changes: 32 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { defineConfig } from 'vitepress';
import { markdown } from './config/markdown';
import { head } from './config/en/head';
import { nav } from './config/en/nav';
import { sidebar } from './config/en/sidebar';

export default defineConfig({
title: 'Developer Portal',
titleTemplate: 'Localazy Developer Portal',
description: 'Localazy portal for developers. Learn how to integrate Localazy into your projects.',

lang: 'en-US',
base: '/',
head: head(),
lastUpdated: true,
markdown: markdown(),

sitemap: {
hostname: 'https://developer.localazy.com/',
},

themeConfig: {
logo: {
src: '/theme/localazy-logo.svg',
width: 24,
height: 24,
},
nav: nav(),
sidebar: sidebar(),
externalLinkIcon: true,
},
});
34 changes: 34 additions & 0 deletions docs/.vitepress/config/en/head.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { HeadConfig } from 'vitepress';

export const head = (): HeadConfig[] => [
// Favicon
['link', { rel: 'icon', href: '/favicon.ico', sizes: '32x32' }],
['link', { rel: 'icon', href: '/theme/localazy-logo.svg', type: 'image/svg+xml' }],
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/theme/apple-touch-icon.png' }],

// Fonts
[
'link',
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap',
},
],

// Open Graph protocol
['meta', { name: 'theme-color', content: '#066fef' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:url', content: 'https://developer.localazy.com/' }],
['meta', { property: 'og:title', content: 'Developer Portal | Localazy' }],
['meta', { property: 'og:site_name', content: 'Localazy Developer Portal' }],
// ['meta', { property: 'og:description', content: '' }],
// ['meta', { property: 'og:image', content: '' }],

// Twitter card
['meta', { property: 'twitter:card', content: 'summary_large_image' }],
['meta', { property: 'twitter:url', content: 'https://developer.localazy.com/' }],
['meta', { property: 'twitter:title', content: 'Developer Portal | Localazy' }],
// ['meta', { property: 'twitter:description', content: '' }],
// ['meta', { property: 'twitter:image', content: '' }],
];
12 changes: 12 additions & 0 deletions docs/.vitepress/config/en/nav.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DefaultTheme } from 'vitepress/theme';

export const nav = (): DefaultTheme.NavItem[] => [
{
text: 'Localazy',
link: 'https://localazy.com/',
},
{
text: 'Documentation',
link: 'https://localazy.com/docs',
},
];
4 changes: 4 additions & 0 deletions docs/.vitepress/config/en/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { DefaultTheme } from 'vitepress/theme';

export const sidebar = (): DefaultTheme.Sidebar => [
];
23 changes: 23 additions & 0 deletions docs/.vitepress/config/markdown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { MarkdownOptions } from 'vitepress';
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs';
import { npmCommandsMarkdownPlugin } from 'vitepress-plugin-npm-commands';
import { renderSandbox } from 'vitepress-plugin-sandpack';
import container from 'markdown-it-container';

export const markdown = (): MarkdownOptions => ({
lineNumbers: true,
config(md): void {
md.use(tabsMarkdownPlugin);
md.use(npmCommandsMarkdownPlugin);
md.use(container, 'loc-sandbox', {
render(tokens, idx) {
return renderSandbox(tokens, idx, 'loc-sandbox');
},
});
},
// https://shiki.style
theme: {
light: 'github-light',
dark: 'github-dark',
},
});
Loading

0 comments on commit cbbedef

Please sign in to comment.