Skip to content

Commit 2aaae85

Browse files
committed
complete article function
1 parent 200309a commit 2aaae85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1195
-1817
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
21+
# debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ public/*
4040
!public/favicon.png
4141
public/images/*
4242
!public/images/milvus.svg
43+
!public/images/towhee.svg
44+
45+
src/components/commonComponents

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:16-alpine3.12 as builder
2+
WORKDIR /app
3+
COPY . .
4+
RUN yarn
5+
RUN yarn build
6+
7+
# => Run container
8+
FROM nginx:1.17-alpine
9+
10+
# Nginx config
11+
RUN rm -rf /etc/nginx/conf.d
12+
COPY conf /etc/nginx
13+
14+
# Static build
15+
COPY --from=builder /app/out /usr/share/nginx/html/
16+
17+
# Default port exposure
18+
EXPOSE 80
19+
20+
# Add bash
21+
RUN apk add --no-cache bash
22+
23+
# Start Nginx server
24+
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]

conf/conf.d/client.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
server {
2+
listen 80;
3+
location / {
4+
root /usr/share/nginx/html;
5+
index index.html index.htm;
6+
7+
# Permanent redirect to non-www
8+
if ($http_host ~* "^www.(.+)$"){
9+
set $http_host_1 $1;
10+
rewrite ^/(.*)$ https://$http_host_1/$1 permanent;
11+
}
12+
13+
rewrite ^/demos/(.*)$ /solutions/$1 permanent;
14+
rewrite ^/demos /solutions permanent;
15+
16+
if ($request_uri ~ ^/(.*)\.html$) {
17+
return 301 /$1;
18+
}
19+
try_files $uri $uri.html $uri/ =404;
20+
21+
expires -1; # Set it to different value depending on your standard requirements
22+
}
23+
error_page 500 502 503 504 /50x.html;
24+
location = /50x.html {
25+
root /usr/share/nginx/html;
26+
}
27+
}

conf/conf.d/gzip.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
gzip on;
2+
gzip_http_version 1.0;
3+
gzip_comp_level 5; # 1-9
4+
gzip_min_length 256;
5+
gzip_proxied any;
6+
gzip_vary on;
7+
8+
# MIME-types
9+
gzip_types
10+
application/atom+xml
11+
application/javascript
12+
application/json
13+
application/rss+xml
14+
application/vnd.ms-fontobject
15+
application/x-font-ttf
16+
application/x-web-app-manifest+json
17+
application/xhtml+xml
18+
application/xml
19+
font/opentype
20+
image/svg+xml
21+
image/x-icon
22+
text/css
23+
text/plain
24+
text/x-component;

generate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const project = args.env || 'milvus';
66

77
// copy milvus header and footer to components
88
// new folder path is src/component/commonComponents
9-
copyComponents();
9+
copyComponents(project);
1010

1111
// copy common component
12-
function copyComponents() {
12+
function copyComponents(project) {
1313
const [baseSrcDir, baseTarDir] = [
1414
'./src/commonComponents',
1515
'./src/components/commonComponents',

next.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/** @type {import('next').NextConfig} */
2-
const withLess = require("next-with-less");
2+
const withLess = require('next-with-less');
33

4-
module.exports = withLess({
5-
lessLoaderOptions: {},
6-
});
4+
module.exports = {
5+
...withLess({
6+
lessLoaderOptions: {},
7+
}),
8+
images: {
9+
loader: 'akamai',
10+
path: '',
11+
},
12+
};

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev-milvus": "node generate.js --env milvus & next dev",
7-
"build": "next build",
6+
"dev-milvus": "node generate.js --env milvus && next dev",
7+
"dev-tohi": "node generate.js --env towhee && next dev",
8+
"build": "next build && next export",
89
"start": "next start",
910
"lint": "next lint"
1011
},
@@ -25,10 +26,12 @@
2526
"next-with-less": "^2.0.5",
2627
"react": "18.1.0",
2728
"react-dom": "18.1.0",
29+
"react-github-btn": "^1.3.0",
2830
"remarkable": "^2.0.1",
2931
"yargs": "^17.5.0"
3032
},
3133
"devDependencies": {
34+
"akamai": "^0.10.1",
3235
"eslint": "8.15.0",
3336
"eslint-config-next": "12.1.6"
3437
}

public/images/milvus.svg

Lines changed: 5 additions & 8 deletions
Loading

public/images/towhee.svg

Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)