Skip to content

Commit

Permalink
feat: add auto deploy by action && deploy help blog (#18)
Browse files Browse the repository at this point in the history
* chore: add github workflow

* mod: change head.html into baseof.html

* fix: link background

* mod: change blog title

* docs: add README
  • Loading branch information
nianiaJR authored Feb 9, 2020
1 parent 7458263 commit 7ab60b1
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 54 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/AZURE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name:
on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Github Action
uses: actions/checkout@master

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.62.2'

- name: Setup sshpass
run: sudo apt-get install sshpass

- name: Build
run: hugo --minify -d nebula-website

- name: Deploy
uses: garygrossgarten/github-action-scp@release
with:
local: nebula-website
remote: /home/vesoft/nebula-website
host: ${{ secrets.HOST }}
username: ${{ secrets.USER_NAME }}
password: ${{ secrets.PASSWORD }}
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,56 @@
# nebula-website
Official website for Nebula Graph
# Nebula官网发布教程

## 环境准备
### 本地环境安装
[Hugo 安装](https://gohugo.io/getting-started/quick-start/#step-1-install-hugo)

### 本地服务启动命令
>$ hugo server
浏览器打开访问:http://localhost:1313


## 文件结构简介
***初次使用请仔细阅读***
- nebula-website/ -------------------------------------- 官网项目名称
- content/ ---------------------------------------- 博客文章文件夹
- en/posts/ --------------------------------- 英文博客文件夹
- sample/ ---------------------------- 每篇文章需要创建一个文件夹,文件夹名将会决定文章的路径(比如:https://nebula-graph.io/en/posts/sample/)
- *.(jpg,png,jpeg) --------------- 每篇文章可放一张图片作为头图,请别将文章中图片放在此处引用,避免浏览费用,其他图片放github引用或者oss)
- index.md --------------------- 博客文章固定命名
- cn/posts ---------------------------- 中文博客文件夹
- config.toml -------------------------------- 官网模板的参数设置(title/meta/文案/连接/导航等)
- 其他 ---------------------------------------- 大家暂时不需要更新,也避免改动

## 写文章
### 新建分支
写博客文章,都需要先在分支进行修改,然后提[PR](https://github.com/vesoft-inc/nebula-website/pulls)

### 操作目录
> nebula-website/content/
详细信息可参照已有的文章规律

### SEO信息填写
每篇文章文件夹下的index.md,都会有这样一段信息格式:
``` markdown
---
title: "xxx" // 标题meta
data: 2020-10-10 // 日期
// 根据需要后续还会增加,目前暂时只有这两个
---
```
上面这段信息填写是方便进行博客时间线排列及SEO优化的,请务必填写,保证准确简洁。

### 文章编写
我们的文章编写,以makrdown格式来进行,具体排版大家可以拟定一个规则,站点会自动帮你做渲染。

### 实时预览
只要你本地已经通过 `hugo server` 命令启动了服务,每次文章编写进行保存操作后,访问的页面会自动刷新,本地能实时预览效果。

### 发布
本站点已经实现发布自动化,只需要将相应的分支修改提[PR](https://github.com/vesoft-inc/nebula-website/pulls)到主库master,一旦合并完成会自动发布文章到[官网](https://github.com/vesoft-inc/nebula-website/pulls)

## 总结
以上就是关于文章发布的全部内容,有关官网的反馈,欢迎各位提[issue](https://github.com/vesoft-inc/nebula-website/issues),当然也鼓励各位通过google搜索关键词能自我解决和学习😬。

11 changes: 8 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
baseurl = "http://nebula-graph.io"
title = "Nebula Graph - An Open Source, Distributed and High Performant Graph Database"
description = "Featuring horizontal scalability, strong data consistency, high availability, and SQL-like query language, Nebula Graph database enables you to get insight out of your connected data. Get it now. For free"
theme = "creative"
googleAnalytics = ""
DefaultContentLanguage = "default" ###judge browser language
Expand Down Expand Up @@ -30,11 +29,15 @@ defaultContentLanguageInSubdir = false

# To provide some metadata for search engines feel free to add some
# information about you and your website.
name = "Your name"

description = "Featuring horizontal scalability, strong data consistency, high availability, and SQL-like query language, Nebula Graph database enables you to get insight out of your connected data. Get it now. For free"
name = "Nebula Graph"

# The path must be relative to the static folder
favicon = "favicon.ico"

blogTitle = "Nebula Graph Blog"


# Navigation
[languages.en.params.navigation]
Expand Down Expand Up @@ -238,11 +241,13 @@ defaultContentLanguageInSubdir = false

# To provide some metadata for search engines feel free to add some
# information about you and your website.
name = "Your name"
description = "水平扩展特性,强数据一致性,高可用,类SQL查询语言。Nebula让你洞察数据之间的联系。赶快免费使用它吧。"
name = "Nebula Graph"

# The path must be relative to the static folder
favicon = "favicon.ico"

blogTitle = "Nebula Graph 博客"

# Navigation
[languages.cn.params.navigation]
Expand Down
55 changes: 54 additions & 1 deletion themes/creative/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
<head>
{{ partial "head.html" . }}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ with .Site.Params.name }}
{{ block "name" . }}
<meta name="author" content="{{ . }}">
{{ end }}
{{ end }}
{{ with .Site.Params.description }}
{{ block "description" . }}
<meta name="description" content="{{ . }}">
{{ end }}
{{ end }}
{{ .Hugo.Generator }}
<title>
{{ block "title" . }}
{{ .Site.Title }}
{{ end }}
</title>

{{ "<!-- Favicon -->" | safeHTML }}
<link rel="shortcut icon" href="{{ .Site.Params.favicon | relURL }}">
{{ "<!-- Bootstrap Core CSS -->" | safeHTML }}
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | relURL }}" type="text/css">
{{ "<!-- Custom Fonts -->" | safeHTML }}
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ "font-awesome/css/font-awesome.min.css" | relURL }}" type="text/css">
{{ "<!-- Plugin CSS -->" | safeHTML }}
<link rel="stylesheet" href="{{ "css/animate.min.css" | relURL }}" type="text/css">
{{ "<!-- Custom CSS -->" | safeHTML }}
<link rel="stylesheet" href="{{ "css/creative.css" | relURL }}" type="text/css">
<link rel="stylesheet" href="{{ "css/modals.css" | relURL }}" type="text/css">

