更改网站系统为 Ghost | Become A Member of Ghost Blog

English traslation fllows Chinese.

最近将网站由 WordPress 转移到了 Ghost。还是各种问题呀,这里将一些容易错的地方提出来说一下。

安装版本:1.0.0-beta.1,也就是第一个 Beta 版。

  1. 域名设置。

    Nginx 下的 conf 配置:

    location ^~ / {

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Host $http_host;

    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_pass http://127.0.0.1:port;

    在 config.production.json 里 "url"后面应该填写正确的域名地址,而非 //:localhost:port 这样的。

  2. Disqus 在中国大陆的特殊化处理。

    由于一些特殊原因,中国大陆的用户不能直接使用 Disqus 系统,但是可以对其进行提示。

    打开 /content/themes/casper

    </footer> 后插入:

    <div id="disqus_thread"></div>

    <script type="text/javascript">

var disqus_shortname = 'airscript'; // required: replace example with your forum shortname
var disqus_identifier = '{{post.id}}'; // make sure to use the post.id as an identifier, otherwise disqus will use the pages url per default, which might be problematic...

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

</script>

<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

<a href="https://www.airscr.com/privacy-and-terms/" class="dsq-brlink">评论功能在中国大陆网络环境受限。<br> Due to some special reason, you're not able to access to our comment system in mainland China.</span></a>

</main>

</article>

</main>

其他就没有什么特别的了,看文档就行了,文档写得很好的。

Recently, I transformed my WordPress Blog to Ghost. However, all kinds of problems happen. The following are some things that confuse me most.

Version:1.0.0-beta.1, aka, the first beta version.

  1. Domain setting.

    The configuration of Nginx conf:

    location ^~ / {

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Host $http_host;

    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_pass http://127.0.0.1:port;

    Besides, in config.production.json , after "url" should be the right domain address, instead of local URL, like //:localhost:port .

  2. The tips for using Disqus in mainland China.

    Due to some policy reason of mainland China, people there are not able to access Disqus server. But we can still tell users then can't use comment system directly.

    Open /content/themes/casper

Insert after </footer> :

`<div id="disqus_thread"></div>`

<script type="text/javascript">

var disqus_shortname = 'airscript'; // required: replace example with your forum shortname
var disqus_identifier = '{{post.id}}'; // make sure to use the post.id as an identifier, otherwise disqus will use the pages url per default, which might be problematic...

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

</script>

<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

<a href="https://www.airscr.com/privacy-and-terms/" class="dsq-brlink">评论功能在中国大陆网络环境受限。<br> Due to some special reason, you're not able to access to our comment system in mainland China.</span></a>

</main>

</article>

</main>

There's nothing more. The Docs are pretty accurate, you can refer there.

Arnold Knegt

Read more posts by this author.

or subscribe via RSS with Feedly!
由于相关政策限制,评论系统对中国大陆用户不可见。详情请点击。
Due to some policy reasons, you're not able to access to our comment system in mainland China. Click here for details.