[WordPress] 外掛分享: seedsugar-phphamlsass for WordPress

前言介紹

  • 這款 WordPress 外掛「seedsugar-phphamlsass for WordPress」是 2013-03-10 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2013-03-12,距離現在已有 4437 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

derdoc |

外掛標籤

haml | theme | markup | phamlp | phphaml |

內容簡介

PHAMLP for WordPress 讓你可以使用 HAML 模板系統來創建主題。HAML 取代了大多數 HTML/PHP 模板系統的混亂標籤,使用更清晰、分層的標記語言。

這是一個簡單的外掛程式,只會解析 haml、sass/scss 和 PHP 程式碼,然後將它們轉換為相應的 PHP 原始碼和呈現。

它不包含任何像是 link_to、image_tag 等 rail 的豐富模板標籤。
如果你需要這些功能,你應該看看 wordless 外掛程式。

只要啟用 PHAMLP for WordPress,任何普通的 HTML/PHP 主題都可以使用。但是構成 WordPress 主題的各個模板,從 index.php 到 author.php,都可以替換為相應的 .php.haml 檔案,PHAMLP for WordPress 會處理它們。

如果啟用了它,它還會檢查 sass/scss 樣式表檔案,編譯它們並替換最終輸出的連結。
像正常連結任何其他 .css 檔案一樣。

這個外掛程式會將 haml 和 sass 檔案解析為快取檔案,分別存在 wp-content/phphaml4pw/tmp/php 和 wp-content/phphaml4pw/tmp/css 中,由於明顯的原因,這些資料夾需要可寫入您的網頁伺服器。

由於 PHPHaml 不支援完整的 HAML 語法,如果你有任何語法問題,可以參考 https://github.com/Baldrs/phphaml。
Sass 解析器使用的是 phamlp 的解析器 (http://code.google.com/p/phamlp/)。

HAML 範例

想要範例 HAML 主題,請參考 themes/ 資料夾。

有兩種製作主題的方式:

a) Ruby 的方式是使用佈局。在你的主題中放置 layout.php.haml 文件,裡頭主要包含 WP 的標頭和頁尾。
b) WP 的方式是使用單獨的 header.php 和 footer.php 文件。由於這些文件是靜態包含的,它們的名稱不能更改 (也就是無法使用 header.haml,抱歉!)。
作為解決方案,我們實現了 partials,只需在 index.php.haml 中調用 render("header")/render("footer"),就可以包含 _header/_footer.php.haml。

content_for 目前不能運行,抱歉!

授權

PHPHaml4WP 是 Phamlp 的 WordPress 分支,因此可以根據 ISC 授權 使用。
PHPHAML 的授權包含在分發中。
Sass 解析器取自 http://code.google.com/p/phamlp/,適用新 BSD 授權。
包含的主題源自於預載的 TwentyTen 主題,繼承了原始主題的 GPL 授權。

原文外掛簡介

PHAMLP for WordPress enables theme creation using the HAML template system. HAML replaces the tag soup of most HTML/PHP templates with a cleaner, hierarchical markup language.
This is a simple plugin that only parses haml and sass/scss with included php code to their respective php source and renders that.
It DOES NOT include any of rail’s sophisticated templating tags, like link_to, image_tag etc..
If you want something like that you should take a look at the wordless plugin.
Any plain HTML/PHP theme will work while PHAMLP for WordPress is enabled. But the individual templates that make up a WordPress theme, from index.php to author.php, can be replaced with a corresponding .php.haml file and PHAMLP for WordPress will process them.
If enabled it will also check for sass/scss stylesheet files, compile them and replace the links in the final output.
Just link to them normally like you would to any other .css file.
The plugin parses haml and sass files into cached files in wp-content/phphaml4pw/tmp/php and wp-content/phphaml4pw/tmp/css respectively, for obvious reasons these folders need to be writable by your webserver.
As PHPHaml does not support the complete HAML syntax, take a look at https://github.com/Baldrs/phphaml for any syntax questions you might have.
Sass parser uses the parser from phamlp (http://code.google.com/p/phamlp/).
HAML Example
For an example HAML theme check the themes/ folder.
There are two ways you can make a theme:
a) The ruby way is to use layouts. For that place a layout.php.haml file in your theme which basically comprises WP’s header and footer.
b) The WP way is to have seperate header.php and footer.php files. Since these are statically included by WP their names cannot be changed (meaning no header.haml – sorry!).
As a workaround, I’ve implemented partials, just call render(“header”)/render(“footer”) in your index.php.haml and _header/_footer.php.haml will be included.
Content_for does not yet work – sorry!
Licenses

