ios text size bug fix, header swipe library changed to light one, clean up unnecessary files.
This commit is contained in:
		
							parent
							
								
									d694803540
								
							
						
					
					
						commit
						c7b2ebc3b8
					
				| 
						 | 
				
			
			@ -765,6 +765,14 @@ header:
 | 
			
		|||
 | 
			
		||||
  - type: slide
 | 
			
		||||
    height: 235
 | 
			
		||||
    options:
 | 
			
		||||
        startSlide: 0
 | 
			
		||||
        auto: 5000 # auto slide delay 5000ms(5sec)
 | 
			
		||||
        draggable: true # slide draggable
 | 
			
		||||
        autoRestart: true # restart after drag finished
 | 
			
		||||
        continuous: true # last to first
 | 
			
		||||
        disableScroll: true
 | 
			
		||||
        stopPropagation: true
 | 
			
		||||
    slide:
 | 
			
		||||
      - paddingX: 50
 | 
			
		||||
        paddingY: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -758,6 +758,14 @@ header:
 | 
			
		|||
 | 
			
		||||
  - type: slide
 | 
			
		||||
    height: 235
 | 
			
		||||
    options:
 | 
			
		||||
        startSlide: 0
 | 
			
		||||
        auto: 5000 # auto slide delay 5000ms(5sec)
 | 
			
		||||
        draggable: true # slide draggable
 | 
			
		||||
        autoRestart: true # restart after drag finished
 | 
			
		||||
        continuous: true # last to first
 | 
			
		||||
        disableScroll: true
 | 
			
		||||
        stopPropagation: true
 | 
			
		||||
    slide:
 | 
			
		||||
      - paddingX: 50
 | 
			
		||||
        paddingY: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,14 @@ header:
 | 
			
		|||
 | 
			
		||||
  - type: slide
 | 
			
		||||
    height: 235
 | 
			
		||||
    options:
 | 
			
		||||
        startSlide: 0
 | 
			
		||||
        auto: 5000
 | 
			
		||||
        draggable: true
 | 
			
		||||
        autoRestart: true
 | 
			
		||||
        continuous: true
 | 
			
		||||
        disableScroll: true
 | 
			
		||||
        stopPropagation: true
 | 
			
		||||
    slide:
 | 
			
		||||
      - paddingX: 50
 | 
			
		||||
        paddingY: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
@import "../themes/theme";
 | 
			
		||||
 | 
			
		||||
$text-font-stack: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif !default;
 | 
			
		||||
$code-font-stack: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace !default;
 | 
			
		||||
$code-font-stack: Consolas, Monaco, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", "Lucida Console", "Lucida Sans Typewriter", "Liberation Mono", "Nimbus Mono L", Monaco, Courier, monospace !default;
 | 
			
		||||
 | 
			
		||||
