Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO - 加入 robots.txt, sitemap, prerender 讓搜尋引擎可以獲取網頁資訊 #589

Merged
merged 8 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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