未验证 提交 14aaf138 编写于 作者: Y Yao Chi 提交者: GitHub

setup versioning by mike plugin (#326)

* startup: add mike for cn

* update en mkdocs.yml

* pip requirements update

* add script

* update requirements

* language selector

* refine multi-lang

* update run-mike.sh

* refine run-mike.sh

* refine pub.yml and run-mike.sh

* refine cn mkdocs.yml(github -> OneFlow)

* copy CNAME before deploy to _site

* add back-to-top button
hide navigation of index.md

* delete all before starting a new deployment

* update copyright date

* Update .github/workflows/pub.yml
Co-authored-by: NShenghang Tsai <jackalcooper@gmail.com>

* reset and revert git username/email

* refine git setting
Co-authored-by: Ntsai <jackalcooper@gmail.com>
Co-authored-by: NYao Chi <yaochi@oneflow.org>
上级 1a0630db
......@@ -10,13 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip3 install --user -r requirements.txt
- run: cd cn && python3 -m mkdocs build
- run: cd en && python3 -m mkdocs build
- run: mv cn/site _site
- run: mv en/site _site/en
- run: cp CNAME _site/
- run: git config --global user.email "ci-bot@oneflow.org"
- run: git config --global user.name "oneflow-ci-bot"
- run: sh ./scripts/run-mike.sh
- run: git checkout docs_output
- run: git checkout master -- CNAME
- run: mv CNAME ./_site/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
......
{#-
This file was automatically generated - do not edit
-#}
{% import "partials/language.html" as lang with context %}
<footer class="md-footer">
{% if page.previous_page or page.next_page %}
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="{{ lang.t('footer.title') }}">
{% if page.previous_page %}
<a href="{{ page.previous_page.url | url }}" title="{{ page.previous_page.title | striptags }}" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
{% include ".icons/material/arrow-left.svg" %}
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</div>
</div>
</a>
{% endif %}
{% if page.next_page %}
<a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | striptags }}" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.next") }}
</span>
{{ page.next_page.title }}
</div>
</div>
<div class="md-footer-nav__button md-icon">
{% include ".icons/material/arrow-right.svg" %}
</div>
</a>
{% endif %}
</nav>
</div>
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
{% if config.copyright %}
<div class="md-footer-copyright__highlight">
{{ config.copyright }}
</div>
{% endif %}
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
{% include "partials/versions.html" %}
{% include "partials/social.html" %}
</div>
</div>
</footer>
{#-
This file was automatically generated - do not edit
-#}
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}" title="{{ config.site_name }}" class="md-header-nav__button md-logo" aria-label="{{ config.site_name }}" style="display:none">
{% include "partials/logo.html" %}
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>
<div class="md-header-nav__title" data-md-component="header-title">
{% if config.site_name == page.title %}
<div class="md-header-nav__ellipsis md-ellipsis">
{{ config.site_name }}
</div>
{% else %}
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
{{ config.site_name }}
</span>
<span class="md-header-nav__topic md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
{% endif %}
</div>
{% if "search" in config["plugins"] %}
<label class="md-header-nav__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% endif %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>
</header>
\ No newline at end of file
<style>
.ver-select:focus {
color: gray;
border: 0px solid #fff;
background-color: transparent;
}
.ver-select {
color: white;
border: 0px solid #fff;
background-color: transparent;
}
</style>
<div class="md-footer-social">
<select class="ver-select" onchange="javascript:location.href=this.value;">
<option> 版本 </option>
<option value="{{ config.site_url }}"> master </option>
<option value="{{ config.site_url }}v0.3.0/"> v0.3.0 </option>
<option value="{{ config.site_url }}v0.2.0/"> v0.2.0 </option>
</select>
</div>
---
hide:
- navigation
- toc
---
# OneFlow 全新一代深度学习框架
## OneFlow 是什么
......
......@@ -2,14 +2,14 @@
site_name: OneFlow
site_url: https://docs.oneflow.org/
site_description: >-
OneFlow 是一款分布式高效的机器学习框架
OneFlow -- 极致性能的分布式机器学习框架
# Repository
repo_name: Github
repo_name: OneFlow
repo_url: https://github.com/OneFlow-Inc/oneflow-documentation
edit_uri: "blob/master/cn/docs/"
# Copyright
copyright: Copyright &copy; 2017 - 2020 OneFlow
copyright: Copyright &copy; 2017 - 2021 OneFlow
#website/xxx.html style
use_directory_urls: false
......@@ -46,6 +46,19 @@ theme:
# Plugins
plugins:
- search
extra:
version:
provider: mike
alternate:
# Switch to Chinese
- name: 中文
link: https://docs.oneflow.org
lang: zh
# Switch to English
- name: English
link: https://docs.oneflow.org/en
lang: en
# Extensions
markdown_extensions:
......@@ -127,6 +140,3 @@ nav:
- OneFlow 开源计划:
- OneFlow 开源计划: contribute/intro.md
- EN:
- EN: en/index.html
{#-
This file was automatically generated - do not edit
-#}
{% import "partials/language.html" as lang with context %}
<footer class="md-footer">
{% if page.previous_page or page.next_page %}
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="{{ lang.t('footer.title') }}">
{% if page.previous_page %}
<a href="{{ page.previous_page.url | url }}" title="{{ page.previous_page.title | striptags }}" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
{% include ".icons/material/arrow-left.svg" %}
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.previous") }}
</span>
{{ page.previous_page.title }}
</div>
</div>
</a>
{% endif %}
{% if page.next_page %}
<a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | striptags }}" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
{{ lang.t("footer.next") }}
</span>
{{ page.next_page.title }}
</div>
</div>
<div class="md-footer-nav__button md-icon">
{% include ".icons/material/arrow-right.svg" %}
</div>
</a>
{% endif %}
</nav>
</div>
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
{% if config.copyright %}
<div class="md-footer-copyright__highlight">
{{ config.copyright }}
</div>
{% endif %}
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
{% include "partials/versions.html" %}
{% include "partials/social.html" %}
</div>
</div>
</footer>
{#-
This file was automatically generated - do not edit
-#}
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}" title="{{ config.site_name }}" class="md-header-nav__button md-logo" aria-label="{{ config.site_name }}" style="display:none">
{% include "partials/logo.html" %}
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>
<div class="md-header-nav__title" data-md-component="header-title">
{% if config.site_name == page.title %}
<div class="md-header-nav__ellipsis md-ellipsis">
{{ config.site_name }}
</div>
{% else %}
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
{{ config.site_name }}
</span>
<span class="md-header-nav__topic md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
{% endif %}
</div>
{% if "search" in config["plugins"] %}
<label class="md-header-nav__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% endif %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>
</header>
\ No newline at end of file
<style>
.ver-select:focus {
color: gray;
border: 0px solid #fff;
background-color: transparent;
}
.ver-select {
color: white;
border: 0px solid #fff;
background-color: transparent;
}
</style>
<div class="md-footer-social">
<select class="ver-select" onchange="javascript:location.href=this.value;">
<option> versions </option>
<option value="{{ config.site_url }}en"> master </option>
<option value="{{ config.site_url }}v0.3.0/en/"> v0.3.0 </option>
<option value="{{ config.site_url }}v0.2.0/en/"> v0.2.0 </option>
</select>
</div>
---
hide:
- navigation
- toc
---
# OneFlow: A Whole New Generation Of Deep Learning Framework
An open source deep learning framework with whole new frame design and the world's leading technology for distributed system.
......
......@@ -9,7 +9,7 @@ repo_url: https://github.com/OneFlow-Inc/oneflow-documentation
edit_uri: "blob/master/en/docs/"
# Copyright
copyright: Copyright &copy; 2017 - 2020 OneFlow
copyright: Copyright &copy; 2017 - 2021 OneFlow
#website/xxx.html style
use_directory_urls: false
......@@ -46,6 +46,19 @@ theme:
# Plugins
plugins:
- search
extra:
version:
provider: mike
alternate:
# Switch to English
- name: English
link: https://docs.oneflow.org/en
lang: en
# Switch to Chinese
- name: 中文
link: https://docs.oneflow.org
lang: zh
# Extensions
markdown_extensions:
......@@ -131,6 +144,3 @@ nav:
- Contribute:
- Contribute to OneFlow: contribute/intro.md
- 中文:
- 中文: ../index.html
set -ex
MIKE="mike"
CN_SITE="_site"
EN_SITE="_site/en"
LATEST_VERSION="latest"
OUTPUT_BRANCH="docs_output"
CN_OPTIONS="--prefix ${CN_SITE} -b ${OUTPUT_BRANCH}"
EN_OPTIONS="--prefix ${EN_SITE} -b ${OUTPUT_BRANCH}"
cd cn
${MIKE} delete --all ${CN_OPTIONS}
${MIKE} deploy master ${LATEST_VERSION} -u ${CN_OPTIONS}
${MIKE} set-default ${LATEST_VERSION} ${CN_OPTIONS}
cd ../en
${MIKE} delete --all ${EN_OPTIONS}
${MIKE} deploy master ${LATEST_VERSION} -u ${EN_OPTIONS}
${MIKE} set-default ${LATEST_VERSION} ${EN_OPTIONS}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册