Skip to content

Commit

Permalink
site: build an official website for gnet
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jul 8, 2020
1 parent e6f4ee1 commit 49363cd
Show file tree
Hide file tree
Showing 145 changed files with 54,452 additions and 0 deletions.
20 changes: 20 additions & 0 deletions website/.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*
33 changes: 33 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Website

This website is built using Docusaurus 2, a modern static website generator.

## Installation

```bash
yarn
```

## Local Development

```bash
yarn start
```

This command starts a local development server and open up a browser window.
Most changes are reflected live without having to restart the server.

## Build

```bash
yarn build
```

This command generates static content into the `build` directory and can be
served using any static contents hosting service.

## Deployment

Automatically setup through Netlify. Commits to master will update the
production site and each branch will get a preview site as part of the Github
checks.
126 changes: 126 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
const path = require("path");

module.exports = {
title: "Gnet",
tagline:
"A high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go",
url: "https://gnet.host",
baseUrl: "/",
favicon: "favicon.ico",
organizationName: "panjf2000",
projectName: "gnet",
customFields: {
metadata: require("./metadata"),
},
themeConfig: {
navbar: {
hideOnScroll: true,
logo: {
alt: "Gnet",
src: "img/logo-light.svg",
},
links: [
{ href: "https://pkg.go.dev/github.com/panjf2000/gnet?tab=doc", label: "Documentations", position: "left" },
{ href: "https://taohuawu.club/", label: "Blog", position: "left" },
{ href: "https://github.com/gnet-io", label: "Community", position: "right" },
{
href: "https://github.com/panjf2000/gnet",
label: "GitHub",
position: "right",
},
],
},
image: "img/open-graph.png",
prism: {
theme: require("prism-react-renderer/themes/github"),
darkTheme: require("prism-react-renderer/themes/dracula"),
},
footer: {
links: [
{
title: "About",
items: [
{
label: "What is Gnet?",
href: "https://github.com/panjf2000/gnet#-introduction",
},
{
label: "Contact Us",
to: "contact/",
},
],
},
{
title: "Community",
items: [
{
label: "Github",
href: "https://github.com/panjf2000/gnet",
},
{
label: "Github Organization",
href: "https://github.com/gnet-io",
},
{
label: "Twitter",
href: "https://twitter.com/_andy_pan",
},
{
label: "Blog",
href: "https://taohuawu.club/",
},
],
},
],
logo: {
alt: "Gnet",
src: "/img/footer-logo.svg",
href: "https://github.com/panjf2000/gnet/",
},
copyright: `Copyright 漏 ${new Date().getFullYear()} Andy Pan`,
},
algolia: {
apiKey: "",
indexName: "",
algoliaOptions: {}, // Optional, if provided by Algolia
},
},
presets: [],
plugins: [
// [
// "@docusaurus/plugin-content-docs",
// {
// editUrl: "https://github.com/panjf2000/gnet/edit/master/website/",
// sidebarPath: require.resolve("./sidebars.js"),
// },
// ],
// [
// "@docusaurus/plugin-content-blog",
// {
// feedOptions: {
// type: "all",
// copyright: `Copyright 漏 ${new Date().getFullYear()} Andy Pan.`,
// },
// },
// ],
["@docusaurus/plugin-content-pages", {}],
// path.resolve(__dirname, "./plugins/guides"),
// path.resolve(__dirname, "./plugins/highlights"),
// path.resolve(__dirname, "./plugins/releases"),
// [path.resolve(__dirname, "./plugins/sitemap"), {}],
],
scripts: [],
stylesheets: [
"https://fonts.googleapis.com/css?family=Ubuntu|Roboto|Source+Code+Pro",
"https://at-ui.github.io/feather-font/css/iconfont.css",
],
themes: [
[
"@docusaurus/theme-classic",
{
customCss: require.resolve("./src/css/custom.css"),
},
],
"@docusaurus/theme-search-algolia",
],
};
Loading

0 comments on commit 49363cd

Please sign in to comment.