ทดสองใช้ Github Gist เพื่อเขียนโค้ด สวยๆ ให้มาแสดงใน blog ของเรา
ทดสองใช้ Github Gist เพื่อเขียนโค้ด สวยๆ ให้มาแสดงใน blog ของเรา
ไม่มีอะไรมากครับ ง่ายๆ มาก ผมเชื่อว่าทุกคนที่ทำงานสาย dev จะมี account Github อยู่แล้ว เพียงแค่คุณไปเขียนโค้ดไว้ที่ Gist แล้วก็ embed code มาไว้ที่หน้าเว็บเราครับ โดย Gist จะให้มาเป็น javascript code ครับ แล้วเราก็เอาโค้ดที่ได้มาแปะไว้ที่ blog เราได้โดย Embed ดังตัวอย่างอย่างล่าง
ไม่มีอะไรมากครับ ง่ายๆ มาก ผมเชื่อว่าทุกคนที่ทำงานสาย dev จะมี account Github อยู่แล้ว เพียงแค่คุณไปเขียนโค้ดไว้ที่ Gist แล้วก็ embed code มาไว้ที่หน้าเว็บเราครับ โดย Gist จะให้มาเป็น javascript code ครับ แล้วเราก็เอาโค้ดที่ได้มาแปะไว้ที่ blog เราได้โดย Embed ดังตัวอย่างอย่างล่าง
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function (grunt) { | |
// load all grunt tasks | |
grunt.loadNpmTasks('grunt-contrib-less'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.initConfig({ | |
watch: { | |
// if any .less file changes in directory "public/css/" run the "less"-task. | |
files: "public/css/*.less", | |
tasks: ["less"] | |
}, | |
// "less"-task configuration | |
less: { | |
// production config is also available | |
development: { | |
options: { | |
// Specifies directories to scan for @import directives when parsing. | |
// Default value is the directory of the source, which is probably what you want. | |
paths: ["public/css/"], | |
}, | |
files: { | |
// compilation.css : source.less | |
"public/css/app.css": "public/css/app.less" | |
} | |
}, | |
}, | |
}); | |
// the default task (running "grunt" in console) is "watch" | |
grunt.registerTask('default', ['watch']); | |
}; |
ความคิดเห็น
แสดงความคิดเห็น