Skip to content

Commit

Permalink
Merge pull request #589 from SoftwareSing/SEO
Browse files Browse the repository at this point in the history
SEO -  加入 robots.txt, sitemap, prerender 讓搜尋引擎可以獲取網頁資訊
  • Loading branch information
mrbigmouth committed Mar 2, 2019
2 parents bd02148 + de50d66 commit 6ee31d8
Show file tree
Hide file tree
Showing 13 changed files with 658 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ A stock system simulator game which use acgn characters as company.
3. type `meteor npm install` in project folder
4. type `meteor run --settings config.json` in project folder

### Turn to Production mode

Production mode requires `Headless Chrome`, so you need to install Chrome first.

Set `"production": true` in [config.json](config.json).

## Contributors

This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
Expand Down
1 change: 1 addition & 0 deletions client/layout/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<script src="https://code.highcharts.com/stock/highstock.js"></script>
</head>
<body>
<script>window.prerenderReady = false</script>
{{> layout}}
{{> loading}}
</body>
Expand Down
2 changes: 2 additions & 0 deletions client/layout/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ let taskCount = 0;
export function addTask() {
taskCount += 1;
isLoading.set(true);
window.prerenderReady = false;
}
export function resolveTask() {
taskCount -= 1;
if (taskCount <= 0) {
isLoading.set(false);
window.prerenderReady = true;
}
}
export function inheritedShowLoadingOnSubscribing(template) {
Expand Down
5 changes: 5 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// 真正的設定檔請寫在config.json,這邊只是註解用。
export const config = {
debugMode: false, // 是否為debug mode(紀錄一分鐘內的所有方法與訂閱動作,以備crash查看)
production: false, // 是否在 production mode (production設定下需要安裝chrome以啟用所有功能)
websiteInfo: { // 網站資訊
websiteName: 'ACGN股票交易市場', // 網站名稱
description: '| 尋找你的老婆! \n| 喜歡嗎?那麼就入股吧!',
domainName: 'acgn-stock.com',
image: 'https://acgn-stock.com/ms-icon-310x310.png',
timezone: 8 // 主要客群所在的時區 (可能與server的時區不同)
},
prerenderServer: {
'url': 'http://127.0.0.1', // prerender的server位置
'port': '3900'
},
intervalTimer: 60000, // 每隔多少毫秒進行一次工作檢查
releaseStocksForHighPriceInterval: { // 高價釋股的排程時間範圍 (ms)
min: 10800000,
Expand Down
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"public": {
"debugMode": false,
"production": false,
"websiteInfo": {
"websiteName": "ACGN股票交易市場",
"description": "| 尋找你的老婆! \n| 喜歡嗎?那麼就入股吧!",
"domainName": "acgn-stock.com",
"image": "https://acgn-stock.com/ms-icon-310x310.png",
"timezone": 8
},
"prerenderServer": {
"url": "http://127.0.0.1",
"port": "3900"
},
"intervalTimer": 60000,
"releaseStocksForHighPriceInterval": {
"min": 10800000,
Expand Down
Loading

0 comments on commit 6ee31d8

Please sign in to comment.