moztw / www.moztw.org

Repository of moztw.org
https://moztw.org/
Mozilla Public License 2.0
55 stars 59 forks source link

網站沒有正確 Sitemap #189

Open irvin opened 9 years ago

irvin commented 9 years ago

不知道以前是如何產生 sitemap 的,看來最後一次更新是 2013 年,然後就消失了 2015-03-17 10 29 49

irvin commented 9 years ago

@petercpg @timdream 你們知道該怎麼處理嗎?

wildskyf commented 9 years ago

是這個嗎? https://www.xml-sitemaps.com/

irvin commented 9 years ago

理論上在 deploy 的時候應該要有機制自動生,不用透過第三方服務

2015-03-17 10:41 GMT+08:00 wildsky notifications@github.com:

是這個嗎? https://www.xml-sitemaps.com/

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-82057536.

@ irvinfly: community liaison moztw.org Mozilla Taiwan community

petercpg commented 9 years ago

Deploy 應該從來都沒有自動產生過,要這麼做的話看有沒有人要寫囉。

irvin commented 9 years ago

那過去是怎麼來的@___@

On Tue, Mar 17, 2015 at 11:33 AM Peter Chen notifications@github.com wrote:

Deploy 應該從來都沒有自動產生過,要這麼做的話看有沒有人要寫囉。

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-82072662.

bobchao commented 9 years ago

好像是人工製造吧

On 17 March 2015 at 11:35, Irvin notifications@github.com wrote:

那過去是怎麼來的@___@

On Tue, Mar 17, 2015 at 11:33 AM Peter Chen notifications@github.com wrote:

Deploy 應該從來都沒有自動產生過,要這麼做的話看有沒有人要寫囉。

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-82072662.

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-82072813.

Po-chiang Chao (:BobChao) Mozillian and Creative Commoner, Taiwan http://twitter.com/bobchao http://blog.bobchao.net/

petercpg commented 9 years ago

