AMP

外掛說明

The AMP Project is an open-source initiative aiming to make the web better for all. AMP enables web experiences that are consistently fast, beautiful and high-performing across distribution platforms. The official AMP plugin for WordPress supports fully integrated AMP publishing for WordPress sites, with robust capabilities and granular publisher controls.

Features and capabilities provided by the plugin include:

  • AMP-first Experiences: enabling full-site AMP experiences without sacrificing the flexibility of the platform or the fidelity of content.
  • Core Theme Support: enabling AMP compatibility for all core themes, from Twenty Ten all the way through Twenty Nineteen.
  • Compatibility Tool: when automatic conversion of markup to AMP is not possible, debug AMP validation errors with detailed information including the invalid markup and the specific components responsible on site (e.g theme, plugin, embed); validation errors are shown contextually with their respective blocks in the editor.
  • CSS Tree Shaking: automatically remove the majority of unused CSS to bring the total under AMP’s 50KB limit; when the total after tree shaking is still over this limit, prioritization is used so that the all-important theme stylesheet important is retained, leaving less important ones to be excluded (e.g. print styles).
  • AMP Stories (beta): the AMP plugin enables the creation, editing, and publishing of AMP Stories in WordPress; leverage the magic of storytelling the WordPress way!

The plugin can be configured to follow one of three different template modes: Standard, Transitional, and Reader. In Standard mode you use AMP as the framework for your site, and there need not be any separate AMP and non-AMP versions. When configured to operate in Reader and Transitional modes, a given page will have a canonical URL as well as a corresponding (paired) AMP URL. The AMP plugin is not serving as a mobile theme; it does not redirect mobile devices to the AMP version. Instead, the AMP version is served to mobile visitors when they find the content on platforms such as Twitter, Pinterest, Google Search, and others. Reader mode only supports serving AMP for singular posts, pages, and other post types, whereas Standard and Transitional mode support serving the entire site as AMP.

With the official AMP plugin for WordPress, the WordPress ecosystem is provided with the capabilities and tools it needs to build world-class AMP experiences without deviating from its standard, flexible, and well-known content creation workflow.

Getting Started

To learn more about the plugin and start leveraging its capabilities to power your AMP content creation workflow check the official AMP plugin product site.

If you are a developer, we encourage you to follow along or contribute to the development of this plugin on GitHub.

螢幕擷圖

  • Create great web experiences via AMP-powered websites or visually rich, engaging stories.
  • Story editor enables creation of pages in a horizontal, page-based interface, with background media, with blocks that can be dragged, rotated, and animated.
  • In the website experience, theme support enables you to reuse the active theme's templates and stylesheets; all WordPress features (menus, widgets, comments) are available in AMP.
  • All core themes are supported, but many themes can be served as AMP with minimal changes, Otherwise, behavior is often as if JavaScript is turned off in the browser since scripts are removed.
  • Reader mode templates are still available, but they are differ from the active theme, any validation errors are silently sanitized.
  • Switch from Reader mode to Transitional or Standard mode in AMP settings screen. You may need to disable the admin bar in AMP if your theme has a larger amount of CSS.
  • Make the entire site available in AMP or pick specific post types and templates; you can also opt-out on per-post basis.
  • Plugin checks for AMP validity and will indicate when either: no issues are found, new issues need moderation, or issues block AMP from being served.
  • The editor will surface validation issues during content authoring. The specific blocks with validation errors are indicated.
  • Validated URLs include the list of validation errors encountered, giving control over whether sanitization for a validation error is accepted or rejected.
  • Styles added by themes and plugins are automatically concatenated, minified, and tree-shaken to try to keep the total under 50KB of inline CSS.
  • A WP-CLI command is provided to check the URLs on a site for AMP validity. Results are available in the admin for inspection.

適用於區塊編輯器

這個外掛提供 4 個可供 Gutenberg/區塊編輯器使用的區塊。

amp/amp-story-post-author
amp/amp-story-post-date
amp/amp-story-post-title
amp/amp-latest-stories

安裝方式

  1. 將外掛壓縮檔解壓縮後,將資料夾及其所有檔案上傳至 /wp-content/plugins/ 目錄。
  2. 透過 WordPress 的 [外掛] 選單啟用外掛。
  3. If you currently use older versions of the plugin in Reader mode, it is strongly encouraged to migrate to Transitional or Standard mode. Depending on your theme/plugins, some development work may be required.

使用者評論

2019 年 9 月 14 日
Very good plugin and easy to use had a small issue due to another plugin on my site asked for help in the forum and the support was great they replied in a few hours and find out the problem Weston Ruter was of great help.
2019 年 8 月 30 日
I have been trying out AMP (By AMP Project Contributors) and AMP for WP. And I always seem to go back to AMP (By AMP Project Contributors) just because it really gives you all the flexibility you need to make your site fully AMP 🙂
2019 年 8 月 21 日
This plugin is evolving very well! My site is completely verified AMP and this is just the beginning of what is possible. The official AMP plugin is the reliable AMP path for WordPress. My development team helped me to get it all AMP first.
2019 年 8 月 18 日
This plugin makes enabling AMP on your WordPress easy. Increase the performance of your site and improve the user experience for your visitors. Now with AMP Stories, publishers can easily create visually stunning content right within Gutenberg editor.
2019 年 8 月 10 日
I used this plug in and it so corrupted the css files I have to do a clean install of WordPress, and lose 30+ pages of a commercial website. I uploaded a back up, but to no avail ALL images could not be seen on the entire site
閱讀全部 186 則使用者評論

參與者及開發者

AMP 外掛目前已有 18 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 AMP 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

如需檢視外掛變更記錄,請參閱 GitHub 存放庫的〈Releases〉頁面