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
<?php | |
/** | |
* アーカイブページのエントリーコンテンツの後にカスタム投稿タイプのタクソノミーターム一覧を出力する | |
*/ | |
add_action( | |
'snow_monkey_after_archive_entry_content', | |
function() { | |
$post_type = get_post_type(); | |
$args = array( | |
'taxonomy' => 'blog-cat', |
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
/** | |
* 海外からのアクセスをグローバルサイトにリダイレクトする(MAXMINDのGeoIP2使用) | |
* | |
*/ | |
<script src="//geoip-js.com/js/apis/geoip2/v2.1/geoip2.js"></script> | |
<script> | |
const onSuccess = function(response) { | |
if ((response.country.iso_code !== 'JP') && (response.country.iso_code !== 'JA')) { | |
fetch('//raw.githubusercontent.com/monperrus/crawler-user-agents/master/crawler-user-agents.json') | |
.then(function(response) { |
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'; | |
const gulp = require('gulp'); | |
const nunjucks = require('gulp-nunjucks-render'); | |
const data = require('gulp-data'); | |
const fs = require('fs'); | |
const paths = { | |
'src' : { | |
'root' : 'src/', | |
'template' : 'src/template/', |
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
{% set news_category1 = 'pro' %} | |
{% set news_category2 = '' %} | |
{% set news_current = 1 %} | |
{% block contents -%} | |
<section> | |
<header> | |
<h2>ニュース>製品情報</h2> | |
</header> | |
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
{% set news_category1 = '' %} | |
{% set news_category2 = '' %} | |
{% set news_amount = 5 %} | |
{% block contents -%} | |
<section> | |
<header> | |
<h2>ニュース</h2> | |
</header> | |
<ul> |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>グランドトップ | sample site</title> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="description" content="GTディスクリプション"> | |
<meta name="keywords" content="キーワード1,キーワード2"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
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
{%- if pageT -%} | |
{%- set title = pageT + ' | ' + data.sitename -%}{%- else -%} | |
{%- set title = data.sitename -%} | |
{%- endif -%} | |
{%- if pageD -%} | |
{%- set description = pageD -%}{%- else -%} | |
{%- set description = data.meta.description -%} | |
{%- endif -%} | |
{%- if pageK -%} | |
{%- set keywords = pageK -%}{%- else -%} |
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
{% extends 'layout/_default.njk' %} | |
{% set pageT = 'グランドトップ' %} | |
{% set pageD = 'GTディスクリプション' %} | |
{% set pageK = 'キーワード1,キーワード2' %} | |
{% set ogType = 'website' %} | |
{% block contents -%} | |
<p>グランドトップのコンテンツ</p> | |
{%- endblock %} |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
{% include 'partial/site/_dochead.njk' -%} | |
<!-- GTMタグなど --> | |
</head> | |
<body> | |
<!-- GTMタグなど --> | |
{% include 'partial/site/_header.njk' -%} | |
{% block contents -%}{%- endblock %} |
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
// set:beautify_option | |
const beautify_option = { | |
'indent_size': 2 | |
} | |
// task:nunjucks | |
gulp.task('nunjucks', function(){ | |
return gulp.src(paths.src.html + '**/*.njk') | |
.pipe(data(function(){ | |
return require(paths.src.json); |
NewerOlder