{{ "<!-- our own custom css must be placed at last to cover the theme style -->" | safeHTML }}
<link rel="stylesheet" href="{{ "css/custom/index.css" | relURL }}" type="text/css">

{{ "<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->" | safeHTML }}
{{ "<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->" | safeHTML }}
{{ "<!--[if lt IE 9]>" | safeHTML }}
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
{{ "<![endif]-->" | safeHTML }}
<script src="{{ "js/jquery.js" | relURL }}"></script>
<script src="{{ "js/anchor.js" | relURL }}"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-60523578-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-60523578-5');
</script>
</head>
<body id="page-top">
{{ partial "nav.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion themes/creative/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" }}
<main class="blog-list">
<div class="wrapper">
<h3>Nebula Graph Blog</h3>
<h3>{{ .Site.Params.blogTitle }}</h3>
<ul class="list">
{{ range .Pages }}
<li class="blog-summary">
Expand Down
4 changes: 4 additions & 0 deletions themes/creative/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{{ define "title" }}
{{ .Title }}
{{ end }}

{{ define "main" }}
<main class="blog-detail">
<div class="wrapper">
Expand Down
43 changes: 0 additions & 43 deletions themes/creative/layouts/partials/head.html

This file was deleted.

4 changes: 0 additions & 4 deletions themes/creative/static/css/custom/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
text-decoration: underline;
}

.dropdown-menu>li>a:focus {
background-color: #222;
}

@media(min-width: 768px) {
.navbar {
background: url('../../img/header.png') center;
Expand Down

0 comments on commit 7ab60b1

Please sign in to comment.