templates/frontend/default/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. {% block html_start %}
  3. <html lang="zh-Hant">
  4. {% endblock html_start %}
  5. <head>
  6. <meta name="Description" content="{{ 'desc' | trans }}">
  7. <!-- start: Meta -->
  8. <meta charset="utf-8">
  9. <title>{{ 'title' | trans }}</title>
  10. <!--http://www.html5rocks.com/en/mobile/mobifying/-->
  11. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  12. <!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
  13. <meta name="mobile-web-app-capable" content="yes">
  14. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  15. <meta name="format-detection" content="telephone=no">
  16. <!-- force webkit on 360 -->
  17. <meta name="renderer" content="webkit"/>
  18. <meta name="force-rendering" content="webkit"/>
  19. <!-- force edge on IE -->
  20. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  21. <meta name="msapplication-tap-highlight" content="no">
  22. <!-- force full screen on some browser -->
  23. <meta name="full-screen" content="yes"/>
  24. <meta name="x5-fullscreen" content="true"/>
  25. <meta name="360-fullscreen" content="true"/>
  26. <!-- force screen orientation on some browser -->
  27. <meta name="screen-orientation" content="portrait"/>
  28. <meta name="x5-orientation" content="portrait">
  29. <!--fix fireball/issues/3568 -->
  30. <!--<meta name="browsermode" content="application">-->
  31. <meta name="x5-page-mode" content="app">
  32. <!-- end: Meta -->
  33. <!-- start: Mobile Specific -->
  34. <meta name="viewport" content="width=device-width, initial-scale=1">
  35. <!-- end: Mobile Specific -->
  36. <!-- start: CSS -->
  37. <link rel="stylesheet" href="{{ asset('css/style.css') }}"/>
  38. <link rel="stylesheet" href="{{ asset('css/style-mobile.css') }}"/>
  39. {{ encore_entry_script_tags('frontend') }}
  40. <script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script>
  41. <script type="text/javascript" src="{{ asset('js/bootstrap/bootstrap.min.js') }}"></script>
  42. {{ encore_entry_link_tags('frontend') }}
  43. <link rel="icon" href="{{ asset('icon.png') }}"/>
  44. <!-- end: CSS -->
  45. {% block css %}
  46. <!-- custom css here -->
  47. {% endblock %}
  48. {% block gtag %}
  49. <!-- Global Site Tag (gtag.js) - Google Analytics -->
  50. <script async src="https://www.googletagmanager.com/gtag/js?id=G-8DSFG2GSB2"></script>
  51. <script>
  52. window.dataLayer = window.dataLayer || [];
  53. function gtag() {
  54. dataLayer.push(arguments);
  55. }
  56. gtag('js', new Date());
  57. gtag('config', 'G-8DSFG2GSB2');
  58. </script>
  59. <script>
  60. var _hmt = _hmt || [];
  61. (function() {
  62. let hm = document.createElement("script");
  63. hm.src = "https://hm.baidu.com/hm.js?652e1188255133c513754f682c7dcf3d";
  64. let s = document.getElementsByTagName("script")[0];
  65. s.parentNode.insertBefore(hm, s);
  66. })();
  67. </script>
  68. {% endblock %}
  69. {% block customGA %}
  70. <script>
  71. function gtag_action_language(result){
  72. gtag('event', 'change language', {
  73. 'event_category': '{{ custom_data }}',
  74. 'event_label': result
  75. });
  76. }
  77. </script>
  78. {% endblock %}
  79. {% block custom %}
  80. <meta property="og:type" content="website"/>
  81. <meta property="og:image" content="{{ hostname }}/main.png"/>
  82. <meta property="og:description" content="{{ 'desc' | trans }}">
  83. <meta property="og:title" content="{{ 'title' | trans }}">
  84. <meta property="og:site_name" content="{{ 'title' | trans }}">
  85. {% endblock %}
  86. {% block javascript %}
  87. {% endblock %}
  88. </head>
  89. <body>
  90. <script>
  91. window.onload=function () {
  92. document.addEventListener('touchstart',function (event) {
  93. if(event.touches.length>1){
  94. event.preventDefault();
  95. }
  96. });
  97. let lastTouchEnd=0;
  98. document.addEventListener('touchend',function (event) {
  99. let now=(new Date()).getTime();
  100. if(now-lastTouchEnd<=300){
  101. event.preventDefault();
  102. }
  103. lastTouchEnd=now;
  104. },false);
  105. document.addEventListener('gesturestart', function (event) {
  106. event.preventDefault();
  107. });
  108. }
  109. </script>
  110. {% block wechat_config %}
  111. {% set wx_config = wechatConfig(app.request) %}
  112. {#{{ wx_config | keys | join(', ')}}#}
  113. {% if wx_config['isWeChat'] is defined and wx_config['isWeChat'] == 1 %}
  114. <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  115. <script>
  116. let shareLink = !window.location.origin ? window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '') : window.location.origin;
  117. wx.config({
  118. debug: false,
  119. appId: '{{ wx_config['appId'] }}',
  120. timestamp: {{ wx_config['timestamp'] }},
  121. nonceStr: '{{ wx_config['noncestr'] }}',
  122. signature: '{{ wx_config['signature'] }}',
  123. jsApiList: [
  124. "hideMenuItems",
  125. "onMenuShareAppMessage",
  126. "onMenuShareTimeline",
  127. ]
  128. });
  129. wx.ready(function () {
  130. wx.hideMenuItems({
  131. menuList: ["menuItem:share:facebook", "menuItem:share:qq", "menuItem:share:QZone",
  132. "menuItem:share:weiboApp", "menuItem:originPage", "menuItem:openWithSafari",
  133. "menuItem:share:email", "menuItem:copyUrl", "menuItem:readMode", "menuItem:delete", "menuItem:editTag"]
  134. });
  135. wx.onMenuShareAppMessage({
  136. title: '{{ "title" | trans }}',
  137. desc: '{{ "desc" | trans }}',
  138. link: '{{ wechat_share_href|raw }}',
  139. imgUrl: shareLink + '/icon1.png',
  140. type: '',
  141. dataUrl: '',
  142. success: function () {
  143. }
  144. });
  145. wx.onMenuShareTimeline({
  146. title: '{{ "title" | trans }}',
  147. link: '{{ wechat_share_href|raw }}',
  148. imgUrl: shareLink + '/icon1.png',
  149. success: function () {
  150. console.log("share to moment");
  151. }
  152. });
  153. });
  154. </script>
  155. {% endif %}
  156. {% endblock %}
  157. {% block header %}
  158. {% endblock %}
  159. {% block body %}
  160. {% endblock %}
  161. </body>
  162. </html>