Browse Source

根目录修改

liuyuqi 4 years ago
parent
commit
084c010ba7

+ 3 - 0
.gitignore

@@ -23,3 +23,6 @@ ruby_modules
 Gemfile.lock
 
 .*.swp
+
+/package-lock.json
+npm-debug.log

+ 11 - 21
README.md

@@ -6,34 +6,24 @@ This repository contains the source code for the Cordova website at [cordova.apa
 
 The site is also reachable with the short domain [cordova.io](http://cordova.io), the important subareas as [docs.cordova.io](http://docs.cordova.io), [blog.cordova.io](http://blog.cordova.io) and [plugins.cordova.io](http://plugins.cordova.io).
 
-## Technical Overview
+## 中文网站构架
 
-The main parts are built as a static site with [Jekyll](http://jekyllrb.com/), containing the homepage and subpages, the [blog](https://cordova.apache.org/blog) and the [docs](https://cordova.apache.org/docs).  
-The [plugin search](https://cordova.apache.org/plugins) is an embedded PreactJS application.
+```
+git clone https://github.com/jianboy/cordova-docs-cn.git
 
-Here in the repository the code of the actual site is located in [`/www`](www) with its subfolder [`/docs`](www/docs), [`/blog`](www/blog) and [`/plugins`](www/plugins).  
-Some additional content is [pulled in during the build process](TODO).
+docker-compose up -d
 
-The site is built using a [gulp script](gulpfile.js) that is run by Node.JS (`npm run-script build`). (Alternatively you can build the site using Make.) Deployments usually happen on commits to `master` via Travis, which runs [`buildAndDeploy.sh`](buildAndDeploy.sh) and commits the built site to a SVN repository.
+docker attach containerid -it /bin/bash
 
-## Instructions
+npm install
 
-- [Installing](doc/installing-a-development-environment.md)
-- [Developing](doc/developing-the-website.md)
-  * [Docs Redirects](doc/redirects.md)
-- [Testing](doc/testing-the-website.md)
-- Manual [Build](doc/building-the-website.md) and [Deployment](doc/deploying-the-website.md)
-- [Automated Build and Deployment](doc/building-and-deploying-the-website.md) on commits/merges to `master` via Travis
-- [Troubleshooting](doc/troubleshooting.md)
+npm run-script build
 
-### Common Tasks
+```
 
-- [Working on `www/docs`](doc/working-on-docs.md) (updating drom `dev`, creating new version, pulling in external docs)
-- [Writing a Blog Post](doc/blogpost.md)
-- [Adding a Tool or a Showcase App](doc/tool-or-showcase-app.md)
-- [Translating](doc/translate.md)
 
 
-## Attributions
+```
+bundle exec jekyll build --config conf/_config.yml,conf/_defaults.yml,conf/_version.yml,conf/_prod.yml --watch
 
-For attributions for used open-source work, please see the attributions page: `www/attributions.html`.
+```

+ 5 - 6
conf/_config.yml

@@ -5,14 +5,13 @@
 # =======
 # Site settings
 # =======
-title:          Apache Cordova
-title_suffix:   "Apache Cordova"
+title:          Cordova 中文网
+title_suffix:   "Cordova 中文网"
 url:            "https://cordova.apache.org" # the base hostname & protocol
 baseurl:        "" # the subpath of the site, e.g. /blog; NOTE: no trailing slash
 rss_path:       /feed.xml
 description: >
-    Apache Cordova is a set of device APIs that allow a web mobile app
-    developer to access native device function from JavaScript.
+    Apache Cordova是一组设备api,允许web移动应用程序开发人员通过JavaScript访问本机设备功能。
 
 excerpt_separator: <!--more-->
 
@@ -25,12 +24,12 @@ latest_docs_version: dev
 default_linked_docs_version: latest
 
 # the language that serves as the source for the translations
-src_language: en
+src_language: zh-cn
 
 # NOTE:
 #      this value _might_ get overwritten on some pages;
 #      see _defaults.yml, which is a generated file
-language: en
+language: zh-cn
 
 # NOTE:
 #      this value gets overwritten in _defaults.yml, which is a generated file

+ 1 - 1
conf/_prod.yml

@@ -1,5 +1,5 @@
 baseurl: ""
-default_linked_docs_version: latest
+default_linked_docs_version: 9.x
 destination: build-prod
 exclude:
     - static/css-src

+ 1 - 1
docker-compose.yml

@@ -2,7 +2,7 @@ version: '2.1'
 
 services:
   cordova-docs:
-    image: cordova-docs:latest2
+    image: hub.tencentyun.com/google/cordova-docs:v1.1
     build: .
     ports:
       - 3000:3000

+ 1 - 2
www/_includes/footer_contents.html

@@ -56,11 +56,10 @@
             Learn More
         </a>
         <p style="padding-top:20px"> <a href="https://twitter.com/apachecordova" class="twitter-follow-button" data-show-count="false">Follow @apachecordova</a></p>
-        <script async defer src="https://slack-cordova-io.herokuapp.com/slackin.js"></script>
     </div>
 </div>
 <p class="copyright_text">
-    Copyright &copy; 2012, 2013, 2015 The Apache Software Foundation, Licensed under the <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>
+    Copyright &copy; 2012, 2013, 2015 Apache软件基金会, 许可授权在 <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>
     Apache and the Apache feather logos are <a target="_blank" href="http://www.apache.org/foundation/marks/list/">trademarks</a> of The Apache Software Foundation.
     <br/>
     "Raleway" font used under license. For details see the <a href="{{ site.baseurl }}/attributions/">attributions page</a>.

+ 0 - 3
www/_includes/head.html

@@ -43,8 +43,6 @@
 
     <!-- Fonts -->
     <!-- For attribution information, see www/attributions.html -->
-    <link href='https://fonts.googleapis.com/css?family=Raleway:700,400,300,700italic,400italic,300italic' rel='stylesheet' type='text/css'>
-
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
     <!--[if lt IE 9]>
         <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
@@ -59,5 +57,4 @@
     <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/lib/bootstrap.min.js"></script>
     <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/lib/ZeroClipboard.js"></script>
 
-    {% include analytics.html %}
 </head>

+ 8 - 5
www/_includes/header.html

@@ -15,19 +15,22 @@
                 <div class="nav_bar_center">
                     <ul class="nav navbar-nav">
                         <li {% if page.docs_tab %}class="active"{% endif %}>
-                            <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/">Documentation</a>
+                            <a href="{{ site.baseurl }}/docs/zh-cn/{{ site.default_linked_docs_version }}/">cordova中文文档</a>
                         </li>
                         <li {% if page.plugins_tab %}class="active"{% endif %}>
-                            <a href="{{ site.baseurl }}/plugins">Plugins</a>
+                            <a href="{{ site.baseurl }}/plugins">插件</a>
                         </li>
                         <li {% if page.blog_tab %}class="active"{% endif %}>
-                            <a href="{{ site.baseurl }}/blog" id="blog_button">Blog<span class="badge" id="new_blog_count"></span></a>
+                            <a href="{{ site.baseurl }}/blog" id="blog_button">cordova博客<span class="badge" id="new_blog_count"></span></a>
+                        </li>
+                        <li {% if page.blog_tab %}class="active"{% endif %}>
+                            <a href="{{ site.baseurl }}/community" id="blog_button">cordova中文社区<span class="badge" id="new_blog_count"></span></a>
                         </li>
                         <li {% if page.contribute_tab %}class="active"{% endif %}>
-                            <a href="{{ site.baseurl }}/contribute">Contribute</a>
+                            <a href="{{ site.baseurl }}/contribute">贡献</a>
                         </li>
                         <li>
-                            <a href="{{ site.baseurl }}/#getstarted">Get Started</a>
+                            <a href="{{ site.baseurl }}/#getstarted">快速开始</a>
                         </li>
                         <li>
                             <form class="navbar-form navbar-right" id="header-search-form" role="search">

+ 2 - 2
www/_includes/tools_and_showcase.html

@@ -1,8 +1,8 @@
 <div class="container">
     <div class="row showcase_section_intro">
         <div class="col-md-12 text-center">
-            <h1>Cordova Tools</h1>
-            <h2>A diverse ecosystem of command line tools, JavaScript frameworks, and cloud services exist that augment Cordova</h2>
+            <h1>Cordova工具</h1>
+            <h2>多样化的生态,包括命令行工具、JavaScript框架和云服务用来增强Cordova的功能</h2>
         </div>
     </div>
     <div class="row card_gallery">

+ 0 - 20
www/_includes/twitterFeed.html

@@ -1,20 +0,0 @@
-<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/apachecordova" data-widget-id="629424968011386884">Tweets by @apachecordova</a>
-
-<script>
-window.twttr = (function(d, s, id) {
-    var js, fjs = d.getElementsByTagName(s)[0],
-        t = window.twttr || {};
-    if (d.getElementById(id)) return t;
-    js = d.createElement(s);
-    js.id = id;
-    js.src = "https://platform.twitter.com/widgets.js";
-    fjs.parentNode.insertBefore(js, fjs);
-
-    t._e = [];
-    t.ready = function(f) {
-        t._e.push(f);
-    };
-
-    return t;
-}(document, "script", "twitter-wjs"));
-</script>

+ 0 - 1
www/_layouts/base.html

@@ -8,7 +8,6 @@ analytics_id: UA-64283057-3
 <body>
     {{ content }}
     <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/index.js"></script>
-    <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/twitter.js"></script>
     {% include algolia.html %}
 </body>
 </html>

+ 1 - 1
www/_layouts/docs-zh-cn.html

@@ -1,6 +1,6 @@
 ---
 layout: docs
-outdated_text: "This version of the documentation is outdated!"
+outdated_text: "这不是文档的最新版本!"
 in_development_text: "This version of the documentation is under development!"
 click_here_text: "Click here for the latest released version."
 toc_text: "Table of Contents"

+ 2 - 4
www/_layouts/docs.html

@@ -169,11 +169,9 @@ NOTE:
                             {% comment %}
                             Name the latest version as "latest" to take advantage of redirects for "/latest/".
                             {% endcomment %}
-                            {% if other_version == site.latest_docs_version %}
-                                {% assign other_version_string = "latest" %}
-                            {% else %}
+                            
                                 {% assign other_version_string = other_version %}
-                            {% endif %}
+                            
 
                             {% capture version_entry_string %}
                                 {{ other_version }}

+ 1 - 1
www/blog/index.html

@@ -44,7 +44,7 @@ priority: 0.7
         <!-- <a target="_blank" href="http://feed1.w3.org/check.cgi?url={{ site.baseurl }}{{ site.rss_path }}"><img src="{{ site.baseurl }}/static/img/valid-rss-rogers.png" alt="[Valid RSS]" title="Validate my RSS feed" /></a> -->
     </div>
     <div class="col-sm-4 social-container">
-        {% include twitterFeed.html %}
+        
     </div>
 </div>
 

+ 11 - 0
www/community/index.html

@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+    <title>hah</title>
+    <body>
+        <div>
+            <nav>
+                <li>社区正在建设中,期待您的加入!</li>
+            </nav>
+        </div>
+    </body>
+</html>

+ 1 - 1
www/contact/index.html

@@ -8,7 +8,7 @@ title: Contact
         <div class="col-sm-12">
             <h1>Mailing List</h1>
             <p>
-                <em>NOTE: To subscribe to a mailing list, send a non-empty email to its subscription address from the email address that you wish to be subscribed.</em>
+                <em>注意:要订阅邮件列表,请从您要订阅的电子邮件地址向其订阅地址发送非空电子邮件。</em>
             </p>
         </div>
     </div>

+ 33 - 34
www/index.html

@@ -15,18 +15,19 @@ change_frequency: monthly
             <div class="col-xs-12 col-sm-7 hero_content">
                 <img class="hero_logo hidden-xs" src="{{ site.baseurl }}/static/img/cordova-logo-newbrand-textonly.svg" />
                 <!-- <img class="hero_logo visible-xs" src="{{ site.baseurl }}/static/img/logo_full_2.svg" /> -->
-                <p>Mobile apps with <em>HTML</em>, <em>CSS</em> &amp; <em>JS</em></p>
-                <p>Target multiple platforms with <em>one code base</em></p>
-                <p>Free and <em>open source</em></p>
+                <p>使用<em>HTML</em>, <em>CSS</em> &amp; <em>JS</em>进行移动App开发</p>
+                <p>多平台<em>共用一套代码</em></p>
+                <p>免费<em>开源</em></p>
+                <p>Cordova中文网QQ交流群:<em>1036846871</em></p>
                 <div class="hero_supported_platforms">
                     <img src="{{ site.baseurl }}/static/img/platform-logos.svg" width="140px" />
                 </div>
                 <div class="hero_buttons">
                     <a href="#getstarted" class="col-xs-12 col-sm-5 btn btn-lg btn-primary">
-                        Get Started
+                        入门
                     </a>
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/" class="col-xs-12 col-sm-6 btn btn-lg btn-primary">
-                        Documentation
+                    <a href="{{ site.baseurl }}/docs/zh-cn/{{ site.default_linked_docs_version }}/" class="col-xs-12 col-sm-6 btn btn-lg btn-primary">
+                        文档
                     </a>
                 </div>
             </div>
@@ -39,19 +40,19 @@ change_frequency: monthly
             <div class="col-xs-4">
                 <div class="row">
                     <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_shared_code"></div></div>
-                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>Reusable code across platforms</p></div></div>
+                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>跨平台重用代码</p></div></div>
                 </div>
             </div>
             <div class="col-xs-4">
                 <div class="row">
                     <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_offline"></div></div>
-                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>Support for offline scenarios</p></div></div>
+                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>支持离线场景应用</p></div></div>
                 </div>
             </div>
             <div class="col-xs-4">
                 <div class="row">
                     <div class="col-sm-4 col-md-3"><div class="sprite_img" id="sprite_apis"></div></div>
-                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>Access native device APIs</p></div></div>
+                    <div class="col-sm-8 col-md-9"><div class="value_prop"><p>访问设备原生API</p></div></div>
                 </div>
             </div>
         </div>
@@ -63,7 +64,7 @@ change_frequency: monthly
     <div class="row">
         <div class="col-md-12 text-center">
             <a id="getstarted" name="getstarted" class="fragment-anchor"></a>
-            <h1>Get Started Fast</h1>
+            <h1>快速入门</h1>
         </div>
     </div>
     <!-- GETTING STARTED -->
@@ -72,11 +73,11 @@ change_frequency: monthly
             <div class="number_circle">1</div>
         </div>
         <div class="col-md-7 col-xs-10">
-            <h2>Installing Cordova</h2>
-            <p>Cordova command-line runs on <a target="_blank" href="http://nodejs.org/">Node.js</a> and is available on
+            <h2>安装Cordova</h2>
+            <p>Cordova的命令行运行在 <a target="_blank" href="http://nodejs.org/">Node.js</a> 上面并且可以通过
             <a target="_blank" href="https://npmjs.org/package/cordova">NPM</a>.
-            Follow <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/index.html#develop-for-platforms">platform specific guides</a>
-            to install additional platform dependencies. Open a command prompt or Terminal, and type <code>npm install -g cordova</code>.</p>
+            安装。 根据 <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/index.html#develop-for-platforms">平台具体指导</a>
+            安装相应平台的依赖。打开命令提示符或终端,然后键入 <code>npm install -g cordova</code>.</p>
         </div>
         <div class="col-md-4 col-xs-12">
             <div class="well_code">
@@ -93,9 +94,9 @@ change_frequency: monthly
             <div class="number_circle">2</div>
         </div>
         <div class="col-md-7 col-xs-10">
-            <h2>Create a project</h2>
-            <p>Create a blank Cordova project using the command-line tool.  Navigate to the directory where you wish to create your project and type <code>cordova create &lt;path&gt;</code>.</p>
-            <p>For a complete set of options, type <code>cordova help create</code>.</p>
+            <h2>创建一个项目</h2>
+            <p>使用命令行创建一个空的Cordova项目。导航到你希望创建项目的目录,然后键入 <code>cordova create &lt;path&gt;</code>.</p>
+            <p>要知道这个命令完整的选项,键入 <code>cordova help create</code>.</p>
         </div>
         <div class="col-md-4 col-xs-12">
             <div class="well_code">
@@ -112,10 +113,10 @@ change_frequency: monthly
             <div class="number_circle">3</div>
         </div>
         <div class="col-md-7 col-xs-10">
-            <h2>Add a platform</h2>
-            <p>After creating a Cordova project, navigate to the project directory.  From the project directory, you need to add a platform for which you want to build your app.</p>
-            <p>To add a platform, type <code>cordova platform add &lt;platform name&gt;</code>.</p>
-            <p>For a complete list of platforms you can add, run <code>cordova platform</code>.</p>
+            <h2>添加一个平台</h2>
+            <p>在创建完一个Cordova项目后,导航到项目目录。在项目目录中,你需要添加你想构建app的平台</p>
+            <p>为了添加平台, 键入 <code>cordova platform add &lt;platform name&gt;</code>.</p>
+            <p>为了知道你可以添加的平台,你可以运行 <code>cordova platform</code>.</p>
         </div>
         <div class="col-md-4 col-xs-12">
             <div class="well_code">
@@ -133,8 +134,8 @@ change_frequency: monthly
             <div class="number_circle">4</div>
         </div>
         <div class="col-md-7 col-xs-10">
-            <h2>Run your app</h2>
-            <p>From the command line, run <code>cordova run &lt;platform name&gt;</code>.</p>
+            <h2>运行App</h2>
+            <p>在命令中,键入 <code>cordova run &lt;platform name&gt;</code>.</p>
         </div>
         <div class="col-md-4 col-xs-12">
             <div class="well_code">
@@ -151,19 +152,19 @@ change_frequency: monthly
             <div class="number_circle">5</div>
         </div>
         <div class="col-md-7 col-xs-10">
-            <h2>Common next steps</h2>
+            <h2>通常的下一步</h2>
             <ul class="nav">
                 <li>
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/overview/">Read the docs</a>
+                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/overview/">阅读文档</a>
                 </li>
                 <li>
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/cli/#add-plugins">Add a Plugin</a>
+                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/cli/#add-plugins">添加插件</a>
                 </li>
                 <li>
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/images.html">Customize app icons</a>
+                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/images.html">自定义App ICON</a>
                 </li>
                 <li>
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/">Configure Your App</a>
+                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/config_ref/">配置你的App</a>
                 </li>
             </ul>
         </div>
@@ -178,13 +179,11 @@ change_frequency: monthly
     <div class="container">
         <div class="row showcase_section_intro" id="supported_platforms_section">
             <div class="col-md-12 text-center">
-                <h1>Supported Platforms</h1>
-                <h2>See a list of
-                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/support/index.html">features supported</a> in each platform</h2>
+                <h1>支持平台</h1>
+                <h2>查看每个平台
+                    <a href="{{ site.baseurl }}/docs/en/{{ site.default_linked_docs_version }}/guide/support/index.html">支持特性</a> 列表</h2>
                 <p>
-                    Cordova wraps your HTML/JavaScript app into a native container which can access the device functions of several platforms.
-                    These functions are exposed via a unified JavaScript API, allowing you to easily write one set of code to target nearly every
-                    phone or tablet on the market today and publish to their app stores.
+                    Cordova包装你的HTML/JavaScript app到原生app容器中,可以让你访问每个平台设备的功能。这些功能通过统一的JavaScript API提供,让你轻松的编写一组代码运行在几乎市面上的所有手机和平板上,并可以发布到相应的app商城中。
                 </p>
             </div>
         </div>