2012-12-22 28 views
0

我對Google協作平臺很陌生,想知道如何在網站內插入發佈日期和上次更新的頁面(而不是使用博客模板)。Google協作平臺:爲網站中的頁面發佈插入日期

它看起來像我可以使用Google Apps腳本與

utilities.formatDate(SitesApp.getActivePage().getDatePublished(), "GMT", "d-MMM-yyyy") 

ContentService 

一起,但我不知道如何去實現它。

回答

0

您可以使用下面的代碼在Google網站上顯示上次更新和發佈日期。您可以使用此代碼創建一個Apps腳本小工具,然後您可以將其嵌入Google網站。

function doGet(e){ 
    var app= UiApp.createApplication(); 
    var page = SitesApp.getActivePage(); 
    app.add(app.createHTML('Last updated: ' + page.getLastUpdated())); 
    app.add(app.createHTML('Published: '+page.getDatePublished())); 
    return app; 
} 

你可以看到一個演示here

有關小工具在谷歌網站的更多信息,請訪問this page

相關問題