如果要用 grunt 產生要注意設定一些黑名單,例如 /node_modules,還有一些我們不想讓別人看到的網頁,例如 /inc 與 /*-dev

可參考 pr #218。

wildskyf commented 9 years ago

好,我有空時加上去

On 2015年3月27日週五 4:18 Peter Chen notifications@github.com wrote:

如果要用 grunt 產生要注意設定一些黑名單,例如 /node_modules,還有一些我們不想讓別人看到的網頁,例如 /inc 與 /*-dev

可參考 pr #218 https://github.com/moztw/www.moztw.org/pull/218

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-86697897.

petercpg commented 9 years ago

幾個問題拉回來這邊討論:

wildskyf commented 9 years ago

我一個一個解解看這些問題

  1. pattern 規則要再修
  2. 要想一下
  3. 我們的網站更新頻率是 monthly 嗎?
petercpg commented 9 years ago
  1. 我其實看不大懂那個規則,看了 minimatch 也是 orz
  2. 不算是吧,有些東西甚至 commit 出去之後就沒再(也不需要)更新了,sitemaps 檔案格式可參考: http://www.sitemaps.org/zh_TW/protocol.html
wildskyf commented 9 years ago
  1. 我來改改看
  2. 這個我在想是不是因為 ssi 會全部重新製造一份蓋過原本的,grunt-sitemap 直接抓 html ,以為他被改過了導致<lastmod>變成上一次執行grunt的時間 @@
petercpg commented 9 years ago

我發現有一些網頁,像 /events/code-rush//firefox/releases/ 還是會被排除掉、/inc 裡面的東西還是會被加回來... 其他的可以暫時擱著不管但這個不大行...

<changefreq> 我先大概抓個保守的 monthly。

wildskyf commented 9 years ago

@petercpg 抱歉,我不小心打錯造成 inc 排除失敗,剛剛 PR 了已經修正錯誤,也把 sanstone 的排除併入同一行,看起來比較不囉唆

此外,我順便把 grunt.registerTask('map', ['sitemap']); 刪掉了,這行是多餘的

沒有被納入 sitemap 的是因為他們資料夾裡面沒有 .html 檔。 換句話說,先執行一次 grunt 後,再執行 grunt sitemap 就沒有這個問題了

petercpg commented 9 years ago

@wi1d5ky Great! 我這看起來也 OK 了。剩下就是看要怎麼讓 sitemap 自動產生。 手動 commit 可能會忘而且 sitemap 應該不需要放進 VCS... 我想也許可以放在 base repo 的 autoupdate/update.sh 裡面,配合 git-received.php 在 auto update 的時候執行?

wildskyf commented 9 years ago

我剛剛也在想一樣的問題,不過我剛剛的想法是當有人下 git push 時,順便執行 grunt sitemap 。不過經你這麼一說,我也覺得不應該放進 VCS。

可是你後面我看不太懂XD 在沒有去深入了解的情況下沒辦法給什麼意見... 聽起來感覺是在主機那邊的自動化?如果可以自動化產生 sitemap 又不會擾亂版本控制的話就太好了!(我有空時再研究一下那個 repo)

還有一些地方要處理,來統整一下:

  1. 整個網站的更新頻率不可能都一樣,要想辦法讓他們可以各別設置
  2. 權重都是 0.5 感覺會影響 SEO
  3. 更新時間不應該等於執行 grunt 的時間

這三個還沒想到解法,可能要放到之後或是請其他人來解,現在就先弄 sitemap 自動化就好~

mingtsay commented 9 years ago

其實 Peter 後面說的「我想也許可以放在 base repo 的 autoupdate/update.sh 裡面,配合 git-received.phpauto update 的時候執行?」就是跟你說的「當有人下 git push 時,順便執行 grunt sitemap」是同一回事哦!

On 2015年3月29日週日 3:19 wildsky notifications@github.com wrote:

(手機鍵盤果然沒辦法打那個符號… 對 markdown 的小無奈…

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-87287590.

irvin commented 9 years ago

@wi1d5ky 總之,你可以繼續調整 grunt sitemap 的設定。 只要可以產生正確的 sitemap,我們可以設定主機在更新時,自動在更新後跑 grunt sitemap,不需要 commit 的人在本地端做。

wildskyf commented 9 years ago

@mingtsay 嗯嗯~ 我有空再去研究研究 mozTW/base @irvin 了解,現在看來大致上是 OK,有人發現什麼問題再跟我說一聲我來補或是直接在 pattern 作修正就好

petercpg commented 9 years ago

挖到以前的做法了,每週一早上 0 點會執行 /usr/bin/google-sitemapgen --config=/home/moztw/htdocs/sitemapgen_config.xml。

這個檔案不在 vcs 裡面有點棘手....。

irvin commented 9 years ago

就不用管以前的作法,改到機器上跑 grunt sitemap 啦?

Peter Chen notifications@github.com 於 2015年4月6日 星期一寫道:

挖到以前的做法了,每週一早上 0 點會執行 /usr/bin/google-sitemapgen --config=/home/moztw/htdocs/sitemapgen_config.xml。

這個檔案不在 vcs 裡面有點棘手....。

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-89960396.

@ irvinfly: community liaison moztw.org Mozilla Taiwan community

mingtsay commented 9 years ago

那要記得停用以前的 sitemap 機制,怕蓋掉新產生的檔案?

On 2015年4月6日週一 18:28 Irvin notifications@github.com wrote:

就不用管以前的作法,改到機器上跑 grunt sitemap 啦?

Peter Chen notifications@github.com 於 2015年4月6日 星期一寫道:

挖到以前的做法了,每週一早上 0 點會執行 /usr/bin/google-sitemapgen --config=/home/moztw/htdocs/sitemapgen_config.xml。

這個檔案不在 vcs 裡面有點棘手....。

— Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-89960396.

@ irvinfly: community liaison moztw.org Mozilla Taiwan community

Reply to this email directly or view it on GitHub https://github.com/moztw/www.moztw.org/issues/189#issuecomment-90005339.

petercpg commented 9 years ago

問題在於 grunt 沒辦法針對資料夾表達更新頻率,這個可以,而且看起來這機制也沒啥不好。