blob: 263d9c596e9cf034d300ce09dadb98af5372dc66 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pegasus | 我如何为 Pegasus 编写网站?</title>
<link rel="stylesheet" href="/assets/css/app.css">
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/utilities.min.css">
<link rel="stylesheet" href="/assets/css/docsearch.v3.css">
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/all.min.js"></script>
<script src="/assets/js/docsearch.v3.js"></script>
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>我如何为 Pegasus 编写网站? | Pegasus</title>
<meta name="generator" content="Jekyll v4.3.3" />
<meta property="og:title" content="我如何为 Pegasus 编写网站?" />
<meta name="author" content="吴涛" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="这篇文章主要讲述我搭建本网站的所做所想,可以对想要参与的小伙伴提供参考。" />
<meta property="og:description" content="这篇文章主要讲述我搭建本网站的所做所想,可以对想要参与的小伙伴提供参考。" />
<meta property="og:site_name" content="Pegasus" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2019-06-09T00:00:00+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="我如何为 Pegasus 编写网站?" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"吴涛"},"dateModified":"2019-06-09T00:00:00+00:00","datePublished":"2019-06-09T00:00:00+00:00","description":"这篇文章主要讲述我搭建本网站的所做所想,可以对想要参与的小伙伴提供参考。","headline":"我如何为 Pegasus 编写网站?","mainEntityOfPage":{"@type":"WebPage","@id":"/2019/06/09/how-i-build-pegasus-website.html"},"url":"/2019/06/09/how-i-build-pegasus-website.html"}</script>
<!-- End Jekyll SEO tag -->
</head>
<body>
<nav class="navbar is-info">
<div class="container">
<!--container will be unwrapped when it's in docs-->
<div class="navbar-brand">
<a href="/" class="navbar-item ">
<!-- Pegasus Icon -->
<img src="/assets/images/pegasus.svg">
</a>
<div class="navbar-item">
<a href="/docs" class="button is-primary is-outlined is-inverted">
<span class="icon"><i class="fas fa-book"></i></span>
<span>Docs</span>
</a>
</div>
<div class="navbar-item is-hidden-desktop">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<a class="button is-primary is-outlined is-inverted" href="/zh/2019/06/09/how-i-build-pegasus-website.html"><strong></strong></a>
</div>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu">
<!-- Appears in mobile mode only -->
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable ">
<a href=""
class="navbar-link ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-users"></i>
</span>
<span>
ASF
</span>
</a>
<div class="navbar-dropdown">
<a href="https://www.apache.org/"
class="navbar-item ">
Foundation
</a>
<a href="https://www.apache.org/licenses/"
class="navbar-item ">
License
</a>
<a href="https://www.apache.org/events/current-event.html"
class="navbar-item ">
Events
</a>
<a href="https://www.apache.org/foundation/sponsorship.html"
class="navbar-item ">
Sponsorship
</a>
<a href="https://www.apache.org/security/"
class="navbar-item ">
Security
</a>
<a href="https://privacy.apache.org/policies/privacy-policy-public.html"
class="navbar-item ">
Privacy
</a>
<a href="https://www.apache.org/foundation/thanks.html"
class="navbar-item ">
Thanks
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable ">
<a href="/community"
class="navbar-link ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-user-plus"></i>
</span>
<span>
Community
</span>
</a>
<div class="navbar-dropdown">
<a href="/community/#contact-us"
class="navbar-item ">
Contact Us
</a>
<a href="/community/#contribution"
class="navbar-item ">
Contribution
</a>
<a href="https://cwiki.apache.org/confluence/display/PEGASUS/Coding+guides"
class="navbar-item ">
Coding Guides
</a>
<a href="https://github.com/apache/incubator-pegasus/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fbug"
class="navbar-item ">
Bug Tracking
</a>
<a href="https://cwiki.apache.org/confluence/display/INCUBATOR/PegasusProposal"
class="navbar-item ">
Apache Proposal
</a>
</div>
</div>
<a href="/blogs"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-rss"></i>
</span>
<span>Blog</span>
</a>
<a href="/docs/downloads"
class="navbar-item ">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-fire"></i>
</span>
<span>Releases</span>
</a>
</div>
<div class="navbar-item is-hidden-mobile">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<a class="button is-primary is-outlined is-inverted" href="/zh/2019/06/09/how-i-build-pegasus-website.html"><strong></strong></a>
</div>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<div class="columns is-multiline">
<div class="column is-one-fourth">
</div>
<div class="column is-half">
<div class="content">
<ul class="blog-post-meta">
<li class="blog-post-meta-item">
<span class="icon" style="margin-right: .25em">
<i class="far fa-calendar-check" aria-hidden="true"></i>
</span>
June 9, 2019
</li>
<li class="blog-post-meta-item">
<span class="icon" style="margin-right: .25em">
<i class="fas fa-edit" aria-hidden="true"></i>
</span>
吴涛
</li>
</ul>
<p>这篇文章主要讲述我搭建本网站的所做所想,可以对想要参与的小伙伴提供参考。</p>
<hr />
<h2 id="为什么要为-pegasus-编写网站">为什么要为 Pegasus 编写网站?</h2>
<p>许多人以为开源软件的核心就是非盈利性地把源代码开放给大家看,重点在于宣传自己的“非盈利性”。
所以把项目开放在 Github 之后即完成了所谓 “开源” 这一目标。其实这种观点是错误的。
“开源”不是为了让大家来学习你的代码(代码是为功能服务的,没有所谓好或不好),而是为了让大家更好地使用你的代码。</p>
<p>对使用者而言,开源软件意味着我们能够免费地使用它或它的某个部分,但如果它并不好用,很难用,
或者出现问题用户无法找到解决的途径,那么“开源”并没有帮助它成为一个更好的软件,而只是吸引到了大众的视线,
对公司而言是完成了技术宣传的指标。</p>
<p>优秀的开源软件,首先需要是一个优秀的软件,并且需要通过开源让这个软件变得更优秀。仅仅只是放在
Github,那么它和一个非商业的闭源软件没有本质上的区别。Pegasus 希望称为一个优秀的开源软件,
而非一份“非盈利性代码仓库”。</p>
<p>这个网站的目的就是为此,我希望大家能更舒适地阅读文档,更轻松地了解 Pegasus,更容易地参与 Pegasus
的社区。</p>
<h2 id="这个网站部署在哪里">这个网站部署在哪里?</h2>
<p>这个网站使用 Github Pages 部署。项目地址在:<a href="https://github.com/apache/incubator-pegasus-website">apache/incubator-pegasus-website</a>
master 分支的代码就对应这个网站的全部内容。提交至 master 后,Github Page 会自动将网站部署至 <a href="https://pegasus.apache.org/">https://pegasus.apache.org/</a> 上。</p>
<h2 id="开发环境">开发环境</h2>
<p>我们使用 <a href="https://jekyllrb.com/">jekyll</a> 静态网页框架,使用 <a href="https://bulma.io">Bulma</a> 作为前端组件库。</p>
<p>jekyll 是用 Ruby 开发的,所以你首先需要安装 Ruby,首选的方法是 <a href="http://rvm.io/">用 RVM 安装</a></p>
<p>中国大陆用户可能在获取 Ruby 依赖库(Ruby Gem)的时候遇到政策性的网络问题,你可以使用 <a href="https://gems.ruby-china.com/">Ruby 中国镜像站</a></p>
<p>最后你只需要在本地安装 jekyll 和 bundler:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>pegasus.apache.org
gem <span class="nb">install </span>bundler jekyll
bundle
jekyll serve
</code></pre></div></div>
<p>使用 <code class="language-plaintext highlighter-rouge">jekyll serve</code> 命令后,你可以在本地浏览器打开 <code class="language-plaintext highlighter-rouge">http://127.0.0.1:4000</code> 调试网页。</p>
<pre><code class="language-txt"> Jekyll Feed: Generating feed for posts
done in 6.514 seconds.
Auto-regeneration: enabled for '/home/mi/docs-cn'
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.
</code></pre>
<h2 id="感谢">感谢</h2>
<p>本站最初基于 <a href="http://www.csrhymes.com/bulma-clean-theme/">chrisrhymes/bulma-clean-theme</a>
它为我提供了如何使用 bulma 和 jekyll 的示例。虽然最终实际使用这个模板的地方不多,
但文档和博客部分的配色与样式还是有所借鉴,还有整个网站的字体也是沿用该模板。</p>
</div>
<div class="tags">
</div>
</div>
<div class="column is-one-fourth is-hidden-mobile" style="padding-left: 3rem">
<p class="menu-label">
<span class="icon">
<i class="fa fa-bars" aria-hidden="true"></i>
</span>
Table of contents
</p>
<ul class="menu-list">
<li><a href="#为什么要为-pegasus-编写网站">为什么要为 Pegasus 编写网站?</a></li>
<li><a href="#这个网站部署在哪里">这个网站部署在哪里?</a></li>
<li><a href="#开发环境">开发环境</a></li>
<li><a href="#感谢">感谢</a></li>
</ul>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="content is-small has-text-centered">
<div style="margin-bottom: 20px;">
<a href="http://incubator.apache.org">
<img src="/assets/images/egg-logo.png"
width="15%"
alt="Apache Incubator"/>
</a>
</div>
Copyright &copy; 2023 <a href="http://www.apache.org">The Apache Software Foundation</a>.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.
<br><br>
Apache Pegasus is an effort undergoing incubation at The Apache Software Foundation (ASF),
sponsored by the Apache Incubator. Incubation is required of all newly accepted projects
until a further review indicates that the infrastructure, communications, and decision making process
have stabilized in a manner consistent with other successful ASF projects. While incubation status is
not necessarily a reflection of the completeness or stability of the code, it does indicate that the
project has yet to be fully endorsed by the ASF.
<br><br>
Apache Pegasus, Pegasus, Apache, the Apache feather logo, and the Apache Pegasus project logo are either
registered trademarks or trademarks of The Apache Software Foundation in the United States and other
countries.
</div>
</div>
</footer>
<script src="/assets/js/app.js" type="text/javascript"></script>
</body>
</html>