Skip to content

Instantly share code, notes, and snippets.

View blog-nunjucks-parts01.js
// task:nunjucks
gulp.task('nunjucks', function(){
return gulp.src(paths.src.html + '**/*.njk')
.pipe(nunjucks({
path: paths.src.template
}))
.pipe(gulp.dest(paths.dest.root))
});
View gulpfile-nunjucs.js
'use strict';
const gulp = require('gulp');
const nunjucks = require('gulp-nunjucks-render');
const data = require('gulp-data');
const beautify = require('gulp-html-beautify');
const brsync = require('browser-sync');
const paths = {
'src' : {
@867
867 / Deploy-subdirectory.php
Last active Dec 21, 2015
BacklogのサブディレクトリのみをCPIへのデプロイするスクリプト。
View Deploy-subdirectory.php
<?php
/**
* BacklogからCPIへのデプロイスクリプト(https://gist.github.com/hissy/6a114d0d9a85f3338aed)
* 上記に対し、Gitのサブディレクトリ(/html)のみをデプロイするよう改変しました。
*/
// CPIユーザーID(契約情報で確認してください)
$user_id = 'abc123defg';
// Gitレポジトリの位置の指定(固定で[.git])
$git_dir = '/usr/home/' . $user_id . '/.git';
@867
867 / Blog-httpd-vhosts.conf
Last active Jan 12, 2016
Apache2.4系でVirtualDocumentRootを使うときの設定
View Blog-httpd-vhosts.conf
## Apache2.4系 VirtualDocumentRootを使う場合の設定
UseCanonicalName Off
<virtualhost *:80>
VirtualDocumentRoot "c:/var/www/%0/html"
</virtualhost>
<directory "c:/var/www/*/html">
Require all granted
</directory>
@867
867 / Blog-httpd-vhosts.conf
Last active Jan 12, 2016
Apach2.4系のバーチャルホスト設定
View Blog-httpd-vhosts.conf
## Apache2.4系 通常のバーチャルホスト設定
<VirtualHost *:80>
DocumentRoot "c:/var/www/dev.sample1.local/html"
ServerName dev.sample1.local
ErrorLog "logs/sample1-error.log"
CustomLog "logs/sample1-access.log" common
<Directory "c:/var/www/dev.sample1.local/html">
Require all granted
</Directory>
View Blog-Templates-result.html
<div id="header" class="l-header">
<ul class="navGlobal">
<li><a href="/">HOME</a></li>
<li><a href="/works/">実績紹介</a></li>
<li><a class="is-active" href="/company/">企業情報</a></li>
<li><a href="/recruit/">採用情報</a></li>
<li><a href="/news/">ニュース</a></li>
<li><a href="/contact/">お問い合わせ</a></li>
</ul>
</div>
View Blog-Template_bodyclass.html
<body @@((second!='') ? 'class="t-'+global+'-'+second+'"' : 'class="t-'+global+'"')@@>
View Blog-Templates_header2.html
<head>
<!-- InstanceParam name="global" type="text" value="company" -->
<!-- InstanceParam name="second" type="text" value="message" -->
<!-- InstanceParam name="col2" type="boolean" value="true" -->
</head>
View Blog-Templates_layout.html
<div id="contents" class="l-contents">
<!-- TemplateBeginIf cond="!col2" -->
<div id="main" class="l-main col1">
<!-- TemplateBeginEditable name="main1" -->●●<!-- TemplateEndEditable -->
</div>
<!-- TemplateEndIf -->
<!-- TemplateBeginIf cond="col2" -->
<div id="main" class="l-main col2">
<!-- TemplateBeginEditable name="main2" -->●●<!-- TemplateEndEditable -->
</div>
View Blog-Templates_navigation.html
<ul class="navGlobal">
<li><a@@((global=='home') ? ' class="is-active"':'')@@ href="/">HOME</a></li>
<li><a@@((global=='works') ? ' class="is-active"':'')@@ href="/works/">実績紹介</a></li>
<li><a@@((global=='company') ? ' class="is-active"':'')@@ href="/company/">企業情報</a></li>
<li><a@@((global=='recruit') ? ' class="is-active"':'')@@ href="/recruit/">採用情報</a></li>
<li><a@@((global=='news') ? ' class="is-active"':'')@@ href="/news/">ニュース</a></li>
<li><a@@((global=='contact') ? ' class="is-active"':'')@@ href="/contact/">お問い合わせ</a></li>
</ul>