PHPHaml4WP a fork of Phamlp for wordpress, and is therefore available under the ISC license.
PHPHAML’s license is included in the distribution.
Sass Parser is from http://code.google.com/p/phamlp/ which uses the New BSD License.
The included themes are derived from the TwentyTen theme that ships with WordPress and inherit the original theme’s GPL license.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「seedsugar-phphamlsass for WordPress」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | trunk |

延伸相關外掛(你可能也想知道)

  • Kirki Customizer Framework 》 , 新增 -現在可使用 Kirki PRO , Kirki讓佈景主題開發者更快速、更輕鬆建立佈景主題。, Kirki 提供超過 30 個自訂控制,範圍從簡單的滑桿到具有 Google ...。
  • Child Theme Configurator 》res and options to help you take complete control of your WordPress site's visual appearance. With PRO, you can handle any plugin's CSS styles, pre...。
  • Easy Theme and Plugin Upgrades 》WordPress 具有透過提供壓縮檔案安裝主題和外掛的內置功能。不幸的是,您無法使用相同的過程升級主題或外掛。相反,當試圖使用壓縮檔案升級時,WordPress 會...。
  • Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。
  • All In One Favicon 》查看最新的WordPress交易以優化您的網站。, All In One Favicon為您的網站和管理頁面添加favicon。, 您可以使用您已經上傳的favicon或使用內置的上傳機制將fa...。
  • Theme Editor 》主題編輯器 (Theme Editor) 允許您編輯主題文件、建立資料夾、上傳檔案,以及在主題和外掛中移除任何檔案和資料夾。您可以直接自訂主題和外掛。, 升級至專業...。
  • Download Plugins and Themes in ZIP from Dashboard 》在儀表板下載外掛和佈景主題外掛可讓您直接從管理儀表板下載已安裝的外掛和佈景主題 ZIP 檔案而無需使用 FTP。, 外掛中沒有必須的設置 - 安裝後,所有以下 Do...。
  • Cryout Serious Theme Settings 》這個外掛是為了與我們的 Nirvana、Tempera、Parabola 和 Mantra 主題互相運作,並在目前的 WordPress 版本上啟用其進階設定頁面。, 相容性, 無論 WordPress ...。
  • WP Updates Notifier 》這個外掛程式會監控你的 WordPress 安裝,並會在核心、外掛程式和佈景主題更新時發送電子郵件通知你。如果你不經常登入 WordPress 管理員,或支援客戶的網站...。
  • Disable auto-update Email Notifications 》自 WordPress 5.5 起,若您已啟用外掛或佈景主題自動更新功能,當外掛或佈景主題自動更新成功或失敗時,您將會收到一封電子郵件通知。, 如果你管理多個網站,...。
  • WP Child Theme Generator 》WP子佈景主題產生器是一個非常簡單易用的外掛,可用於為WordPress CMS支援的任何佈景主題創建子佈景主題。使用多種選項創建子佈景主題,您可以輕鬆地創建和自...。
  • Multi Device Switcher 》Multi Device Switcher外掛允許您為設備(智能手機、平板電腦、手機、遊戲和自定義)設置單獨的佈景主題。, 此外掛可以偵測到使用者代理(UserAgent)是否正在...。
  • Multiple Themes 》重要提示:支援服務已移至 ZATZLabs 網站,不再於 WordPress.org 論壇提供。如需開發者迅速回覆,請提交請求單。, 此外掛設定提供多種選擇方式,可讓您選擇要...。
  • Disable All WordPress Updates 》這個外掛可以完全停用 WordPress 的主題、外掛和核心更新檢查系統。該插件防止 WordPress 檢查更新,包括 cronjobs,並防止顯示任何通知訊息。, 很重要的是,...。
  • WP-LESS 》LESS 是一種基於 CSS 的樣板語言。它提供了許多增強功能,以加速開發並使維護更容易。, 主題開發人員甚至可以捆綁該外掛而不用擔心衝突:只需包含特殊的 boot...。

文章
Filter
Mastodon