Compare commits
10 commits
a5f5dad59c
...
986a5c45ce
Author | SHA1 | Date | |
---|---|---|---|
986a5c45ce | |||
cabe184b26 | |||
82f16001be | |||
b72959de74 | |||
8072886809 | |||
275e3d27e4 | |||
84acd10234 | |||
2f20804952 | |||
1070824023 | |||
895e65c192 |
33
README.md
33
README.md
|
@ -55,7 +55,7 @@ This theme uses the "Tachyons" CSS library. This will allow you to manipulate th
|
||||||
> ```
|
> ```
|
||||||
> $ go version
|
> $ go version
|
||||||
> ```
|
> ```
|
||||||
> Go modules were considered production ready in v1.14. [Download Go](https://golang.org/dl/).
|
> Go modules were considered production ready in v1.14. [Download Go](https://golang.org/dl/).
|
||||||
|
|
||||||
1. From your project's root directory, initiate the hugo module system if you haven't already:
|
1. From your project's root directory, initiate the hugo module system if you haven't already:
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ Inside the folder of your Hugo site run:
|
||||||
```
|
```
|
||||||
$ git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
|
$ git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
|
||||||
```
|
```
|
||||||
For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
|
For more information read the official [setup guide](//gohugo.io/getting-started/quick-start/) of Hugo.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,9 +96,16 @@ You may need to delete the line: `themesDir = "../.."`
|
||||||
|
|
||||||
To enable comments, add following to your config file:
|
To enable comments, add following to your config file:
|
||||||
|
|
||||||
- DISQUS: `disqusShortname = YOURSHORTNAME`
|
- DISQUS:
|
||||||
- COMMENTO:
|
|
||||||
|
```toml
|
||||||
|
[services.disqus]
|
||||||
|
shortname = 'YOURSHORTNAME'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- COMMENTO:
|
||||||
|
|
||||||
|
```toml
|
||||||
[params]
|
[params]
|
||||||
commentoEnable = true
|
commentoEnable = true
|
||||||
```
|
```
|
||||||
|
@ -108,7 +115,7 @@ To enable comments, add following to your config file:
|
||||||
For any page or post you can add a featured image by including the local path in front matter (see content in the `exampleSite/content/_readme.md` file for examples): `featured_image: '/images/gohugo-default-sample-hero-image.jpg'`
|
For any page or post you can add a featured image by including the local path in front matter (see content in the `exampleSite/content/_readme.md` file for examples): `featured_image: '/images/gohugo-default-sample-hero-image.jpg'`
|
||||||
|
|
||||||
#### Featured image as Page Resources
|
#### Featured image as Page Resources
|
||||||
If user is using [Page Resources](https://gohugo.io/content-management/page-resources/), the theme will try and match the `featured_image` from with a page resource of type `image` and use its relative permalink. If no `featured_image` is set, the theme will look for a Page Resource of type `image` whose filepath incudes either `cover` or `feature`
|
If user is using [Page Resources](https://gohugo.io/content-management/page-resources/), the theme will try and match the `featured_image` from with a page resource of type `image` and use its relative permalink. If no `featured_image` is set, the theme will look for a Page Resource of type `image` whose filepath incudes either `cover` or `feature`
|
||||||
|
|
||||||
#### Other hero settings
|
#### Other hero settings
|
||||||
If you would like to hide the header text on the featured image on a page, set `omit_header_text` to `true`. See `exampleSite/content/contact.md` for an example.
|
If you would like to hide the header text on the featured image on a page, set `omit_header_text` to `true`. See `exampleSite/content/contact.md` for an example.
|
||||||
|
@ -156,7 +163,7 @@ Using front matter and cascade, this can be customized for a whole section, or j
|
||||||
|
|
||||||
The theme automatically adds "Follow" link icons to the header and footer and "Share" link icons to pages unless `disable_share` parameter is set to true either on the site level (site params) or page level (front matter). Each built-in services sports a label, an icon and a color.
|
The theme automatically adds "Follow" link icons to the header and footer and "Share" link icons to pages unless `disable_share` parameter is set to true either on the site level (site params) or page level (front matter). Each built-in services sports a label, an icon and a color.
|
||||||
|
|
||||||
In order to register a service to be used, user must add an `ananke_socials` parameter to its project configuration file and list them through it in the desired order. Each entry must bear a
|
In order to register a service to be used, user must add an `ananke_socials` parameter to its project configuration file and list them through it in the desired order. Each entry must bear a
|
||||||
- name*: It matches the built-in service reference (Ex: twitter, github)
|
- name*: It matches the built-in service reference (Ex: twitter, github)
|
||||||
- url*: The url of the handle's profile on the service (Ex: https://twitter.com/theNewDynamic, https://github.com/
|
- url*: The url of the handle's profile on the service (Ex: https://twitter.com/theNewDynamic, https://github.com/
|
||||||
theNewDynamic)
|
theNewDynamic)
|
||||||
|
@ -269,10 +276,10 @@ Ananke uses [Tachyon.io](https://tachyons.io/) utility class library.
|
||||||
|
|
||||||
WARNING: Pending resolution of this [discussion](https://github.com/theNewDynamic/gohugo-theme-ananke/discussions/452#discussioncomment-1865301), Custom CSS only works with Hugo Extended
|
WARNING: Pending resolution of this [discussion](https://github.com/theNewDynamic/gohugo-theme-ananke/discussions/452#discussioncomment-1865301), Custom CSS only works with Hugo Extended
|
||||||
|
|
||||||
In order to complement the default CSS with your own, you can add custom css files to the project.
|
In order to complement the default CSS with your own, you can add custom css files to the project.
|
||||||
|
|
||||||
1. Just add a `assets/ananke/css` directory to your project and add the file(s) in it.
|
1. Just add a `assets/ananke/css` directory to your project and add the file(s) in it.
|
||||||
2. Register the files using the `custom_css` key in your site's parameter. The path referenced in the parameter should be relative to the `assets/ananke/css` folder.
|
2. Register the files using the `custom_css` key in your site's parameter. The path referenced in the parameter should be relative to the `assets/ananke/css` folder.
|
||||||
|
|
||||||
The css files will be added in their registered order to final `main.css` file.
|
The css files will be added in their registered order to final `main.css` file.
|
||||||
|
|
||||||
|
@ -331,9 +338,17 @@ Dates of blog posts and single pages are rendered with the default date format c
|
||||||
date_format = "2. January 2006"
|
date_format = "2. January 2006"
|
||||||
```
|
```
|
||||||
|
|
||||||
With hugo 0.87.0 and above, you can also use predefined layout, like `:date_full`, and it will output localized dates or times.
|
With hugo 0.87.0 and above, you can also use predefined layout, like `:date_full`, and it will output localized dates or times.
|
||||||
See hugo's documentation of the [`time.Format` function](https://gohugo.io/functions/dateformat/) for more details.
|
See hugo's documentation of the [`time.Format` function](https://gohugo.io/functions/dateformat/) for more details.
|
||||||
|
|
||||||
|
### Using a canonical url
|
||||||
|
|
||||||
|
When you want to publish content that is already published on a different site. You need to reference a canonical url of the original content.
|
||||||
|
By defining the `canonicalUrl` in the front matter definition the canonical url is set in the headers.
|
||||||
|
|
||||||
|
```
|
||||||
|
canonicalUrl: https://mydomain.com/path-to-the-oringinal-content/
|
||||||
|
```
|
||||||
|
|
||||||
### Nearly finished
|
### Nearly finished
|
||||||
|
|
||||||
|
|
49
i18n/cs.toml
Normal file
49
i18n/cs.toml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
[more]
|
||||||
|
other = "Více"
|
||||||
|
|
||||||
|
[allTitle]
|
||||||
|
other = "Všechny {{.Title }}"
|
||||||
|
|
||||||
|
[recentTitle]
|
||||||
|
other = "Nejnovější {{.Title }}"
|
||||||
|
|
||||||
|
[readMore]
|
||||||
|
other = "čti dále"
|
||||||
|
|
||||||
|
[by]
|
||||||
|
other = "Autor"
|
||||||
|
|
||||||
|
[whatsInThis]
|
||||||
|
other = "Co je v tomto {{ .Type }}"
|
||||||
|
|
||||||
|
[related]
|
||||||
|
other = "Related"
|
||||||
|
|
||||||
|
[yourName]
|
||||||
|
other = "Jméno"
|
||||||
|
|
||||||
|
[emailAddress]
|
||||||
|
other = "Emailová adresa"
|
||||||
|
|
||||||
|
[message]
|
||||||
|
other = "Zpráva"
|
||||||
|
|
||||||
|
[emailRequiredNote]
|
||||||
|
other = "Emailová adresa je požadována."
|
||||||
|
|
||||||
|
[send]
|
||||||
|
other = "Odeslat"
|
||||||
|
|
||||||
|
[taxonomyPageList]
|
||||||
|
other = "Stránky obsahující taxonomický termín “{{ .Title }}”"
|
||||||
|
|
||||||
|
[readingTime]
|
||||||
|
one = "Jedna minuta čtení"
|
||||||
|
other = "{{ .Count }} minut čtení"
|
||||||
|
|
||||||
|
[wordCount]
|
||||||
|
one = "Jedno slovo"
|
||||||
|
other = "{{ .Count }} slov"
|
||||||
|
|
||||||
|
[pageTitle]
|
||||||
|
other = "{{ .Name }} stránka"
|
|
@ -26,16 +26,16 @@ other = "Ditt navn"
|
||||||
other = "E-postadresse"
|
other = "E-postadresse"
|
||||||
|
|
||||||
[message]
|
[message]
|
||||||
other = "beskjed"
|
other = "Beskjed"
|
||||||
|
|
||||||
[emailRequiredNote]
|
[emailRequiredNote]
|
||||||
other = "E-postadresse er påkrevd"
|
other = "E-postadresse er påkrevd"
|
||||||
|
|
||||||
[send]
|
[send]
|
||||||
other = "Sende"
|
other = "Send"
|
||||||
|
|
||||||
[taxonomyPageList]
|
[taxonomyPageList]
|
||||||
other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”"
|
other = "Below you will find pages that utilize the taxonomy term “{{ .Title }}”"
|
||||||
|
|
||||||
[pageTitle]
|
[pageTitle]
|
||||||
other = "{{ .Name }} side"
|
other = "{{ .Name }} side"
|
||||||
|
|
|
@ -16,10 +16,19 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ with .Params.author | default .Site.Params.author }}
|
||||||
|
<meta name="author" content = "
|
||||||
|
{{- if reflect.IsSlice . -}}
|
||||||
|
{{ delimit . ", " | plainify }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ . | plainify }}
|
||||||
|
{{- end -}}
|
||||||
|
">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "site-style.html" . }}
|
{{ partial "site-style.html" . }}
|
||||||
{{ partial "site-scripts.html" . }}
|
{{ partial "site-scripts.html" . }}
|
||||||
|
|
||||||
{{ block "favicon" . }}
|
{{ block "favicon" . }}
|
||||||
{{ partialCached "site-favicon.html" . }}
|
{{ partialCached "site-favicon.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -30,7 +39,13 @@
|
||||||
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Params.canonicalUrl }}
|
||||||
|
<link rel="canonical" href="{{ .Params.canonicalUrl }}">
|
||||||
|
{{ else }}
|
||||||
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}}
|
{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}}
|
||||||
{{- template "_internal/opengraph.html" . -}}
|
{{- template "_internal/opengraph.html" . -}}
|
||||||
{{- template "_internal/schema.html" . -}}
|
{{- template "_internal/schema.html" . -}}
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
{{ $section := .Site.GetPage "section" .Section }}
|
{{ $section := .Site.GetPage "section" .Section }}
|
||||||
<article class="flex-l flex-wrap justify-between mw8 center ph3">
|
<article class="flex-l flex-wrap justify-between mw8 center ph3">
|
||||||
<header class="mt4 w-100">
|
<header class="mt4 w-100">
|
||||||
<aside class="instapaper_ignoref b helvetica tracked">
|
<aside class="instapaper_ignoref b helvetica tracked ttu">
|
||||||
{{/*
|
{{/*
|
||||||
CurrentSection allows us to use the section title instead of inferring from the folder.
|
CurrentSection allows us to use the section title instead of inferring from the folder.
|
||||||
https://gohugo.io/variables/page/#section-variables-and-methods
|
https://gohugo.io/variables/page/#section-variables-and-methods
|
||||||
*/}}
|
*/}}
|
||||||
{{with .CurrentSection.Title }}{{. | upper }}{{end}}
|
{{ .CurrentSection.Title }}
|
||||||
</aside>
|
</aside>
|
||||||
{{ partial "social-share.html" . }}
|
{{ partial "social-share.html" . }}
|
||||||
<h1 class="f1 athelas mt3 mb1">
|
<h1 class="f1 athelas mt3 mb1">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
{{- .Content -}}
|
{{- .Content -}}
|
||||||
{{- partial "tags.html" . -}}
|
{{- partial "tags.html" . -}}
|
||||||
<div class="mt6 instapaper_ignoref">
|
<div class="mt6 instapaper_ignoref">
|
||||||
{{ if .Site.DisqusShortname }}
|
{{ if .Site.Config.Services.Disqus.Shortname }}
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Site.Params.commentoEnable }}
|
{{ if .Site.Params.commentoEnable }}
|
||||||
|
|
|
@ -9,5 +9,6 @@
|
||||||
<div class="nested-links f5 lh-copy nested-copy-line-height">
|
<div class="nested-links f5 lh-copy nested-copy-line-height">
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{{.RelPermalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,55 +1,58 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
|
<article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</article>
|
</article>
|
||||||
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}}
|
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}}
|
||||||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
|
||||||
{{/* Create a variable with that section to use in multiple places. */}}
|
|
||||||
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
|
{{/* Check to see if the section is defined for ranging through it */}}
|
||||||
{{/* Check to see if the section is defined for ranging through it */}}
|
{{range ($mainSections)}}
|
||||||
{{ $section_count := len $section }}
|
|
||||||
{{ if ge $section_count 1 }}
|
|
||||||
{{/* Derive the section name */}}
|
{{/* Derive the section name */}}
|
||||||
{{ $section_name := index (.Site.Params.mainSections) 0 }}
|
{{ $section_name := . }}
|
||||||
|
{{/* Create a variable with that section to use in multiple places. */}}
|
||||||
|
{{ $section := where $.Site.RegularPages "Section" "in" $section_name }}
|
||||||
|
{{ $section_count := len $section }}
|
||||||
|
{{ if ge $section_count 1 }}
|
||||||
|
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
||||||
|
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
||||||
|
{{ with $.Site.GetPage "section" $section_name }}
|
||||||
|
<h1 class="flex-none">
|
||||||
|
{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }}
|
||||||
|
</h1>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
{{ $n_posts := $.Param "recent_posts_number" | default 3 }}
|
||||||
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
|
||||||
{{ with .Site.GetPage "section" $section_name }}
|
|
||||||
<h1 class="flex-none">
|
|
||||||
{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }}
|
|
||||||
</h1>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ $n_posts := $.Param "recent_posts_number" | default 3 }}
|
<section class="w-100 mw8">
|
||||||
|
{{/* Range through the first $n_posts items of the section */}}
|
||||||
<section class="w-100 mw8">
|
{{ range (first $n_posts $section) }}
|
||||||
{{/* Range through the first $n_posts items of the section */}}
|
<div class="relative w-100 mb4">
|
||||||
{{ range (first $n_posts $section) }}
|
{{ .Render "summary-with-image" }}
|
||||||
<div class="relative w-100 mb4">
|
</div>
|
||||||
{{ .Render "summary-with-image" }}
|
{{ end }}
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{ if ge $section_count (add $n_posts 1) }}
|
|
||||||
<section class="w-100">
|
|
||||||
<h1 class="f3">{{ i18n "more" }}</h1>
|
|
||||||
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
|
|
||||||
{{ range (first 4 (after $n_posts $section)) }}
|
|
||||||
<h2 class="f5 fw4 mb4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml3" "mr3" }}">
|
|
||||||
<a href="{{ .RelPermalink }}" class="link black dim">
|
|
||||||
{{ .Title }}
|
|
||||||
</a>
|
|
||||||
</h2>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}}
|
|
||||||
{{ with .Site.GetPage "section" $section_name }}
|
|
||||||
<a href="{{ .RelPermalink }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">{{ i18n "allTitle" . }}</a>
|
|
||||||
{{ end }}
|
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
</div>
|
{{ if ge $section_count (add $n_posts 1) }}
|
||||||
|
<section class="w-100">
|
||||||
|
<h1 class="f3">{{ i18n "more" }}</h1>
|
||||||
|
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
|
||||||
|
{{ range (first 4 (after $n_posts $section)) }}
|
||||||
|
<h2 class="f5 fw4 mb4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml3" "mr3" }}">
|
||||||
|
<a href="{{ .RelPermalink }}" class="link black dim">
|
||||||
|
{{ .Title }}
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}}
|
||||||
|
{{ with $.Site.GetPage "section" $section_name }}
|
||||||
|
<a href="{{ .RelPermalink }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">{{ i18n "allTitle" . }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{end}}
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,5 @@
|
||||||
<div class="nested-links f5 lh-copy nested-copy-line-height">
|
<div class="nested-links f5 lh-copy nested-copy-line-height">
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{{.RelPermalink}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue