Skip to content

Instantly share code, notes, and snippets.

View wastemobile's full-sized avatar

wastemobile wastemobile

View GitHub Profile

1 介紹

[Symphony][1] 很棒,讓我們來讓它更好。

這文章與建立網站的前端相關,維持模板(templates)能夠重複利用,關聯資料來源(Datasources)、事件(Events)以及其他資源到你的頁面(Pages),程式碼的架構,還有更多。這文件的起心動念,是因為發現自己不停的重複再重複相同流程,才有了改良的意圖。

假設你已經知道 Symphony CMS 的 [master.xsl][2] 是什麼,同時也已經用過它。如果你還不明瞭,請先參考 [Symphony 的預設 workspace][3].

2 一切從需求開始

@wastemobile
wastemobile / bash_profile
Last active December 30, 2015 22:09
Install Node。在 Mac 上使用 homebrew 安裝 node 雖然方便,但後續更新與使用 npm 安裝與升級套件時會遇到問題,實際原因是來自于目錄權限。要不是使用時必須帶著 sudo,要不就是得修改部分目錄權限,兩者都不太好。下面的安裝程序可以避掉。
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
function git_since_last_commit {
@wastemobile
wastemobile / gist:7268456
Last active December 27, 2015 04:39
據說 AngularJS 頁面若是被 IE8 以下的瀏覽器摸到,因為對 JSON 支援不足的緣故,會整個 View Template 直接秀出來,必須改用下面的寫法。IE 果真是網路的殺手啊~
<html ng-app id="ng-app" class="ng-app">
<head runat="server">
<title></title>
<!--[if lte IE 8]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json3/3.2.5/json3.min.js"></script>
@wastemobile
wastemobile / main.js
Created September 5, 2013 16:46 — forked from MoOx/main.js
Zurb Foundation 是非常好的建構,彈性比 Bootstrap 大,唯一的缺點就是對 IE 的支援度比 Bootstrap 差許多,IE 7、8 都無法正常使用排版功能(網格),但其實其他元件都沒什麼問題。
requirejs.config({
name: "main",
shim: {
"foundation/jquery.cookie": { deps: ["jquery"] },
"foundation/jquery.event.move": { deps: ["jquery"] },
"foundation/jquery.event.swipe": { deps: ["jquery"] },
"foundation/jquery.foundation.accordion": { deps: ["jquery", "Modernizr"] },
"foundation/jquery.foundation.alerts": { deps: ["jquery"] },
"foundation/jquery.foundation.buttons": { deps: ["jquery"] },
@wastemobile
wastemobile / README.md
Created September 3, 2013 15:08 — forked from mhayes/README.md

Enabling noConflict mode

Using a default Foundation download you'll see some code like this:

<script>
document.write('<script src=' +
('__proto__' in {} ? 'js/vendor/zepto' : 'js/vendor/jquery') +
'.js><\/script>')

Susy Tutorial

For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.

There is also reference documentation in the works.

What Susy Does

CSS Systems

  • Draft Number: 1
  • Date: 2013-04-14
  • Author: John Porter @designermonkey

Symphony Next

This is all still a little new to me, so forgive me if this sounds naive, or you all have already thought about this and it's obvious, but I've been thinking about how we actually build Next. (I like this as a project codename).

Proposing the Application

@wastemobile
wastemobile / gist:5906638
Last active December 19, 2015 05:49
使用 bootstrap-sass gem 的配置檔。安裝使用 `compass install bootstrap`,升級則用 `compass install bootstrap --force` 才能順利下載並覆蓋 JS 檔。
# Require any additional compass plugins here.
gem "bootstrap-sass", "=2.3.2.0"
require "bootstrap-sass"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "img"
javascripts_dir = "js"
@wastemobile
wastemobile / gist:5541453
Created May 8, 2013 15:58
新建 Foundation 專案的配置檔
# Require any additional compass plugins here.
gem "zurb-foundation", "=4.1.2"
require "zurb-foundation"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "img"
javascripts_dir = "js"
@wastemobile
wastemobile / mountain-lion-brew-setup.markdown
Created December 10, 2012 15:31 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

讓山獅(Mountain Lion)與 Homebrew 快樂並存

1) 安裝 XCode(目前版本 4.5.2)在 /Applications

從 Mac App Store 免費下載安裝。

2) 安裝命令列工具(Command Line Tools)

在 XCode 的 Preferences > Downloads 可以選擇安裝 command line tools。