diff options
author | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2017-01-20 23:34:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-20 23:34:49 +0300 |
commit | a18880582d11172cf98e474cc16b629536e3970e (patch) | |
tree | 7bf489a0baa6d2663cc7332257ca4613159da7f3 | |
parent | ed1ac1279164ed601fa6e49e961107ee62f114db (diff) | |
parent | 6af05b2d649f86afccf276b0e8a636ad78fab376 (diff) |
Added option to omit date line from individual pages
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/article_header.html | 5 | ||||
-rw-r--r-- | layouts/partials/footer_js.html | 3 |
4 files changed, 10 insertions, 4 deletions
@@ -109,6 +109,9 @@ You can deactivate them under `params.widgets`: tags = true tag_cloud = true +### Date line + +The date line includes: post date, # of words, approximate reading, time tags and categories. However, if you want certain pages to omit the date line, simply put `nodateline = true` in the front matter for that page. ## Localization (l10n) @@ -130,12 +133,12 @@ Mathematical equations in form of LaTeX or MathML code can be rendered with the You can also print formulas inline. In this case wrap the formula only once with `$`. +If you don't need equations, you can disable MathJax but putting `mathjax = false` in your config.toml. This will prevent clients from unnecessarily downloading the MathJax library. ## Shortcodes Last but not least I included some useful [shortcodes](http://gohugo.io/extras/shortcodes/) to make your life easier. - ### Gallery This way you can include a gallery into your post. Copy the code below into your content file and enter the relative paths to your images. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 17020b2..c299ded 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -24,6 +24,7 @@ theme = "hugo-icarus-theme" copyright = "Powered by [Hugo](//gohugo.io). Theme by [PPOffice](http://github.com/ppoffice)." avatar = "css/images/avatar.png" logo = "css/images/logo.png" + mathjax = true # set to false to disable MathJax # Format dates with Go's time formatting date_format = "2006-01-02" diff --git a/layouts/partials/article_header.html b/layouts/partials/article_header.html index e7acf9e..4e57e1c 100644 --- a/layouts/partials/article_header.html +++ b/layouts/partials/article_header.html @@ -5,6 +5,8 @@ </h1> </a> <div class="article-meta"> + + {{ if not .Params.nodateline }} <div class="article-date"> <i class="fa fa-calendar"></i> <time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time> @@ -15,8 +17,7 @@ {{ .ReadingTime }} {{ with .Site.Data.l10n.articles.readingtime }}{{.}}{{end}} </div> - - + {{ end }} {{ if isset .Params "categories" }} {{ $categoriesLen := len .Params.categories }} {{ if gt $categoriesLen 0 }} diff --git a/layouts/partials/footer_js.html b/layouts/partials/footer_js.html index 1b31a03..3b9cdba 100644 --- a/layouts/partials/footer_js.html +++ b/layouts/partials/footer_js.html @@ -7,7 +7,7 @@ <script src="{{ . | absURL }}"></script> {{ end }} -{{ "<!-- MathJax -->" | safeHTML }} +{{ if .Site.Params.mathjax }} <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { @@ -15,3 +15,4 @@ MathJax.Hub.Config({ }); </script> <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> +{{ end }}
\ No newline at end of file |