👏

a-blog cms 開発を楽にする vscode の htmlスニペット

2025/02/17に公開
/.vscode/acms.code-snippets
{
	// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }

	// module
	"!Entry_Body": {
		"prefix": "!entry_body",
		"body": [
			"<!-- BEGIN_MODULE Entry_Body id=\"{{$1}}\" -->$0<!-- END_MODULE Entry_Body -->",
		]
	},
	"!Entry_Headline": {
		"prefix": "!entry_headline",
		"body": [
			"<!-- BEGIN_MODULE Entry_Headline id=\"{{$1}}\" -->$0<!-- END_MODULE Entry_Headline -->",
		]
	},
	"!Entry_Summary": {
		"prefix": "!entry_summary",
		"body": [
			"<!-- BEGIN_MODULE Entry_Summary id=\"{{$1}}\" -->",
			"<!-- BEGIN_IF [<!-- BEGIN notFound -->notFound<!-- END notFound -->/nem] -->",
			"$2",
			"<!-- ELSE -->",
			"<!-- BEGIN entry:loop -->",
			"$0",
			"<!-- END entry:loop -->",
			"<!-- END_IF -->",
			"<!-- END_MODULE Entry_Summary -->",
		]
	},
	"!Entry_ArchiveList": {
		"prefix": "!entry_archive_list",
		"body": [
			"<!-- BEGIN_MODULE Entry_ArchiveList $1-->",
			"<ul>",
				"<!-- BEGIN archive:loop -->",
				"<li><a href=\"{url}\">{date#Y}年 {date#n}月 <span>{amount}</span></a></li>",
				"<!-- END archive:loop -->",
			"</ul>",
			"<!-- END_MODULE Entry_ArchiveList -->"
		]
	},
	"!Blog_Field": {
		"prefix": "!blog_field",
		"body": [
			"<!-- BEGIN_MODULE Blog_Field $1-->",
			"$0",
			"<!-- END_MODULE Blog_Field -->",
		]
	},
	"!Category_Field": {
		"prefix": "!category_field",
		"body": [
			"<!-- BEGIN_MODULE Category_Field $1-->",
			"$0",
			"<!-- END_MODULE Category_Field -->",
		]
	},
	"!Module_Field": {
		"prefix": "!module_field",
		"body": [
			"<!-- BEGIN_MODULE Module_Field $1-->",
			"$0",
			"<!-- END_MODULE Module_Field -->",
		]
	},
	"!Category_List": {
		"prefix": "!category_list",
		"body": [
			"<!-- BEGIN_MODULE Category_List $1-->",
			"<!-- BEGIN category:loop --><!-- BEGIN ul#front -->",
				"<ul><!-- END ul#front --><!-- BEGIN li#front -->",
					"<li><!-- END li#front -->",
						"<!-- BEGIN category:veil -->",
						"<a href=\"{url}\">",
							"<span>{name}</span>",
							"<!-- BEGIN amount:veil --><span>{amount}</span><!-- END amount:veil -->",
						"</a>",
						"<!-- END category:veil --><!-- BEGIN li#rear -->",
					"</li><!-- END li#rear --><!-- BEGIN ul#rear -->",
				"</ul><!-- END ul#rear -->",
				"<!-- END category:loop -->",
			"<!-- END_MODULE Category_List -->"
		]
	},
	"!Media_Banner": {
		"prefix": "!media_banner",
		"body": [
			"<!-- BEGIN_MODULE Media_Banner $1-->",
				"<!-- BEGIN banner:loop --><!-- BEGIN banner#src -->{src}[raw]<!-- END banner#src -->",
					"<!-- BEGIN banner#img -->",
					"<a href=\"{url}\" target=\"{target}\">",
					"<img src=\"%{MEDIA_ARCHIVES_DIR}{img}\" width=\"{x}\" height=\"{y}\" alt=\"{alt}\" />",
					"</a>",
					"<!-- END banner#img --><!-- END banner:loop -->",
			"<!-- END_MODULE Media_Banner -->"
		]
	},
	"!Navigation": {
		"prefix": "!navigation",
		"body": [
			"<!-- BEGIN_MODULE Navigation $1--><!-- BEGIN navigation:loop --><!-- BEGIN ul#front -->",
			"<ul><!-- END ul#front --><!-- BEGIN li#front -->",
				"<li {attr}><!-- END li#front --><!-- BEGIN link#front -->",
					"<a href=\"{url}\" {attr} target=\"{target}\"><!-- END link#front --><!-- BEGIN label:veil -->",
						"{label}[raw]<!-- END label:veil --><!-- BEGIN link#rear -->",
					"</a><!-- END link#rear --><!-- BEGIN li#rear -->",
				"</li><!-- END li#rear --><!-- BEGIN ul#rear -->",
			"</ul><!-- END ul#rear -->",
			"<!-- END navigation:loop --><!-- END_MODULE Navigation -->"
		]
	},
	"!Tag_Filter": {
		"prefix": "!tag_filter",
		"body": [
			"<!-- BEGIN_MODULE Tag_Filter $1--><!-- BEGIN tagBox -->",
			"<p>選択されているタグ:",
				"<!-- BEGIN selected:loop -->",
				"<span><a href=\"{url}\">{name}</a>",
				"<a href=\"{omitUrl}\">x</a></span><!-- END selected:loop -->",
			"</p>",
			"<!-- BEGIN choice:veil -->",
			"<p>タグを絞り込む :",
				"<!-- BEGIN choice:loop -->",
				"<a href=\"{url}\">{name}</a>",
				"<!-- END choice:loop -->",
			"</p>",
			"<!-- END choice:veil --><!-- END tagBox -->",
			"<!-- END_MODULE Tag_Filter -->"
		]
	},
	"!SetRendered": {
		"prefix": "!setrendered",
		"body": [
			"<!-- BEGIN_SetRendered id=\"$1\" -->",
			"$0",
			"<!-- END_SetRendered -->",
		]
	},
	"!GetRendered": {
		"prefix": "!getrendered",
		"body": [
			"<!-- GET_Rendered id=\"$1\" -->$0"
		]
	},
	"!Touch_Top": {
		"prefix": "!touch_top",
		"body": [
			"<!-- BEGIN_MODULE Touch_Top -->",
			"$1",
			"<!-- END_MODULE Touch_Top -->",
		]
	},
	"!Touch_Index": {
		"prefix": "!touch_index",
		"body": [
			"<!-- BEGIN_MODULE Touch_Index -->",
			"$1",
			"<!-- END_MODULE Touch_Index -->",
		]
	},
	"!Touch_Entry": {
		"prefix": "!touch_entry",
		"body": [
			"<!-- BEGIN_MODULE Touch_Entry -->",
			"$1",
			"<!-- END_MODULE Touch_Entry -->",
		]
	},
	"!Touch_Category": {
		"prefix": "!touch_category",
		"body": [
			"<!-- BEGIN_MODULE Touch_Category -->",
			"$1",
			"<!-- END_MODULE Touch_Category -->",
		]
	},
	"!Touch_Tag": {
		"prefix": "!touch_tag",
		"body": [
			"<!-- BEGIN_MODULE Touch_Tag -->",
			"$1",
			"<!-- END_MODULE Touch_Tag -->",
		]
	},
	"!Touch_RootBlog": {
		"prefix": "!touch_rootblog",
		"body": [
			"<!-- BEGIN_MODULE Touch_RootBlog -->",
			"$1",
			"<!-- END_MODULE Touch_RootBlog -->",
		]
	},
	"!Touch_Login": {
		"prefix": "!touch_login",
		"body": [
			"<!-- BEGIN_MODULE Touch_Login -->",
			"$1",
			"<!-- END_MODULE Touch_Login -->",
		]
	},
	"!Touch_Unlogin": {
		"prefix": "!touch_unlogin",
		"body": [
			"<!-- BEGIN_MODULE Touch_Unlogin -->",
			"$1",
			"<!-- END_MODULE Touch_Unlogin -->",
		]
	},
	"!Touch_NotTop": {
		"prefix": "!touch_ntop",
		"body": [
			"<!-- BEGIN_MODULE Touch_NotTop -->",
			"$1",
			"<!-- END_MODULE Touch_NotTop -->",
		]
	},
	"!Touch_NotIndex": {
		"prefix": "!touch_nindex",
		"body": [
			"<!-- BEGIN_MODULE Touch_NotIndex -->",
			"$1",
			"<!-- END_MODULE Touch_NotIndex -->",
		]
	},
	"!Touch_NotEntry": {
		"prefix": "!touch_nentry",
		"body": [
			"<!-- BEGIN_MODULE Touch_NotEntry -->",
			"$1",
			"<!-- END_MODULE Touch_NotEntry -->",
		]
	},
	"!Touch_NotCategory": {
		"prefix": "!touch_ncategory",
		"body": [
			"<!-- BEGIN_MODULE Touch_NotCategory -->",
			"$1",
			"<!-- END_MODULE Touch_NotCategory -->",
		]
	},
	"!Touch_NotRootBlog": {
		"prefix": "!touch_nrootblog",
		"body": [
			"<!-- BEGIN_MODULE Touch_NotRootBlog -->",
			"$1",
			"<!-- END_MODULE Touch_NotRootBlog -->",
		]
	},
	"!Touch_SessionWithAdministrationration(管理者)": {
		"prefix": "!touch_admin",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionWithAdministration -->",
			"$1",
			"<!-- END_MODULE Touch_SessionWithAdministration -->,"
		]
	},
	"!Touch_SessionWithCompilation(編集者以上)": {
		"prefix": "!touch_compilation",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionWithCompilation -->",
			"$1",
			"<!-- END_MODULE Touch_SessionWithCompilation -->",
		]
	},
	"!Touch_SessionWithContribution(投稿者以上)": {
		"prefix": "!touch_contribution",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionWithContribution -->",
			"$0",
			"<!-- END_MODULE Touch_SessionWithContribution -->",
		]
	},
	"!Touch_SessionWithSubscription(読者以上)": {
		"prefix": "!touch_subscription",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionWithSubscription -->",
			"$1",
			"<!-- END_MODULE Touch_SessionWithSubscription -->",
		]
	},
	"!Touch_SessionContribution(投稿者)": {
		"prefix": "!touch_contribution",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionContribution -->",
			"$1",
			"<!-- END_MODULE Touch_SessionContribution -->",
		]
	},
	"!Touch_SessionCompilation(編集者)": {
		"prefix": "!touch_compilation",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionCompilation -->",
			"$1",
			"<!-- END_MODULE Touch_SessionCompilation -->",
		]
	},
	"!Touch_SessionSubscription(読者)": {
		"prefix": "!touch_subscription",
		"body": [
			"<!-- BEGIN_MODULE Touch_SessionSubscription -->",
			"$1",
			"<!-- END_MODULE Touch_SessionSubscription -->",
		]
	},

	// コメント
	"#prettier_ignore": {
		"prefix": "#prettier_ignore",
		"body": ["<!-- prettier-ignore -->"]
	},

	// field
	"!begin": {
		"prefix": "!begin",
		"body": [
			"<!-- BEGIN $1 -->",
			"$0",
			"<!-- END $1 -->",
		]
	},
	":loop": {
		"prefix": ":loop",
		"body": [
			"<!-- BEGIN $1:loop -->",
			"$0",
			"<!-- END $1:loop -->",
		]
	},
	":veil": {
		"prefix": ":veil",
		"body": [
			"<!-- BEGIN $1:veil -->",
			"$0",
			"<!-- END $1:veil -->",
		]
	},
	":noimage": {
		"prefix": ":noimage",
		"body": [
			"<!-- BEGIN noimage -->",
			"$0",
			"<!-- END noimage -->",
		]
	},
	":glue": {
		"prefix": ":glue",
		"body": [
			"<!-- BEGIN glue -->",
			"{i}$0",
			"<!-- END glue -->",
		]
	},

	// template
	"@IF": {
		"prefix": "@if",
		"body": [
			"<!-- BEGIN_IF [$1] -->$0<!-- END_IF -->"
		]
	},
	"@IF_ELSE": {
		"prefix": "@ifelse",
		"body": [
			"<!-- BEGIN_IF [$1] -->$2<!-- ELSE -->$0<!-- END_IF -->"
		]
	},
	"@ELSEIF": {
		"prefix": "@elseif",
		"body": [
			"<!-- BEGIN_IF [$1] -->$2<!-- ELSE_IF [$3] -->$0<!-- END_IF -->"
		]
	},
	"@include": {
		"prefix": "@include",
		"body": [
			"@include(\"$1\")"
		]
	},
	"@include_module_setting": {
		"prefix": "@include_module_setting",
		"body": [
			"@include(\"/admin/module/setting.html\")"
		]
	},
	"@include_images": {
		"prefix": "@include_images",
		"body": [
			"@include(\"/include/images/$1\")"
		]
	},
	"@include_components": {
		"prefix": "@include_components",
		"body": [
			"@include(\"/include/components/$1\")"
		]
	},
	"@include_entry": {
		"prefix": "@include_entry",
		"body": [
			"@include(\"/include/components/entry/$1\")"
		]
	},
	"@include_parts": {
		"prefix": "@include_parts",
		"body": [
			"@include(\"/include/components/parts/$1\")"
		]
	},
	"@include_body_parts": {
		"prefix": "@include_body_parts",
		"body": [
			"@include(\"/include/components/entry/parts/body/$1\")"
		]
	},
	"@include_summary_parts": {
		"prefix": "@include_summary_parts",
		"body": [
			"@include(\"/include/components/entry/parts/summary/$1\")"
		]
	},
	"@verbatim": {
		"prefix": "@verbatim",
		"body": [
			"@verbatim",
			"$1",
			"@endverbatim"
		]
	},

	// global var
	"%HOME_URL": {
		"prefix": "%home",
		"body": [
			"%{HOME_URL}$0"
		]
	},
	"%HTTP_MEDIA_ARCHIVES_DIR": {
		"prefix": "%media",
		"body": [
			"%{HTTP_MEDIA_ARCHIVES_DIR}$0"
		]
	},
	"%CURRENT_URL": {
		"prefix": "%current",
		"body": [
			"%{CURRENT_URL}$0"
		]
	},
	"%NOW_DATE" : {
		"prefix": "%now_date",
		"body": [
			"%{NOW_DATE}$0"
		]
	},
	"%NOW_TIME" : {
		"prefix": "%now_time",
		"body": [
			"%{NOW_TIME}$0"
		]
	}
}

Discussion