Browse Source

minor fixes

main
Nicolas Massé 5 years ago
parent
commit
d16133dbc5
  1. 7
      layouts/_default/single.html
  2. 81
      layouts/partials/head.html
  3. 38
      static/css/itix.css

7
layouts/_default/single.html

@ -1,10 +1,11 @@
{{ define "main" }} {{ define "main" }}
<!-- The "single" layout prints a single post --> <!-- The "single" layout prints a single post -->
<article class="post"> {{- partial "lang-detection.html" . -}}
<article class="post" {{ if .Scratch.Get "en_article_in_fr_site" }}lang="en"{{ end }}>
<header> <header>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{- if .Params.description }} {{- with .Description }}
<h4>{{ .Params.description }}</h4> <h4>{{ . }}</h4>
{{- end }} {{- end }}
{{ partial "post-metadata.html" (dict "current" . "parent" .) -}} {{ partial "post-metadata.html" (dict "current" . "parent" .) -}}
</header> </header>

81
layouts/partials/head.html

@ -8,11 +8,24 @@
<meta name="description" content="{{ .Params.description }}"> <meta name="description" content="{{ .Params.description }}">
{{- end }} {{- end }}
<!-- Tell IE to use the Edge engine -->
<meta name="X-UA-Compatible" content="IE=edge"> <meta name="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta content="telephone=no" name="format-detection"> <!--
<meta name="renderer" content="webkit"> -- The viewport is the user's visible area of a web page.
<meta name="theme-color" content="#ffffff"> -- The viewport varies with the device, and will be smaller on a mobile phone
-- than on a computer screen.
--
-- This meta tag let web designers take control over the viewport.
--
-- The width property controls the size of the viewport. It can be set to
-- the special value device-width, which is the width of the screen in CSS
-- pixels at a scale of 100%.
--
-- The initial-scale=1.0 part sets the initial zoom level when the page
-- is first loaded by the browser.
-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ template "_internal/opengraph.html" . }} {{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }} {{ template "_internal/twitter_cards.html" . }}
@ -25,16 +38,76 @@
{{- partial "mathjax.html" . -}} {{- partial "mathjax.html" . -}}
{{- end -}} {{- end -}}
<!-- Deal with the case of english articles published in the french site -->
{{- partial "lang-detection.html" . -}} {{- partial "lang-detection.html" . -}}
{{- if .IsTranslated -}} {{- if .IsTranslated -}}
{{- range .Translations -}} {{- range .Translations -}}
{{- if .Scratch.Get "en_article_in_fr_site" -}} {{- if .Scratch.Get "en_article_in_fr_site" -}}
<!--
-- It's an english article published in the french site
-- Tell Google not to index it and link to the original article.
-->
<link rel="canonical" href="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
{{ else }} {{ else }}
<!-- Otherwise, just link to the available translations, if any. -->
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}"> <link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">
{{ end -}} {{ end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if .IsHome }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "{{ .Site.Title | safeJS }}",
"url": "{{ .Site.BaseURL }}",
"description": "{{ .Site.Params.subtitle | safeJS }}",
"license": "Copyright {{ .Site.Home.Date.Year }} {{ .Site.Title | safeJS }}"
}
</script>
{{ else if .IsPage -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"articleSection": "{{ .Section }}",
"name": "{{ .Title | safeJS }}",
"headline": "{{ .Title | safeJS }}",
"description": "{{ if .Description }}{{ .Description | safeJS }}{{ else }}{{ if .IsPage }}{{ .Summary | plainify | htmlUnescape | safeJS }}{{ end }}{{ end }}",
"inLanguage": {{ .Site.LanguageCode | default "en-us" }},
"isFamilyFriendly": "true",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
"author" : {
"@type": "Person",
"name": "{{ .Site.Title | safeJS }}"
},
"creator" : {
"@type": "Person",
"name": "{{ .Site.Title | safeJS }}"
},
"accountablePerson" : {
"@type": "Person",
"name": "{{ .Site.Title | safeJS }}"
},
"copyrightHolder" : "{{ .Site.Title | safeJS }}",
"copyrightYear" : "{{ .Site.Home.Date.Year }}",
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
"publisher":{
"@type":"Person",
"name": {{ .Site.Title | safeJS }},
"url": {{ .Site.BaseURL }}
},
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}"
}
</script>
{{ end -}}
</head> </head>

38
static/css/itix.css

@ -2,8 +2,7 @@
/* /*
* Theme colors * Theme colors
*/ */
--main-color-decimal: 25, 118, 210; /* main-color */ --main-color: #1976d2;
--main-color: var(--main-color-decimal);
--main-background-color: #fcfcfc; --main-background-color: #fcfcfc;
--alternate-text-color: #145ca4; --alternate-text-color: #145ca4;
--main-text-color: #092949; /* 50% darker than main-color */ --main-text-color: #092949; /* 50% darker than main-color */
@ -24,8 +23,6 @@
/* /*
* Layout * Layout
*/ */
--heading1-size: 30px;
--heading-diff: 3px;
--menu-container-width: 25%; --menu-container-width: 25%;
--toolbar-container-width: 25%; --toolbar-container-width: 25%;
@ -165,34 +162,32 @@ h1, h2, h3 {
line-height: 1.5em; line-height: 1.5em;
} }
h1, h2, h3, h4, h5, h6 {
margin: 20px 0 20px 0;
}
h1 { h1 {
font-size: var(--heading1-size); font-size: 30px;
margin: 20px auto;
} }
h2 { h2 {
font-size: calc(var(--heading1-size) - 2 * var(--heading-diff)); font-size: 24px;
margin: 20px auto;
} }
h3 { h3 {
font-size: calc(var(--heading1-size) - 3 * var(--heading-diff)); font-size: 21px;
margin: 20px auto;
} }
h4 { h4 {
font-size: calc(var(--heading1-size) - 3 * var(--heading-diff)); font-size: 21px;
padding: 20px auto;
} }
h5 { h5 {
font-size: calc(var(--heading1-size) - 3 * var(--heading-diff)) - 1; font-size: 20px;
padding: 10px auto;
} }
h6 { h6 {
font-size: calc(var(--heading1-size) - 3 * var(--heading-diff)) - 2; font-size: 19px;
padding: 10px auto;
} }
figure { figure {
@ -221,7 +216,6 @@ table {
} }
button { button {
cursor: hand;
cursor: pointer; cursor: pointer;
} }
@ -424,7 +418,6 @@ article header h4 {
.menu-head, .menu-link-list a, .menu-head:hover, .menu-link-list a:hover { .menu-head, .menu-link-list a, .menu-head:hover, .menu-link-list a:hover {
display: block; display: block;
text-decoration: none !important; text-decoration: none !important;
cursor: hand;
cursor: pointer; cursor: pointer;
border-right: 2px solid transparent; border-right: 2px solid transparent;
} }
@ -496,11 +489,11 @@ article header h4 {
*/ */
.menu input.hamburger-menu { .menu input.hamburger-menu {
display: block; display: block;
width: 40px; width: 80px;
height: 32px; height: 72px;
position: fixed; position: fixed;
top: 20px; top: 0px;
left: 20px; left: 0px;
margin: 0; margin: 0;
cursor: pointer; cursor: pointer;
@ -608,7 +601,6 @@ article header h4 {
align-items: center; align-items: center;
justify-items: center; justify-items: center;
width: 64px; width: 64px;
cursor: hand;
cursor: pointer; cursor: pointer;
padding: 15px 0; padding: 15px 0;
} }

Loading…
Cancel
Save