diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2022-05-25 20:09:40 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2022-05-25 20:09:40 -0600 |
commit | 1c4d6ec6b49e8f80ccc46ee619caf5eba082f1e0 (patch) | |
tree | af69ad0e8b61fc301e108ad5ea659fce94187a27 | |
parent | 9ed5d09180b6c975d60828265a2cd1eee9ac1ab4 (diff) |
add support for gdscript
-rw-r--r-- | blog/plt/base.html | 1 | ||||
-rw-r--r-- | blog/plt/page.html | 5 | ||||
-rw-r--r-- | static/hl/languages/gdscript.min.js | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/blog/plt/base.html b/blog/plt/base.html index 3c0e3c9..4cb4827 100644 --- a/blog/plt/base.html +++ b/blog/plt/base.html @@ -18,6 +18,7 @@ <!-- highlight support for code blocks --> <script type="text/javascript" src="hl/highlight.min.js"></script> <!--<script type="text/javascript" src="hl/highlight-ln.min.js"></script>--> + {%block gdscript_hl%}{%endblock gdscript_hl%} <script type="text/javascript"> hljs.initHighlightingOnLoad(); // hljs.initLineNumbersOnLoad(); diff --git a/blog/plt/page.html b/blog/plt/page.html index 92aed91..cdfbdf2 100644 --- a/blog/plt/page.html +++ b/blog/plt/page.html @@ -2,6 +2,11 @@ {%block html_lang%}{{page.lang}}{%endblock html_lang%} {%block head_title%}{{page.title}}{%endblock head_title%} {%block head_description%}{{page.summary}}{%endblock head_description%} +{%block gdscript_hl%} +{%if "godot" in page.tags%} + <script type="text/javascript" src="hl/languages/gdscript.min.js"></script> +{%endif%} +{%endblock gdscript_hl%} {%block head_og%} <meta property="og:title" content="{{page.title}} -- {{config.get("info", "title")}}"/> <meta property="og:type" content="article"/> diff --git a/static/hl/languages/gdscript.min.js b/static/hl/languages/gdscript.min.js new file mode 100644 index 0000000..3204130 --- /dev/null +++ b/static/hl/languages/gdscript.min.js @@ -0,0 +1 @@ +hljs.registerLanguage("gdscript",function(){"use strict";var e=e||{};function r(e){return{aliases:["godot","gdscript"],keywords:{keyword:"and in not or self void as assert breakpoint class class_name extends is func setget signal tool yield const enum export onready static var break continue if elif else for pass return match while remote sync master puppet remotesync mastersync puppetsync",built_in:"Color8 ColorN abs acos asin atan atan2 bytes2var cartesian2polar ceil char clamp convert cos cosh db2linear decimals dectime deg2rad dict2inst ease exp floor fmod fposmod funcref get_stack hash inst2dict instance_from_id inverse_lerp is_equal_approx is_inf is_instance_valid is_nan is_zero_approx len lerp lerp_angle linear2db load log max min move_toward nearest_po2 ord parse_json polar2cartesian posmod pow preload print_stack push_error push_warning rad2deg rand_range rand_seed randf randi randomize range_lerp round seed sign sin sinh smoothstep sqrt step_decimals stepify str str2var tan tanh to_json type_exists typeof validate_json var2bytes var2str weakref wrapf wrapi bool int float String NodePath Vector2 Rect2 Transform2D Vector3 Rect3 Plane Quat Basis Transform Color RID Object NodePath Dictionary Array PoolByteArray PoolIntArray PoolRealArray PoolStringArray PoolVector2Array PoolVector3Array PoolColorArray",literal:"true false null"},contains:[e.NUMBER_MODE,e.HASH_COMMENT_MODE,{className:"comment",begin:/"""/,end:/"""/},e.QUOTE_STRING_MODE,{variants:[{className:"function",beginKeywords:"func"},{className:"class",beginKeywords:"class"}],end:/:/,contains:[e.UNDERSCORE_TITLE_MODE]}]}}return e.exports=function(e){e.registerLanguage("gdscript",r)},e.exports.definer=r,e.exports.definer||e.exports}());
\ No newline at end of file |