$z-indexes: ("modal", "navbar", "dropdown", "header", "gtt", "clipboard", "grid", "search-btn", "search", "content", "footer", "taxo", "toc", "gallery-mask");
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +12,3 @@ $breakpoints: (
 | 
			
		|||
  'lg': 1280px,
 | 
			
		||||
  'xl': 1960px,
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
$search-height: 35px !default;
 | 
			
		||||
$code-font-size: .9rem !default;
 | 
			
		||||
| 
						 | 
				
			
			@ -3,11 +3,13 @@
 | 
			
		|||
 */
 | 
			
		||||
body {
 | 
			
		||||
  font: normal 125% / 1.4 $text-font-stack;
 | 
			
		||||
  -webkit-text-size-adjust: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
code,
 | 
			
		||||
pre {
 | 
			
		||||
  font: normal 125% / 1.8 $code-font-stack;
 | 
			
		||||
  -webkit-text-size-adjust: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.h1 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
.search {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  border-radius: 0.25rem;
 | 
			
		||||
  height: $search-height;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
  z-index: z('search');
 | 
			
		||||
  margin-bottom: 0.5rem;  
 | 
			
		||||
  
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +83,7 @@
 | 
			
		|||
      display: inline-block;
 | 
			
		||||
      margin-top: 0.25rem;
 | 
			
		||||
      position: absolute;
 | 
			
		||||
      top: $search-height;
 | 
			
		||||
      top: 35px;
 | 
			
		||||
      width: 100%;
 | 
			
		||||
      border-radius: 0.1rem;
 | 
			
		||||
      @include box-shadow(0, 1px, 3px, 0, rgba(0, 0, 0, 0.4));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,4 @@
 | 
			
		|||
.header {
 | 
			
		||||
  @include flexbox();
 | 
			
		||||
  @include align-items(center);
 | 
			
		||||
  @include justify-content(center);
 | 
			
		||||
  @include flex-direction(column);
 | 
			
		||||
 | 
			
		||||
  .title {
 | 
			
		||||
    font-family: $title-font;
 | 
			
		||||
    font-weight: 900;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,6 +126,7 @@
 | 
			
		|||
      padding: 34px 12px 8px;
 | 
			
		||||
      overflow: auto;
 | 
			
		||||
      border-radius: 0.34rem;
 | 
			
		||||
      line-height: 1.5;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pre:not(.chroma) {
 | 
			
		||||
| 
						 | 
				
			
			@ -152,7 +153,7 @@
 | 
			
		|||
        height: 30px;
 | 
			
		||||
        z-index: z('content');
 | 
			
		||||
        line-height: 30px;
 | 
			
		||||
        font-size: $code-font-size;
 | 
			
		||||
        font-size: 13.8px;
 | 
			
		||||
        font-family: $title-font;
 | 
			
		||||
        font-weight: bold;
 | 
			
		||||
        display: inline-block;
 | 
			
		||||
| 
						 | 
				
			
			@ -376,9 +377,10 @@
 | 
			
		|||
 | 
			
		||||
code, pre {  
 | 
			
		||||
  padding: .5rem 0;
 | 
			
		||||
  line-height: 1.4;
 | 
			
		||||
  font-size: $code-font-size;
 | 
			
		||||
  line-height: 1.5;
 | 
			
		||||
  font-size: 13.8px;
 | 
			
		||||
  font-family: $code-font-stack;
 | 
			
		||||
  overflow: auto;
 | 
			
		||||
 | 
			
		||||
  a {
 | 
			
		||||
    text-decoration: none !important;
 | 
			
		||||
| 
						 | 
				
			
			@ -466,7 +468,7 @@ pre:not(.chroma) {
 | 
			
		|||
      width: 100%;
 | 
			
		||||
      height: 30px;
 | 
			
		||||
      line-height: 30px;
 | 
			
		||||
      font-size: $code-font-size;
 | 
			
		||||
      font-size: 13.8px;
 | 
			
		||||
      font-family: $title-font;
 | 
			
		||||
      font-weight: bold;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
| 
						 | 
				
			
			@ -481,10 +483,6 @@ pre:not(.chroma) {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  .lntd {
 | 
			
		||||
    // Fix code block null line height and
 | 
			
		||||
    // Synchronous gutter and code line highly.
 | 
			
		||||
    line-height: round($code-font-size * 1.5);
 | 
			
		||||
 | 
			
		||||
    &:first-child {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      @include no-select;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,10 +23,6 @@
 | 
			
		|||
  sri = "sha256-3Fdoa5wQb+JYfEmTpQHx9sc/GuwpfC/0R9EpBki+mf8="
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/mathjax@3.0.0/es5/tex-chtml.js"
 | 
			
		||||
 | 
			
		||||
[js.swiper]
 | 
			
		||||
  sri = "sha256-ZATCxHgcbalqi3AxHm7sPmwbfs3oZ4feGmCARVDmXig="
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/swiper@5.2.0/js/swiper.min.js"
 | 
			
		||||
 | 
			
		||||
[js.webfont]
 | 
			
		||||
  sri = "" # no sri
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.min.js"
 | 
			
		||||
| 
						 | 
				
			
			@ -72,10 +68,6 @@
 | 
			
		|||
  sri = "sha256-V8SV2MO1FUb63Bwht5Wx9x6PVHNa02gv8BgH/uH3ung="
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"
 | 
			
		||||
 | 
			
		||||
[css.swiper]
 | 
			
		||||
  sri = "sha256-s2QA0JtYEOOqRUyzKN+k2a/RxcimDuF2HZBdsosQRbM="
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/swiper@5.2.0/css/swiper.min.css"
 | 
			
		||||
 | 
			
		||||
[css.sequence_diagram]
 | 
			
		||||
  sri = "sha256-On01v36B8LRDuL2tqhqs7Gb3Cm/NIpsLFy4OarOodUA="
 | 
			
		||||
  url = "https://cdn.jsdelivr.net/npm/@rokt33r/js-sequence-diagrams@2.0.6-2/dist/sequence-diagram-min.css"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +0,0 @@
 | 
			
		|||
{
 | 
			
		||||
  "direction": "horizontal",
 | 
			
		||||
  "loop": true,
 | 
			
		||||
  "preventClicks": false,
 | 
			
		||||
  "pagination": {
 | 
			
		||||
    "el": ".swiper-pagination"
 | 
			
		||||
  },
 | 
			
		||||
    "autoplay": {
 | 
			
		||||
      "delay": 10000
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -40,6 +40,14 @@ header:
 | 
			
		|||
 | 
			
		||||
  - type: slide
 | 
			
		||||
    height: 235
 | 
			
		||||
    options:
 | 
			
		||||
        startSlide: 0
 | 
			
		||||
        auto: 5000
 | 
			
		||||
        draggable: true
 | 
			
		||||
        autoRestart: true
 | 
			
		||||
        continuous: true
 | 
			
		||||
        disableScroll: true
 | 
			
		||||
        stopPropagation: true
 | 
			
		||||
    slide:
 | 
			
		||||
      - paddingX: 50
 | 
			
		||||
        paddingY: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
				
			
			@ -1,47 +0,0 @@
 | 
			
		|||
{{- $pctx := . -}}
 | 
			
		||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
 | 
			
		||||
{{- $pages := $pctx.RegularPages -}}
 | 
			
		||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
 | 
			
		||||
{{- if ge $limit 1 -}}
 | 
			
		||||
{{- $pages = $pages | first $limit -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
{{ $length := (len $pages) -}}
 | 
			
		||||
{
 | 
			
		||||
    "version" : "https://jsonfeed.org/version/1",
 | 
			
		||||
    "title" : "{{ if eq  .Title  .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ .Site.Title }}{{ end }}",
 | 
			
		||||
    "description": "{{ i18n "string_recent_content" }} {{ if ne  .Title  .Site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ .Site.Title }}",
 | 
			
		||||
    "home_page_url" : "{{ .Site.BaseURL }}",
 | 
			
		||||
    {{ with .OutputFormats.Get "JSON" -}}
 | 
			
		||||
    "feed_url" : "{{ .Permalink }}",
 | 
			
		||||
    {{ end -}}
 | 
			
		||||
    {{ with $.Param "icon" -}}
 | 
			
		||||
    "icon" : "{{ . | absURL }}",
 | 
			
		||||
    {{ end -}}
 | 
			
		||||
    {{ with $.Param "favicon" -}}
 | 
			
		||||
    "favicon" : "{{ . | absURL }}",
 | 
			
		||||
    {{ end -}}
 | 
			
		||||
    {{ with .Site.Author.name -}}
 | 
			
		||||
    "author" : {
 | 
			
		||||
        "name" : "{{ . }}"{{ with $.Site.Author.url }},
 | 
			
		||||
        "url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
 | 
			
		||||
        "avatar": "{{ . | absURL }}"{{ end }}
 | 
			
		||||
    },
 | 
			
		||||
    {{ end -}}
 | 
			
		||||
    "items" : [
 | 
			
		||||
    {{ range $index, $element := $pages -}}
 | 
			
		||||
    {
 | 
			
		||||
        "title" : {{ .Title | jsonify }},
 | 
			
		||||
        "date_published" : "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
 | 
			
		||||
        "date_modified" : "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}",
 | 
			
		||||
        "id" : "{{ .Permalink }}",
 | 
			
		||||
        "url" : "{{ .Permalink }}",
 | 
			
		||||
        {{ with .Params.author -}}
 | 
			
		||||
        "author" : {
 | 
			
		||||
          "name" : "{{ . }}"
 | 
			
		||||
        },
 | 
			
		||||
        {{ end -}}
 | 
			
		||||
        "content_html" : {{ .Content | jsonify }}
 | 
			
		||||
    }{{ if ne (add $index 1) $length }},{{ end }}
 | 
			
		||||
    {{ end -}}
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,22 +0,0 @@
 | 
			
		|||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
 | 
			
		||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
 | 
			
		||||
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
 | 
			
		||||
  {{ range .Data.Pages }}
 | 
			
		||||
  <url>
 | 
			
		||||
    <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
 | 
			
		||||
    <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
 | 
			
		||||
    <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
 | 
			
		||||
    <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
 | 
			
		||||
    <xhtml:link
 | 
			
		||||
                rel="alternate"
 | 
			
		||||
                hreflang="{{ .Lang }}"
 | 
			
		||||
                href="{{ .Permalink }}"
 | 
			
		||||
                />{{ end }}
 | 
			
		||||
    <xhtml:link
 | 
			
		||||
                rel="alternate"
 | 
			
		||||
                hreflang="{{ .Lang }}"
 | 
			
		||||
                href="{{ .Permalink }}"
 | 
			
		||||
                />{{ end }}
 | 
			
		||||
  </url>
 | 
			
		||||
  {{ end }}
 | 
			
		||||
</urlset>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,12 +1,14 @@
 | 
			
		|||
{{ $swipe := resources.Get "js/swipe.js" | resources.Minify | resources.Fingerprint }}
 | 
			
		||||
<script defer src="{{ $swipe.RelPermalink }}"></script>
 | 
			
		||||
 | 
			
		||||
{{ if $.Params.header }}
 | 
			
		||||
<div class="swiper-container">
 | 
			
		||||
  <div class="swiper-wrapper">
 | 
			
		||||
  {{ range $.Params.header }}
 | 
			
		||||
<div id="headerSwipe" class="swipe">
 | 
			
		||||
  <div class="swipe-wrap">
 | 
			
		||||
    {{ range $.Params.header }}
 | 
			
		||||
    {{ if eq .type "slide" }}
 | 
			
		||||
      {{ $height := .height }}
 | 
			
		||||
      {{ range .slide }}
 | 
			
		||||
        <div class="swiper-slide site-header site-header__align-{{ .align }}" style="background-image: url('{{ .imageSrc | relURL }}'); background-size: {{ .imageSize }};
 | 
			
		||||
    background-repeat: {{ .imageRepeat }}; background-position: {{ .imagePosition }}; height: {{ $height }}px;">
 | 
			
		||||
        <div class="swiper-slide site-header site-header__align-{{ .align }}" style="background-image: url('{{ .imageSrc | relURL }}'); background-size: {{ .imageSize }}; background-repeat: {{ .imageRepeat }}; background-position: {{ .imagePosition }}; height: {{ $height }}px;">
 | 
			
		||||
          {{ $header := . }}
 | 
			
		||||
          {{ if .title }}            
 | 
			
		||||
            {{ range .title }}
 | 
			
		||||
| 
						 | 
				
			
			@ -23,26 +25,43 @@
 | 
			
		|||
            <div class="site-header__subtitle" style="font-size: {{ $header.subtitleFontSize }}px; padding: {{ $header.paddingY }}px {{ $header.paddingX }}px;">
 | 
			
		||||
              {{ . }}
 | 
			
		||||
            </div>
 | 
			
		||||
            {{ end }}      
 | 
			
		||||
            {{ end }}
 | 
			
		||||
          {{ end }}
 | 
			
		||||
        </div>
 | 
			
		||||
      {{ end }}
 | 
			
		||||
    {{ end }}
 | 
			
		||||
  {{ end }}
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="swiper-pagination"></div>
 | 
			
		||||
</div>
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
{{ $js := .Site.Data.lib.js }}
 | 
			
		||||
{{ $css := .Site.Data.lib.css }}
 | 
			
		||||
 | 
			
		||||
<link rel="stylesheet" href="{{  $css.swiper.url }}" integrity="{{ $css.swiper.sri }}" crossorigin="anonymous">
 | 
			
		||||
<script src="{{ $js.swiper.url }}" integrity="{{ $js.swiper.sri }}" crossorigin="anonymous"></script>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  {{ $swiper := .Site.Data.swiper }}
 | 
			
		||||
  var options = JSON.parse({{ $swiper | jsonify }});
 | 
			
		||||
  document.addEventListener('DOMContentLoaded', function () {
 | 
			
		||||
    {{ $header := .Params.header }}
 | 
			
		||||
    var options = null;
 | 
			
		||||
    var header = JSON.parse({{ $header | jsonify }});
 | 
			
		||||
    var slide = header.filter(function(h) {
 | 
			
		||||
      return h.type === 'slide';
 | 
			
		||||
    });
 | 
			
		||||
    
 | 
			
		||||
    if (slide.length > 0) {
 | 
			
		||||
      options = slide[0].options;
 | 
			
		||||
    }
 | 
			
		||||
    console.log(options);
 | 
			
		||||
    var headerSwipeElem = document.getElementById('headerSwipe');
 | 
			
		||||
    var headerSwipe = Swipe(headerSwipeElem,
 | 
			
		||||
      options ? 
 | 
			
		||||
      options : {
 | 
			
		||||
        startSlide: 0,
 | 
			
		||||
        auto: 7000,
 | 
			
		||||
        draggable: true,
 | 
			
		||||
        autoRestart: true,
 | 
			
		||||
        continuous: true,
 | 
			
		||||
        disableScroll: true,
 | 
			
		||||
        stopPropagation: true,
 | 
			
		||||
        callback: function (index, element) { },
 | 
			
		||||
        transitionEnd: function (index, element) { }
 | 
			
		||||
      });
 | 
			
		||||
  });
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
  var mySwiper = new Swiper('.swiper-container', options);
 | 
			
		||||
</script>
 | 
			
		||||
{{ end }}
 | 
			
		||||
| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
User-agent: *
 | 
			
		||||
		Loading…
	
		Reference in New Issue