Initial site working
This commit is contained in:
2
themes/ananke/layouts/partials/commento.html
Normal file
2
themes/ananke/layouts/partials/commento.html
Normal file
@ -0,0 +1,2 @@
|
||||
<div id="commento"></div>
|
||||
<script defer src="https://cdn.commento.io/js/commento.js"></script>
|
41
themes/ananke/layouts/partials/func/GetFeaturedImage.html
Normal file
41
themes/ananke/layouts/partials/func/GetFeaturedImage.html
Normal file
@ -0,0 +1,41 @@
|
||||
{{/*
|
||||
GetFeaturedImage
|
||||
|
||||
This partial gets the url for featured image for a given page.
|
||||
|
||||
If a featured_image was set in the page's front matter, then that will be used.
|
||||
|
||||
If not set, this will search page resources to find an image that contains the word
|
||||
"cover", and if found, returns the path to that resource.
|
||||
|
||||
If no featured_image was set, and there's no "cover" image in page resources, then
|
||||
this partial returns an empty string (which evaluates to false).
|
||||
|
||||
@return RelPermalink to featured image, or an empty string if not found.
|
||||
|
||||
*/}}
|
||||
|
||||
{{/* Declare a new string variable, $linkToCover */}}
|
||||
{{ $linkToCover := "" }}
|
||||
{{ $matches := "feature,cover" }}
|
||||
{{/* Use the value from front matter if present */}}
|
||||
{{ with .Params.featured_image }}
|
||||
{{/* This is the default case, the image lives in the static directory.
|
||||
In which case we'll use the static dir */}}
|
||||
{{ $linkToCover = trim . "/" | absURL }}
|
||||
{{/* If we find a Page Resource matching the exact value, we use it instead. */}}
|
||||
{{ with $.Resources.GetMatch . }}
|
||||
{{ $linkToCover = .RelPermalink }}
|
||||
{{ end }}
|
||||
{{/* Find the first image with 'cover' in the name in this page bundle. */}}
|
||||
{{ else }}
|
||||
{{ with .Resources.ByType "image" }}
|
||||
{{ with .GetMatch (printf "**{%s}*" $matches) }}
|
||||
{{ $linkToCover = .RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* return either a permalink, or an empty string. Note that partials can only have a single
|
||||
return statement, so this needs to be at the end of the partial (and not in the if block) */}}
|
||||
{{ return $linkToCover }}
|
@ -0,0 +1,7 @@
|
||||
{{ $dir := "" }}
|
||||
{{ if ge hugo.Version "0.67.1" }}
|
||||
{{ with site.Language.LanguageDirection }}
|
||||
{{ $dir = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ return $dir }}
|
45
themes/ananke/layouts/partials/func/socials/Get.html
Normal file
45
themes/ananke/layouts/partials/func/socials/Get.html
Normal file
@ -0,0 +1,45 @@
|
||||
{{/*
|
||||
socials/Get
|
||||
Returns the list of services registered by the user complemented by the built-in service default data if found.
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context Any (.)
|
||||
|
||||
@access public
|
||||
|
||||
@returns Slice of Maps
|
||||
- String (.name)
|
||||
String (.url)
|
||||
String (.label)
|
||||
String (.color)?
|
||||
Bool (.share)?
|
||||
@uses
|
||||
- partial
|
||||
|
||||
@example - Go Template
|
||||
{{ with partialCached "socials/Get" context context }}
|
||||
{{ something = . }}
|
||||
{{ end }}
|
||||
*/}}
|
||||
{{ $socials := slice }}
|
||||
{{ with partial "func/socials/GetRegisteredServices" "GetRegisteredServices" }}
|
||||
{{ range . }}
|
||||
{{ $service := . }}
|
||||
{{/* We fetch the default data and add it to service map if found */}}
|
||||
{{ with partialCached "func/socials/GetServiceData" .name .name }}
|
||||
{{ $service = merge . $service }}
|
||||
{{ end }}
|
||||
{{/* We fetch the icon and add it to service map fi found */}}
|
||||
{{ with partialCached "func/socials/GetServiceIcon" .name .name }}
|
||||
{{ $service = $service | merge (dict "icon" . ) }}
|
||||
{{ end }}
|
||||
{{/* In case no label is provided (on a non-built-in service) we add the .name as label to the service map */}}
|
||||
{{ with .label }}{{ else }}
|
||||
{{ $service = $service | merge (dict "label" $service.name ) }}
|
||||
{{ end }}
|
||||
{{ $socials = $socials | append $service }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $socials }}
|
@ -0,0 +1,73 @@
|
||||
{{/*
|
||||
GetBuiltInServicesData
|
||||
Returns a map whose keys stores the map of defaults data for any built-in service.
|
||||
We use a key to easily grab the data with `index $that github`
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context Any (.)
|
||||
|
||||
@access public
|
||||
|
||||
@returns Map
|
||||
|
||||
|
||||
## Contributors can add a built-in service
|
||||
|
||||
1. Adding it to the following map with the following format:
|
||||
```yaml
|
||||
# [...]
|
||||
shinyandnew:
|
||||
label: Shiny And New
|
||||
color: '#cccccc'
|
||||
```
|
||||
2. Edit README file with new service https://github.com/theNewDynamic/gohugo-theme-ananke/tree/422-improve-socials#built-in-services
|
||||
|
||||
*/}}
|
||||
{{ return (`
|
||||
facebook:
|
||||
share: true
|
||||
label: Facebook
|
||||
color: '#3b5998'
|
||||
twitter:
|
||||
share: true
|
||||
label: Twitter
|
||||
color: '#1da1f2'
|
||||
instagram:
|
||||
label: Instagram
|
||||
color: '#e1306c'
|
||||
youtube:
|
||||
label: YouTube
|
||||
color: '#cd201f'
|
||||
github:
|
||||
label: GitHub
|
||||
color: '#6cc644'
|
||||
gitlab:
|
||||
label: GitLab
|
||||
color: '#FC6D26'
|
||||
keybase:
|
||||
label: Keybase
|
||||
color: '#3d76ff'
|
||||
linkedin:
|
||||
share: true
|
||||
label: LinkedIn
|
||||
color: '#0077b5'
|
||||
medium:
|
||||
label: Medium
|
||||
color: '#0077b5'
|
||||
mastodon:
|
||||
label: Mastodon
|
||||
color: '#6364FF'
|
||||
slack:
|
||||
label: Slack
|
||||
color: '#E01E5A'
|
||||
stackoverflow:
|
||||
label: Stack Overflow
|
||||
color: '#f48024'
|
||||
rss:
|
||||
label: RSS
|
||||
color: '#ff6f1a'
|
||||
tiktok:
|
||||
label: TikTok
|
||||
color: '#fe2c55'
|
||||
` | transform.Unmarshal) }}
|
@ -0,0 +1,45 @@
|
||||
{{/*
|
||||
socials/GetRegisteredServices
|
||||
Retrieves the list of user registered services.
|
||||
Support legacy settings (root of params with service name as key)
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context Any (.)
|
||||
|
||||
@access private
|
||||
|
||||
@returns Slice of Maps
|
||||
- String (.name)
|
||||
String (.url)
|
||||
String (.label)?
|
||||
String (.color)?
|
||||
|
||||
*/}}
|
||||
|
||||
{{ $registered_services := slice }}
|
||||
{{/* We first look for legacy settings that lives at the root of the site.Params as such (github: https://github.com/
|
||||
theNewDynamic) and them to the list with key as .name and value as .url */}}
|
||||
{{ $user_using_legacy := false }}
|
||||
|
||||
{{ $legacy_api_services := slice "facebook" "twitter" "instagram" "youtube" "github" "gitlab" "keybase" "linkedin" "medium" "mastodon" "slack" "stackoverflow" "rss" }}
|
||||
{{ range $name := $legacy_api_services }}
|
||||
{{ with $url := index site.Params . }}
|
||||
{{/* If we can find a parameter matching the key with a set value, we add it with proper name and url */}}
|
||||
{{/* We also note that user is using legacy for potential potential deprecation warnings */}}
|
||||
{{ $user_using_legacy = true }}
|
||||
{{ $registered_services = $registered_services | append (dict "name" $name "url" $url) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Then we go through the current way of registering services as per referenced in README */}}
|
||||
{{ with site.Params.ananke_socials }}
|
||||
{{ range $service := . }}
|
||||
{{/* Only if the service has a .name, we add it all its keys to the slice of registered services */}}
|
||||
{{ with .name }}
|
||||
{{ $registered_services = $registered_services | append $service }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $registered_services }}
|
@ -0,0 +1,27 @@
|
||||
{{/*
|
||||
socials/GetServiceDefaults
|
||||
Returns the defaults of any given service as stored in GetBuildInServicesDefaults
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context String (.)
|
||||
|
||||
@access private
|
||||
|
||||
@returns Map
|
||||
- String (.label)
|
||||
String (.color)
|
||||
@uses
|
||||
- func/socials/GetBuiltInServicesDefaults
|
||||
|
||||
*/}}
|
||||
{{ $service_data := dict }}
|
||||
{{ with partialCached "func/socials/GetBuiltInServicesDefaults" "socials/GetBuiltInServicesDefaults" }}
|
||||
{{/* If the passed context string (held in $) is found as a key of the map returned by the above returning partial
|
||||
We store it in the returning variable */}}
|
||||
{{ with index . $ }}
|
||||
{{ $service_data = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $service_data }}
|
@ -0,0 +1,21 @@
|
||||
{{/*
|
||||
GetServiceIcon
|
||||
|
||||
User can overwrite/complement in assets/ananke/socials/{service_name}.svg
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context String (.)
|
||||
|
||||
@access private
|
||||
|
||||
@return String of safe HTML
|
||||
|
||||
@example - Go Template
|
||||
{{ $icon := partialCached "tnd-socials/private/GetIcon" $icon $icon }}
|
||||
*/}}
|
||||
{{ $icon := "" }}
|
||||
{{ with resources.Get (printf "ananke/socials/%s.svg" $) }}
|
||||
{{ $icon = .Content | safeHTML }}
|
||||
{{ end }}
|
||||
{{ return $icon }}
|
78
themes/ananke/layouts/partials/func/style/GetMainCSS.html
Normal file
78
themes/ananke/layouts/partials/func/style/GetMainCSS.html
Normal file
@ -0,0 +1,78 @@
|
||||
{{/*
|
||||
style/GetMainCSS
|
||||
Process the main css stylesheet and return as resource
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context Any (.)
|
||||
|
||||
@returns Resource
|
||||
|
||||
@uses
|
||||
- func/style/GetResource
|
||||
*/}}
|
||||
{{ $main_style := dict }}
|
||||
|
||||
{{/* We prepare a slice of resources to be concatenated as one */}}
|
||||
{{ $assets_to_concat := slice }}
|
||||
{{/* We add locale css files to the slice in the proper order */}}
|
||||
{{ range slice "_tachyons.css" "_code.css" "_hugo-internal-templates.css" "_social-icons.css" "_styles.css" }}
|
||||
{{ with partialCached "func/style/GetResource" . . }}
|
||||
{{ $assets_to_concat = $assets_to_concat | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with partialCached "func/socials/Get" "socials/Get" }}
|
||||
{{ $socials_rules := slice }}
|
||||
{{ range $service := . }}
|
||||
{{ with .color }}
|
||||
{{ $rule := printf `
|
||||
.ananke-socials a.%s:hover {
|
||||
color: %s
|
||||
}` $service.name $service.color }}
|
||||
{{ $socials_rules = $socials_rules | append $rule }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with $socials_rules }}
|
||||
{{ $socials_rules = delimit . "" }}
|
||||
{{ $socials_css := $socials_rules | resources.FromString "ananke/css/generated_socials.css" }}
|
||||
{{ $assets_to_concat = $assets_to_concat | append $socials_css }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{/* We look for any custom css files registered by the user under `site.params.custom_css and if found in the theme's
|
||||
css asset directory we (unless condition below) add to aforementioned slice */}}
|
||||
{{ with site.Params.custom_css }}
|
||||
{{ range . }}
|
||||
{{ with partialCached "func/style/GetResource" . . }}
|
||||
{{ if eq .MediaType.SubType "x-scss" "x-sass" "scss" "sass" }}
|
||||
{{ if hugo.IsExtended }}
|
||||
{{/* as we cannot concatenate styles of different types, we sass/scss to be transformed to css beforehand */}}
|
||||
{{ $assets_to_concat = $assets_to_concat | append (. | resources.ToCSS) }}
|
||||
{{ else }}
|
||||
{{ partial "func/warn" (printf "Processing of stylesheet %s of type %s has been skipped. You need Hugo Extended to process such files." .Name .MediaType.SubType) }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $assets_to_concat = $assets_to_concat | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $assets_to_concat }}
|
||||
{{/* We proceed to concatenate the $assets_to_concat */}}
|
||||
{{ $style := . | resources.Concat "ananke/css/main.css" }}
|
||||
|
||||
{{/* We then use toCSS to add sourceMap and minify */}}
|
||||
{{ $options := dict "enableSourceMap" true "precision" 6 }}
|
||||
{{ $style = $style | resources.ToCSS $options | minify }}
|
||||
{{/* We fingerprint in production for cache busting purposes */}}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" }}
|
||||
{{ $style = $style | fingerprint }}
|
||||
{{ end }}
|
||||
{{/* We're ready to set returning variable with resulting resource */}}
|
||||
{{ $main_style = $style }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $main_style }}
|
19
themes/ananke/layouts/partials/func/style/GetResource.html
Normal file
19
themes/ananke/layouts/partials/func/style/GetResource.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{/*
|
||||
style/GetResource
|
||||
Get a style asset stored at `/assets/ananke/css`
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context String (.)
|
||||
|
||||
@access private
|
||||
|
||||
@returns Resource
|
||||
|
||||
*/}}
|
||||
{{ $resource := dict }}
|
||||
{{ with resources.Get (print "/ananke/css/" .) }}
|
||||
{{ $resource = . }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $resource }}
|
15
themes/ananke/layouts/partials/func/warn.html
Normal file
15
themes/ananke/layouts/partials/func/warn.html
Normal file
@ -0,0 +1,15 @@
|
||||
{{/*
|
||||
warn
|
||||
Emits a warning using the theme's Header.
|
||||
|
||||
@author @regisphilibert
|
||||
|
||||
@context String
|
||||
|
||||
@access private
|
||||
|
||||
@example - Go Template
|
||||
{{ partial "func/warn" $message }}
|
||||
*/}}
|
||||
{{ $header := "Ananke Theme Warning" }}
|
||||
{{ warnf "\n%s:\n%s" $header . }}
|
0
themes/ananke/layouts/partials/head-additions.html
Normal file
0
themes/ananke/layouts/partials/head-additions.html
Normal file
10
themes/ananke/layouts/partials/i18nlist.html
Normal file
10
themes/ananke/layouts/partials/i18nlist.html
Normal file
@ -0,0 +1,10 @@
|
||||
{{ if .IsTranslated }}
|
||||
<h4>{{ i18n "translations" }}</h4>
|
||||
<ul class="{{ cond (eq $.Site.Language.LanguageDirection "rtl") "pr0 ml3" "pl0 mr3" }}">
|
||||
{{ range .Translations }}
|
||||
<li class="list f5 f4-ns fw4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3" "pr3" }}">
|
||||
<a class="hover-white no-underline white-90" href="{{ .RelPermalink }}">{{ .Lang }}</a>
|
||||
</li>
|
||||
{{ end}}
|
||||
</ul>
|
||||
{{ end }}
|
33
themes/ananke/layouts/partials/menu-contextual.html
Normal file
33
themes/ananke/layouts/partials/menu-contextual.html
Normal file
@ -0,0 +1,33 @@
|
||||
{{/*
|
||||
Use Hugo's native Table of contents feature. You must set `toc: true` in your parameters for this to show.
|
||||
https://gohugo.io/content-management/toc/
|
||||
*/}}
|
||||
|
||||
{{- if .Params.toc -}}
|
||||
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
||||
<p class="f5 b mb3">{{ i18n "whatsInThis" . }}</p>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Use Hugo's native related content feature to pull in content that may have similar parameters, like tags. etc.
|
||||
https://gohugo.io/content-management/related/
|
||||
*/}}
|
||||
|
||||
{{ $related := .Site.RegularPages.Related . | first 15 }}
|
||||
|
||||
{{ with $related }}
|
||||
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
||||
<p class="f5 b mb3">{{ i18n "related" }}</p>
|
||||
<ul class="pa0 list">
|
||||
{{ range . }}
|
||||
<li class="mb2">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
2
themes/ananke/layouts/partials/new-window-icon.html
Normal file
2
themes/ananke/layouts/partials/new-window-icon.html
Normal file
@ -0,0 +1,2 @@
|
||||
{{ $new_window_icon_size := "8px" }}
|
||||
<span class="new-window">{{ partial "svg/new-window.svg" (dict "size" $new_window_icon_size) }}</span>
|
25
themes/ananke/layouts/partials/page-header.html
Normal file
25
themes/ananke/layouts/partials/page-header.html
Normal file
@ -0,0 +1,25 @@
|
||||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||
{{ if $featured_image }}
|
||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<div class="bg-black-60">
|
||||
{{ partial "site-navigation.html" . }}
|
||||
<div class="tc-l pv6 ph3 ph4-ns">
|
||||
{{ if not .Params.omit_header_text }}
|
||||
<div class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</div>
|
||||
{{ with .Params.description }}
|
||||
<div class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{{ else }}
|
||||
<header>
|
||||
<div class="{{ .Site.Params.background_color_class | default "bg-black" }}">
|
||||
{{ partial "site-navigation.html" . }}
|
||||
</div>
|
||||
</header>
|
||||
{{ end }}
|
3
themes/ananke/layouts/partials/site-favicon.html
Normal file
3
themes/ananke/layouts/partials/site-favicon.html
Normal file
@ -0,0 +1,3 @@
|
||||
{{ if .Site.Params.favicon }}
|
||||
<link rel="shortcut icon" href="{{ relURL ($.Site.Params.favicon) }}" type="image/x-icon" />
|
||||
{{ end }}
|
8
themes/ananke/layouts/partials/site-footer.html
Normal file
8
themes/ananke/layouts/partials/site-footer.html
Normal file
@ -0,0 +1,8 @@
|
||||
<footer class="{{ .Site.Params.background_color_class | default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo">
|
||||
<div class="flex justify-between">
|
||||
<a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.Home.Permalink }}" >
|
||||
© {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} {{ now.Format "2006"}} {{ end }}
|
||||
</a>
|
||||
<div>{{ partial "social-follow.html" . }}</div>
|
||||
</div>
|
||||
</footer>
|
35
themes/ananke/layouts/partials/site-header.html
Normal file
35
themes/ananke/layouts/partials/site-header.html
Normal file
@ -0,0 +1,35 @@
|
||||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||
{{ if $featured_image }}
|
||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
||||
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
|
||||
{{ partial "site-navigation.html" .}}
|
||||
<div class="tc-l pv4 pv6-l ph3 ph4-ns">
|
||||
<h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">
|
||||
{{ .Title | default .Site.Title }}
|
||||
</h1>
|
||||
{{ with .Params.description }}
|
||||
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center mt3">
|
||||
{{ . }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{{ else }}
|
||||
<header>
|
||||
<div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}">
|
||||
{{ partial "site-navigation.html" . }}
|
||||
<div class="tc-l pv3 ph3 ph4-ns">
|
||||
<h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title">
|
||||
{{ .Title | default .Site.Title }}
|
||||
</h1>
|
||||
{{ with .Params.description }}
|
||||
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
|
||||
{{ . }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{{ end }}
|
26
themes/ananke/layouts/partials/site-navigation.html
Normal file
26
themes/ananke/layouts/partials/site-navigation.html
Normal file
@ -0,0 +1,26 @@
|
||||
<nav class="pv3 ph3 ph4-ns" role="navigation">
|
||||
<div class="flex-l justify-between items-center center">
|
||||
<a href="{{ .Site.Home.RelPermalink }}" class="f3 fw2 hover-white no-underline white-90 dib">
|
||||
{{ with .Site.Params.site_logo }}
|
||||
<img src="{{ relURL . }}" class="w100 mw5-ns" alt="{{ $.Site.Title }}" />
|
||||
{{ else }}
|
||||
{{ .Site.Title }}
|
||||
{{ end }}
|
||||
</a>
|
||||
<div class="flex-l items-center">
|
||||
{{ partial "i18nlist.html" . }}
|
||||
{{ if .Site.Menus.main }}
|
||||
<ul class="{{ cond (eq $.Site.Language.LanguageDirection "rtl") "pr0 ml3" "pl0 mr3" }}">
|
||||
{{ range .Site.Menus.main }}
|
||||
<li class="list f5 f4-ns fw4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3" "pr3" }}">
|
||||
<a class="hover-white no-underline white-90" href="{{ .URL }}" title="{{ i18n "pageTitle" . }}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ partialCached "social-follow.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
1
themes/ananke/layouts/partials/site-scripts.html
Normal file
1
themes/ananke/layouts/partials/site-scripts.html
Normal file
@ -0,0 +1 @@
|
||||
{{/* For Users's overwrite */}}
|
9
themes/ananke/layouts/partials/site-style.html
Normal file
9
themes/ananke/layouts/partials/site-style.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{ with partialCached "func/style/GetMainCSS" "style/GetMainCSS" }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" >
|
||||
{{ end }}
|
||||
|
||||
{{ range site.Params.custom_css }}
|
||||
{{ with partialCached "func/style/GetResource" . . }}{{ else }}
|
||||
<link rel="stylesheet" href="{{ relURL (.) }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
14
themes/ananke/layouts/partials/social-follow.html
Normal file
14
themes/ananke/layouts/partials/social-follow.html
Normal file
@ -0,0 +1,14 @@
|
||||
{{ $socials := where (partialCached "func/socials/Get" "socials/Get") "follow" "!=" false }}
|
||||
<div class="ananke-socials">
|
||||
{{ range $socials }}
|
||||
{{ $rel := .rel | default "noopener" }}
|
||||
<a href="{{ .url }}" target="_blank" rel="{{ $rel }}" class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" }}" title="{{ .label }} link" aria-label="follow on {{ .label }}——Opens in a new window">
|
||||
{{ with .icon }}
|
||||
<span class="icon">{{ . }}</span>
|
||||
{{ else }}
|
||||
{{ .label }}
|
||||
{{ end }}
|
||||
{{- partial "new-window-icon.html" . -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
24
themes/ananke/layouts/partials/social-share.html
Normal file
24
themes/ananke/layouts/partials/social-share.html
Normal file
@ -0,0 +1,24 @@
|
||||
{{ $title := .Title }}
|
||||
{{ $url := printf "%s" .Permalink | absLangURL }}
|
||||
|
||||
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
||||
{{ $twitter_href := printf "https://twitter.com/share?url=%s&text=%s" $url $title }}
|
||||
{{ with site.Social.twitter }}
|
||||
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
|
||||
{{ end }}
|
||||
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
||||
{{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }}
|
||||
|
||||
{{ $services := where (partialCached "func/socials/Get" "socials/Get") "share" true }}
|
||||
{{ if not ($.Param "disable_share") }}
|
||||
<div id="sharing" class="mt3 ananke-socials">
|
||||
{{ range $service := $services }}
|
||||
{{ $href := index $hrefs .name }}
|
||||
<a href="{{ $href }}" class="ananke-social-link {{ .name }} no-underline" aria-label="share on {{ .label }}">
|
||||
{{ with .icon }}
|
||||
<span class="icon"> {{ . }}</span>
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
31
themes/ananke/layouts/partials/summary-with-image.html
Normal file
31
themes/ananke/layouts/partials/summary-with-image.html
Normal file
@ -0,0 +1,31 @@
|
||||
{{ partial "func/warn" `You are currently using 'partial "summary-with-image"' in your project templates.
|
||||
You should replace it with '.Render "summary-with-image"' as the use of this partial will be deprecated in future releases.
|
||||
More info here: https://github.com/theNewDynamic/gohugo-theme-ananke/releases/tag/v2.8.1` }}
|
||||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||
<article class="bb b--black-10">
|
||||
<div class="db pv4 ph3 ph0-l no-underline dark-gray">
|
||||
<div class="flex flex-column flex-row-ns">
|
||||
{{ if $featured_image }}
|
||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||
<div class="{{ cond (eq $.Site.Language.LanguageDirection "rtl") "pl3-ns" "pr3-ns" }} mb4 mb0-ns w-100 w-40-ns">
|
||||
<a href="{{.RelPermalink}}" class="db grow">
|
||||
<img src="{{ $featured_image }}" class="img" alt="image from {{ .Title }}">
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="blah w-100{{ if $featured_image }} w-60-ns {{ cond (eq $.Site.Language.LanguageDirection "rtl") "pr3-ns" "pl3-ns" }}{{ end }}">
|
||||
<h1 class="f3 fw1 athelas mt0 lh-title">
|
||||
<a href="{{.RelPermalink}}" class="color-inherit dim link">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
|
||||
{{ .Summary }}
|
||||
</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>
|
||||
{{/* TODO: add author
|
||||
<p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
16
themes/ananke/layouts/partials/summary.html
Normal file
16
themes/ananke/layouts/partials/summary.html
Normal file
@ -0,0 +1,16 @@
|
||||
{{ partial "func/warn" `You are currently using 'partial "summary"' in your project templates.
|
||||
You should replace it with '.Render "summary"' as the use of this partial will be deprecated in future releases.
|
||||
More info here: https://github.com/theNewDynamic/gohugo-theme-ananke/releases/tag/v2.8.1` }}
|
||||
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
|
||||
<div class="bg-white mb3 pa4 gray overflow-hidden">
|
||||
<span class="f6 db">{{ humanize .Section }}</span>
|
||||
<h1 class="f3 near-black">
|
||||
<a href="{{ .RelPermalink }}" class="link black dim">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
<div class="nested-links f5 lh-copy nested-copy-line-height">
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
3
themes/ananke/layouts/partials/svg/new-window.svg
Normal file
3
themes/ananke/layouts/partials/svg/new-window.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg {{ with .size }} height="{{ . }}" {{ end }} style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
|
||||
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;"/>
|
||||
</svg>
|
After Width: | Height: | Size: 460 B |
6
themes/ananke/layouts/partials/svg/tiktok.svg
Normal file
6
themes/ananke/layouts/partials/svg/tiktok.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg{{ with .size }} height="{{ . }}" {{ end }} style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32"
|
||||
width="{{ .size }}" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<path
|
||||
d="m 15.433,1.91 c 7.726455,0 14,6.265147 14,14 0,7.726455 -6.265147,14 -14,14 -7.7264547,0 -14,-6.265147 -14,-14 0,-7.7264547 6.265147,-14 14,-14 z m 3.031794,6.2483503 c 0.260348,2.2003597 1.486502,3.5104977 3.611277,3.6448707 v 2.469107 c -1.234553,0.117576 -2.317936,-0.285543 -3.577684,-1.041392 v 4.619076 c 0,5.878824 -6.407918,7.709658 -8.9778045,3.5021 -1.6544691,-2.70426 -0.6382724,-7.466107 4.6694665,-7.65087 v 2.611877 c -0.40312,0.06719 -0.831434,0.167967 -1.226155,0.30234 -1.184163,0.394721 -1.847631,1.15057 -1.662868,2.469106 0.361128,2.527895 4.997001,3.275345 4.610678,-1.662867 V 8.1667487 h 2.561488 z"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;"/>
|
||||
</svg>
|
After Width: | Height: | Size: 942 B |
9
themes/ananke/layouts/partials/tags.html
Normal file
9
themes/ananke/layouts/partials/tags.html
Normal file
@ -0,0 +1,9 @@
|
||||
<ul class="pa0">
|
||||
{{ range .GetTerms "tags" }}
|
||||
<li class="list di">
|
||||
<a href="{{ .RelPermalink }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
|
||||
{{- .LinkTitle -}}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
Reference in New Issue
Block a user