diff options
| author | Jieiku | 2022-05-31 03:00:20 -0700 |
|---|---|---|
| committer | Jieiku | 2022-05-31 03:00:20 -0700 |
| commit | 31395878a127a6dd474da50c2f93956588aa2135 (patch) | |
| tree | 0122eb9d2d085ceb87016e3c50912d70462f9f87 /templates/macros | |
| parent | 04631b1f651fd677baf837be318084b91cb9acf4 (diff) | |
| download | abridge-31395878a127a6dd474da50c2f93956588aa2135.tar.gz abridge-31395878a127a6dd474da50c2f93956588aa2135.tar.bz2 abridge-31395878a127a6dd474da50c2f93956588aa2135.zip | |
HTML5 Validation & Cleanup
Diffstat (limited to 'templates/macros')
| -rw-r--r-- | templates/macros/head.html | 120 | ||||
| -rw-r--r-- | templates/macros/social.html | 86 |
2 files changed, 102 insertions, 104 deletions
diff --git a/templates/macros/head.html b/templates/macros/head.html index 9e4d59f..f6090a6 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -1,32 +1,32 @@ {%- macro stylesheet() %} - <link rel="stylesheet" href="{{ get_url(path=config.extra.stylesheet, trailing_slash=false, cachebust=true) | safe }}"> + <link rel="stylesheet" href="{{ get_url(path=config.extra.stylesheet, trailing_slash=false, cachebust=true) | safe }}" /> {%- endmacro %} {%- macro resource() %} {%- if config.extra.fonts %}{%- for i in config.extra.fonts %} {%- if i.url is matching("^http[s]?://") %} - <link rel="preload" as="style" href="{{ i.url | safe }}" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous"> + <link rel="preload" as="style" href="{{ i.url | safe }}" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous" /> {%- else %} - <link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false) | safe }}" type="font/woff2" crossorigin> + <link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false) | safe }}" type="font/woff2" crossorigin /> {%- endif %} {%- endfor %}{%- endif %} {%- if config.extra.fontawesome %} - <link rel="preload" href="{{ config.extra.fontawesome | safe }}" as="style" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous"> + <link rel="preload" href="{{ config.extra.fontawesome | safe }}" as="style" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous" /> {%- endif %} {%- if config.build_search_index %} {%- if config.extra.js_search_index %} - <script defer type="text/javascript" src="{{ get_url(path=config.extra.js_search_index, trailing_slash=false, cachebust=true) | safe }}"></script> + <script defer src="{{ get_url(path=config.extra.js_search_index, trailing_slash=false, cachebust=true) | safe }}"></script> {%- endif %} {%- if config.extra.js_search %} - <script defer type="text/javascript" src="{{ get_url(path=config.extra.js_search, trailing_slash=false, cachebust=true) | safe }}"></script> + <script defer src="{{ get_url(path=config.extra.js_search, trailing_slash=false, cachebust=true) | safe }}"></script> {%- endif %} {%- endif %} {%- if config.generate_feed %} - <link rel="alternate" type="{% if config.feed_filename is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="Atom/RSS Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}"> + <link rel="alternate" type="{% if config.feed_filename is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="Atom/RSS Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" /> {%- endif %} {%- endmacro %} @@ -34,19 +34,19 @@ {%- macro favicons() %} {%- if config.extra.favicon_theme_color %} - <meta name="theme-color" content="{{ config.extra.favicon_theme_color }}"> + <meta name="theme-color" content="{{ config.extra.favicon_theme_color }}" /> {%- endif %} {%- if config.extra.favicon_ms_color %} - <meta name="msapplication-TileColor" content="{{ config.extra.favicon_ms_color }}"> + <meta name="msapplication-TileColor" content="{{ config.extra.favicon_ms_color }}" /> {%- endif %} {%- if config.extra.favicon_webmanifest %} - <link rel="manifest" href="{{ get_url(path=config.extra.favicon_webmanifest, trailing_slash=false) | safe }}"> + <link rel="manifest" href="{{ get_url(path=config.extra.favicon_webmanifest, trailing_slash=false) | safe }}" /> {%- endif %} {%- if config.extra.favicon_mask and config.extra.favicon_mask_color %} - <link rel="mask-icon" href="{{ get_url(path=config.extra.favicon_mask, trailing_slash=false) | safe }}" color="{{ config.extra.favicon_mask_color }}"> + <link rel="mask-icon" href="{{ get_url(path=config.extra.favicon_mask, trailing_slash=false) | safe }}" color="{{ config.extra.favicon_mask_color }}" /> {%- endif %} {%- if config.extra.favicon180 %} @@ -69,11 +69,11 @@ {#- is_404: using for the 404.html template -#} {%- macro seo( title="",title_addition="",description="",type="website",is_home=false,is_404=false,is_page=false,page_images="",page_section="",created_time="2021-07-04T07:07:00-07:00", updated_time="2021-07-04T07:07:00-07:00" ) %} {%- if is_404 -%} - <meta name="robots" content="noindex, follow"> + <meta name="robots" content="noindex, follow" /> {%- else -%} - <meta name="robots" content="index, follow"> - <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"> - <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"> + <meta name="robots" content="index, follow" /> + <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" /> + <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" /> {%- endif -%} {%- if current_url %} @@ -84,25 +84,25 @@ <title>{{ title ~ title_addition }}</title> {%- if config.extra.author %} - <meta name="author" content="{{ config.extra.author }}"> + <meta name="author" content="{{ config.extra.author }}" /> {%- endif %} {%- if config.extra.facebook_publisher %} - <meta property="article:publisher" content="https://www.facebook.com/{{ config.extra.facebook_publisher }}"> + <meta property="article:publisher" content="https://www.facebook.com/{{ config.extra.facebook_publisher }}" /> {%- endif %} - <meta name="copyright" content="{{ title }}"> + <meta name="copyright" content="{{ title }}" /> {%- if config.extra.facebook_author %} - <meta property="article:author" content="https://www.facebook.com/{{ config.extra.facebook_author }}"> + <meta property="article:author" content="https://www.facebook.com/{{ config.extra.facebook_author }}" /> {%- endif %} {%- if page.description %} <meta name="description" content="{{ page.description }}" /> {%- else %} <meta name="description" content="{{ config.description }}" /> {%- endif %} - <link rel="canonical" href="{{ page_url | safe }}"> + <link rel="canonical" href="{{ page_url | safe }}" /> {%- if page.extra.keywords %} - <meta name="keywords" content="{{ page.extra.keywords }}, {{ config.extra.keywords }}"> + <meta name="keywords" content="{{ page.extra.keywords }}, {{ config.extra.keywords }}" /> {%- else %} - <meta name="keywords" content="{{ config.extra.keywords }}"> + <meta name="keywords" content="{{ config.extra.keywords }}" /> {%- endif %} {#- Extra SEO START #} @@ -110,87 +110,87 @@ {%- if not is_404 %} {%- if config.extra.google %} - <meta name="google-site-verification" content="{{ config.extra.google | safe }}"> + <meta name="google-site-verification" content="{{ config.extra.google | safe }}" /> {%- endif %} {%- if config.extra.bing %} - <meta name="msvalidate.01" content="{{ config.extra.bing | safe}}"> + <meta name="msvalidate.01" content="{{ config.extra.bing | safe}}" /> {%- endif %} - <meta property="og:url" content="{{ page_url | safe }}"> - <meta name="twitter:url" content="{{ page_url | safe }}"> + <meta property="og:url" content="{{ page_url | safe }}" /> + <meta name="twitter:url" content="{{ page_url | safe }}" /> {%- if page.description %} - <meta property="og:description" content="{{ page.description }}"> - <meta name="twitter:description" content="{{ page.description }}"> + <meta property="og:description" content="{{ page.description }}" /> + <meta name="twitter:description" content="{{ page.description }}" /> {%- else %} - <meta property="og:description" content="{{ config.description }}"> - <meta name="twitter:description" content="{{ config.description}}"> + <meta property="og:description" content="{{ config.description }}" /> + <meta name="twitter:description" content="{{ config.description}}" /> {%- endif %} {%- if page.title %} - <meta property="og:title" content="{{ page.title }} | {{ title }}"> - <meta name="twitter:title" content="{{ page.title }} | {{ title }}"> + <meta property="og:title" content="{{ page.title }} | {{ title }}" /> + <meta name="twitter:title" content="{{ page.title }} | {{ title }}" /> {%- else %} - <meta property="og:title" content="{{ title }}"> - <meta name="twitter:title" content="{{ title }}"> + <meta property="og:title" content="{{ title }}" /> + <meta name="twitter:title" content="{{ title }}" /> {%- endif %} {#- SEO MEDIA START #} {%- if page.extra.thumbnail %} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}"> - <meta property="og:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}"> + <meta name="twitter:card" content="summary_large_image" /> + <meta name="twitter:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}" /> + <meta property="og:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}" /> {%- elif page.extra.static_thumbnail %} - <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:card" content="summary_large_image" /> {%- if page.extra.static_thumbnail is matching("^http[s]?://") %} - <meta name="twitter:image" content="{{ page.extra.static_thumbnail }}"> - <meta property="og:image" content="{{ page.extra.static_thumbnail }}"> + <meta name="twitter:image" content="{{ page.extra.static_thumbnail }}" /> + <meta property="og:image" content="{{ page.extra.static_thumbnail }}" /> {%- else %} - <meta name="twitter:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}"> - <meta property="og:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}"> + <meta name="twitter:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}" /> + <meta property="og:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}" /> {%- endif %} {%- elif config.extra.banner %} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> - <meta property="og:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> + <meta name="twitter:card" content="summary_large_image" /> + <meta name="twitter:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}" /> + <meta property="og:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}" /> {%- else %} - <meta name="twitter:card" content="summary"> + <meta name="twitter:card" content="summary" /> {%- endif %} {%- if config.extra.open.audio %} - <meta property="og:audio" content="{{ config.extra.open.audio }}"> + <meta property="og:audio" content="{{ config.extra.open.audio }}" /> {%- endif %} {%- if config.extra.open.locale %} - <meta property="og:locale" content="{{ config.extra.open.locale }}"> + <meta property="og:locale" content="{{ config.extra.open.locale }}" /> {%- endif %} {%- if config.extra.open.videos %} {%- for video in config.extra.open.videos %} - <meta property="og:video" content="{{ get_url(path=video) }}"> + <meta property="og:video" content="{{ get_url(path=video) }}" /> {%- endfor %} {%- endif %} {#- SEO MEDIA END #} - <meta property="og:site_name" content="{{ title }}"> - <meta property="og:locale" content="en_US"> - <meta property="og:type" content="website"> + <meta property="og:site_name" content="{{ title }}" /> + <meta property="og:locale" content="en_US" /> + <meta property="og:type" content="website" /> {%- if page.updated %} - <meta property="og:updated_time" content="{{ page.updated | date(format='%F') }}"> + <meta property="og:updated_time" content="{{ page.updated | date(format='%F') }}" /> {%- elif page.date %} - <meta property="og:updated_time" content="{{ page.date | date(format='%F') }}"> + <meta property="og:updated_time" content="{{ page.date | date(format='%F') }}" /> {%- else %} - <meta property="og:updated_time" content="{{ updated_time }}"> + <meta property="og:updated_time" content="{{ updated_time }}" /> {%- endif %} {%- if config.extra.social.twitter %} - <meta name="twitter:site" content="@{{ config.extra.twitter }}"> - <meta name="twitter:creator" content="@{{ config.extra.twitter }}"> + <meta name="twitter:site" content="@{{ config.extra.twitter }}" /> + <meta name="twitter:creator" content="@{{ config.extra.twitter }}" /> {%- endif %} @@ -202,10 +202,10 @@ {%- macro security() %} {%- if config.extra.security_header_referrer %} - <meta name="referrer" content="{{ config.extra.security_header_referrer | safe }}"> + <meta name="referrer" content="{{ config.extra.security_header_referrer | safe }}" /> {%- endif %} {%- if config.extra.security_header_csp %} - <meta http-equiv="Content-Security-Policy" content="{{ config.extra.security_header_csp | safe }}"> + <meta http-equiv="Content-Security-Policy" content="{{ config.extra.security_header_csp | safe }}" /> {%- endif %} {%- endmacro %} @@ -214,7 +214,7 @@ {# https://github.com/KaTeX/KaTeX/tree/main/contrib/mathtex-script-type/ #} {%- macro math() %} {%- if config.extra.math or page.extra.math %} - <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css" as="style" integrity="sha384-ZPe7yZ91iWxYumsBEOn7ieg8q/o+qh/hQpSaPow8T6BwALcXSCS6C6fSRPIAnTQs" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous"> + <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css" as="style" integrity="sha384-ZPe7yZ91iWxYumsBEOn7ieg8q/o+qh/hQpSaPow8T6BwALcXSCS6C6fSRPIAnTQs" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous" /> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.js" integrity="sha384-ljao5I1l+8KYFXG7LNEA7DyaFvuvSCmedUf6Y6JI7LJqiu8q5dEivP2nDdFH31V4" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script> {%- if config.extra.math_auto_render or page.extra.math_auto_render %} diff --git a/templates/macros/social.html b/templates/macros/social.html index d34fb29..c1b0726 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,47 +1,45 @@ {%- macro social_links(social_config) %} {%- set base_url = get_url(path="", lang=lang) %} - <span> - {%- if config.generate_feed %}{%- if config.extra.social.feed %} - <a href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" target="_blank"><span class="svg rss" title="Atom/RSS Feed"></span></a>{% endif %}{% endif %} - {%- if social_config.mail %} - <a href="mailto:{{ social_config.mail }}" target="_blank"><span class="svg mail" title="Mail"></span></a>{% endif %} - {%- if social_config.mastodon %} - <a href="{{ social_config.mastodon }}/" target="_blank"><span class="svg mastodon" title="Mastodon"></span></a>{% endif %} - {%- if social_config.element %} - <a href="https://{{ social_config.element }}/" target="_blank"><span class="svg element" title="Element"></span></a>{% endif %} - {%- if social_config.matrix %} - <a href="https://{{ social_config.matrix }}/" target="_blank"><span class="svg matrix" title="Matrix"></span></a>{% endif %} - {%- if social_config.twitter %} - <a href="https://twitter.com/{{ social_config.twitter }}/" target="_blank"><span class="svg twitter" title="Twitter"></span></a>{% endif %} - {%- if social_config.facebook %} - <a href="https://www.facebook.com/{{ social_config.facebook }}/" target="_blank"><span class="svg facebook" title="Facebook"></span></a>{% endif %} - {%- if social_config.linkedin %} - <a href="https://www.linkedin.com/in/{{ social_config.linkedin }}/" target="_blank"><span class="svg linkedin" title="LinkedIn"></span></a>{% endif %} - {%- if social_config.researchgate %} - <a href="https://www.researchgate.net/profile/{{ social_config.researchgate }}/" target="_blank"><span class="svg researchgate" title="ResearchGate"></span></a>{% endif %} - {%- if social_config.gitlab %} - <a href="https://gitlab.com/{{ social_config.gitlab }}/" target="_blank"><span class="svg gitlab" title="Gitlab"></span></a>{% endif %} - {%- if social_config.github %} - <a href="https://github.com/{{ social_config.github }}/" target="_blank"><span class="svg github" title="Github"></span></a>{% endif %} - {%- if social_config.bitbucket %} - <a href="https://bitbucket.org/{{ social_config.bitbucket }}/" target="_blank"><span class="svg bitbucket" title="Bitbucket"></span></a>{% endif %} - {%- if social_config.python %} - <a href="https://pypi.org/user/{{ social_config.python }}/" target="_blank"><span class="svg python" title="Python"></span></a>{% endif %} - {%- if social_config.docker %} - <a href="https://hub.docker.com/u/{{ social_config.docker }}/" target="_blank"><span class="svg docker" title="Docker"></span></a>{% endif %} - {%- if social_config.stack %} - <a href="https://stackoverflow.com/users/{{ social_config.stack }}/" target="_blank"><span class="svg stack" title="Stack"></span></a>{% endif %} - {%- if social_config.instagram %} - <a href="https://www.instagram.com/{{ social_config.instagram }}/" target="_blank"><span class="svg instagram" title="Instagram"></span></a>{% endif %} - {%- if social_config.pinterest %} - <a href="https://www.pinterest.com/{{ social_config.pinterest }}/" target="_blank"><span class="svg pinterest" title="Pinterest"></span></a>{% endif %} - {%- if social_config.twitch %} - <a href="https://www.twitch.tv/{{ social_config.twitch }}/" target="_blank"><span class="svg twitch" title="Twitch"></span></a>{% endif %} - {%- if social_config.youtube %} - <a href="https://www.youtube.com/channel/{{ social_config.youtube }}/" target="_blank"><span class="svg youtube" title="YouTube"></span></a>{% endif %} - {%- if social_config.buymeacoffee %} - <a href="https://www.buymeacoffee.com/{{ social_config.buymeacoffee }}/" target="_blank"><span class="svg buymeacoffee" title="Buy Me A Coffee"></span></a>{% endif %} - {%- if social_config.github_sponsor %} - <a href="https://github.com/sponsors/{{ social_config.github_sponsor }}/" target="_blank"><span class="svg github-sponsor" title="GitHub Sponsor"></span></a>{% endif %} - </span> + {%- if config.generate_feed %}{%- if config.extra.social.feed %} + <a href="{{ get_url(path=config.feed_filename, trailing_slash=false) | safe }}" target="_blank"><i class="svg rss" title="Atom/RSS Feed"></i></a>{% endif %}{% endif %} + {%- if social_config.mail %} + <a href="mailto:{{ social_config.mail }}" target="_blank"><i class="svg mail" title="Mail"></i></a>{% endif %} + {%- if social_config.mastodon %} + <a href="{{ social_config.mastodon }}/" target="_blank"><i class="svg mastodon" title="Mastodon"></i></a>{% endif %} + {%- if social_config.element %} + <a href="https://{{ social_config.element }}/" target="_blank"><i class="svg element" title="Element"></i></a>{% endif %} + {%- if social_config.matrix %} + <a href="https://{{ social_config.matrix }}/" target="_blank"><i class="svg matrix" title="Matrix"></i></a>{% endif %} + {%- if social_config.twitter %} + <a href="https://twitter.com/{{ social_config.twitter }}/" target="_blank"><i class="svg twitter" title="Twitter"></i></a>{% endif %} + {%- if social_config.facebook %} + <a href="https://www.facebook.com/{{ social_config.facebook }}/" target="_blank"><i class="svg facebook" title="Facebook"></i></a>{% endif %} + {%- if social_config.linkedin %} + <a href="https://www.linkedin.com/in/{{ social_config.linkedin }}/" target="_blank"><i class="svg linkedin" title="LinkedIn"></i></a>{% endif %} + {%- if social_config.researchgate %} + <a href="https://www.researchgate.net/profile/{{ social_config.researchgate }}/" target="_blank"><i class="svg researchgate" title="ResearchGate"></i></a>{% endif %} + {%- if social_config.gitlab %} + <a href="https://gitlab.com/{{ social_config.gitlab }}/" target="_blank"><i class="svg gitlab" title="Gitlab"></i></a>{% endif %} + {%- if social_config.github %} + <a href="https://github.com/{{ social_config.github }}/" target="_blank"><i class="svg github" title="Github"></i></a>{% endif %} + {%- if social_config.bitbucket %} + <a href="https://bitbucket.org/{{ social_config.bitbucket }}/" target="_blank"><i class="svg bitbucket" title="Bitbucket"></i></a>{% endif %} + {%- if social_config.python %} + <a href="https://pypi.org/user/{{ social_config.python }}/" target="_blank"><i class="svg python" title="Python"></i></a>{% endif %} + {%- if social_config.docker %} + <a href="https://hub.docker.com/u/{{ social_config.docker }}/" target="_blank"><i class="svg docker" title="Docker"></i></a>{% endif %} + {%- if social_config.stack %} + <a href="https://stackoverflow.com/users/{{ social_config.stack }}/" target="_blank"><i class="svg stack" title="Stack"></i></a>{% endif %} + {%- if social_config.instagram %} + <a href="https://www.instagram.com/{{ social_config.instagram }}/" target="_blank"><i class="svg instagram" title="Instagram"></i></a>{% endif %} + {%- if social_config.pinterest %} + <a href="https://www.pinterest.com/{{ social_config.pinterest }}/" target="_blank"><i class="svg pinterest" title="Pinterest"></i></a>{% endif %} + {%- if social_config.twitch %} + <a href="https://www.twitch.tv/{{ social_config.twitch }}/" target="_blank"><i class="svg twitch" title="Twitch"></i></a>{% endif %} + {%- if social_config.youtube %} + <a href="https://www.youtube.com/channel/{{ social_config.youtube }}/" target="_blank"><i class="svg youtube" title="YouTube"></i></a>{% endif %} + {%- if social_config.buymeacoffee %} + <a href="https://www.buymeacoffee.com/{{ social_config.buymeacoffee }}/" target="_blank"><i class="svg buymeacoffee" title="Buy Me A Coffee"></i></a>{% endif %} + {%- if social_config.github_sponsor %} + <a href="https://github.com/sponsors/{{ social_config.github_sponsor }}/" target="_blank"><i class="svg github-sponsor" title="GitHub Sponsor"></i></a>{% endif %} {%- endmacro %} |
