mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-22 03:42:53 +00:00
Merge branch 'AIRyndon-master'
This commit is contained in:
commit
2486d10245
12 changed files with 76 additions and 53 deletions
|
@ -1,11 +0,0 @@
|
||||||
$(document).ready(function() {
|
|
||||||
const tnode = $("#time")
|
|
||||||
const update_localtime = function(){
|
|
||||||
var time = moment()
|
|
||||||
.tz(tnode.attr("data-time-zone"))
|
|
||||||
.format(tnode.attr("data-time-format"));
|
|
||||||
tnode.html(time);
|
|
||||||
}
|
|
||||||
update_localtime();
|
|
||||||
setInterval(update_localtime, 1000);
|
|
||||||
})
|
|
1
assets/vendor/momentjs/moment-timezone-with-data-2012-2022.min.js
generated
vendored
1
assets/vendor/momentjs/moment-timezone-with-data-2012-2022.min.js
generated
vendored
File diff suppressed because one or more lines are too long
1
assets/vendor/momentjs/moment-timezone.min.js
generated
vendored
1
assets/vendor/momentjs/moment-timezone.min.js
generated
vendored
File diff suppressed because one or more lines are too long
1
assets/vendor/momentjs/moment.min.js
generated
vendored
1
assets/vendor/momentjs/moment.min.js
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -20,10 +20,11 @@ DefaultContentLanguage = "en" # Default language fo
|
||||||
introHeight = "fullheight" # Input either "medium" or "large" or "fullheight"
|
introHeight = "fullheight" # Input either "medium" or "large" or "fullheight"
|
||||||
showLatest = true # Show latest blog post summary
|
showLatest = true # Show latest blog post summary
|
||||||
showAllPosts = false # Set true to list all posts on home page, or set false to link to separate blog list page
|
showAllPosts = false # Set true to list all posts on home page, or set false to link to separate blog list page
|
||||||
|
allPostsArchiveFormat = true # show all posts in an archive format
|
||||||
numberOfProjectsToShow = 3 # Maximum number of projects to show on home page. Unset or comment out to show all projects
|
numberOfProjectsToShow = 3 # Maximum number of projects to show on home page. Unset or comment out to show all projects
|
||||||
localTime = true # Show your current local time in contact section
|
localTime = true # Show your current local time in contact section
|
||||||
timeZone = "America/Los_Angeles" # Your timezone as in the TZ* column of this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
timeZone = "America/Los_Angeles" # Your timezone as in the TZ* column of this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||||
timeFormat = "h:mm A" # https://momentjs.com/docs/#/displaying/format/
|
timeFormat = "en-US" # Language specific format to use
|
||||||
[params.projects]
|
[params.projects]
|
||||||
useTwoColumns = false # Use a layout with two columns instead of three
|
useTwoColumns = false # Use a layout with two columns instead of three
|
||||||
|
|
||||||
|
|
2
exampleSite/content/en/blog/long-form-post.md
Executable file → Normal file
2
exampleSite/content/en/blog/long-form-post.md
Executable file → Normal file
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: "**Long** Form Post!"
|
title: "**Long** Form Post!"
|
||||||
date: 2020-05-30T20:18:53-05:00
|
date: 2019-05-30T20:18:53-05:00
|
||||||
showDate: true
|
showDate: true
|
||||||
draft: false
|
draft: false
|
||||||
tags: ["blog","code"]
|
tags: ["blog","code"]
|
||||||
|
|
|
@ -5,24 +5,27 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{{ if .Site.Params.home.showLatest | default true }}
|
{{ if .Site.Params.home.showLatest | default true }}
|
||||||
<h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2>
|
<h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2>
|
||||||
{{ range first 1 .Pages.ByPublishDate.Reverse }}
|
{{ range first 1 .Pages.ByPublishDate.Reverse }}
|
||||||
<div class="summary">{{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}{{ end }}
|
<div class="summary">{{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}{{ end }}
|
||||||
<h3 class="title is-3 strong-post-title">
|
<h3 class="title is-3 strong-post-title">
|
||||||
<a href="{{ .Permalink }}">
|
<a href="{{ .Permalink }}">
|
||||||
{{ .Title | markdownify }}
|
{{ .Title | markdownify }}
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="markdown">
|
<div class="markdown">
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
{{ if .Truncated }}
|
{{ if .Truncated }}
|
||||||
<a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a>
|
<a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
||||||
{{ partialCached "blog/li.html" . }}
|
{{if .Site.Params.home.allPostsArchiveFormat}}
|
||||||
|
{{ partialCached "blog/archive.html" .}}
|
||||||
|
{{else}}
|
||||||
|
{{ partialCached "blog/li.html" . }}
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
{{ if .Site.Params.home.localTime }}
|
{{ if .Site.Params.home.localTime }}
|
||||||
<p>{{ i18n "index_currentTime" . }} <span id="time" data-time-zone="{{ .Site.Params.home.timeZone }}" data-time-format="{{ .Site.Params.home.timeFormat }}"></span>.</p>
|
<p>{{ i18n "index_currentTime" . }} <span id="time"></span>.</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Site.Params.email }}
|
{{ with .Site.Params.email }}
|
||||||
<h3 class="subtitle is-3 has-text-centered top-pad">
|
<h3 class="subtitle is-3 has-text-centered top-pad">
|
||||||
|
@ -132,12 +132,15 @@
|
||||||
{{ partial "js/owlCarousel.html" . }}
|
{{ partial "js/owlCarousel.html" . }}
|
||||||
|
|
||||||
{{ if .Site.Params.home.localTime }}
|
{{ if .Site.Params.home.localTime }}
|
||||||
{{ $momentjs := resources.Get "vendor/momentjs/moment.min.js" }}
|
<script>
|
||||||
{{ $momentTimezone := resources.Get "vendor/momentjs/moment-timezone.min.js" }}
|
function update_localtime() {
|
||||||
{{ $momentTimezoneWithData := resources.Get "vendor/momentjs/moment-timezone-with-data-2012-2022.min.js" }}
|
const time = new Date().toLocaleTimeString('{{ .Site.Params.home.timeFormat }}', { timeZone: '{{ .Site.Params.home.timeZone }}', timeStyle: 'short' });
|
||||||
{{ $initMomentjs := resources.Get "js/initMoment.js" }}
|
document.getElementById('time').innerHTML = time;
|
||||||
{{ $bundleMoment := slice $momentjs $momentTimezone $momentTimezoneWithData $initMomentjs | resources.Concat "js/bundleMoment.js" | fingerprint }}
|
}
|
||||||
<script src="{{ $bundleMoment.Permalink }}" integrity="{{ $bundleMoment.Data.Integrity }}"></script>
|
update_localtime();
|
||||||
|
// Updating every second to prevent seconds looking like stood still when timeStyle is ignored.
|
||||||
|
setInterval(update_localtime, 1000);
|
||||||
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
24
layouts/partials/blog/archive.html
Normal file
24
layouts/partials/blog/archive.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<section>
|
||||||
|
{{ $prev := now.Format "2006"}} <!--start from the current year-->
|
||||||
|
{{ range first 1 .Pages.ByPublishDate.Reverse }}
|
||||||
|
{{if .Date}} <!--also add the header if there are posts during the current year-->
|
||||||
|
{{if eq $prev (.Date.Format "2006")}} <h2 class="title is-2 top-pad"> {{ $prev }}</h2> {{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{range .Pages.ByPublishDate.Reverse}}
|
||||||
|
{{if .Date}}
|
||||||
|
{{$curr := .Date.Format "2006"}}
|
||||||
|
{{if lt $curr $prev }}
|
||||||
|
<h2 class="title is-2 top-pad">{{ $curr }}</h2>
|
||||||
|
{{end}}
|
||||||
|
<li class="post-item">
|
||||||
|
{{ if .Params.date }}
|
||||||
|
<span>{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}</span> -
|
||||||
|
{{ end }}
|
||||||
|
<span><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></span>
|
||||||
|
</li>
|
||||||
|
{{ $prev = $curr}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
</section>
|
|
@ -1,5 +1,5 @@
|
||||||
{{- if .Site.DisqusShortname }}
|
{{- if .Site.DisqusShortname }}
|
||||||
<div class="disqus">
|
<div class="container disqus">
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ template "_internal/disqus.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -16,22 +16,28 @@
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Site.Params.home.showAllPosts }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="all-posts">
|
{{ if .Site.Params.home.showAllPosts }}
|
||||||
<div class="container">
|
<div class="section" id="all-posts">
|
||||||
<h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
<div class="container">
|
||||||
{{ partialCached "blog/li.html" . }}
|
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
||||||
{{ else }}
|
{{if .Site.Params.home.allPostsArchiveFormat}}
|
||||||
|
{{ partialCached "blog/archive.html" .}}
|
||||||
|
{{else}}
|
||||||
|
{{ partialCached "blog/li.html" . }}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ else }}
|
||||||
<div class="container has-text-centered top-pad">
|
<div class="container has-text-centered top-pad">
|
||||||
<a href="{{ .Permalink }}">{{ i18n "index_blog_allPosts" . }}</a>
|
<a href="{{ .Permalink }}">{{ i18n "index_blog_allPosts" . }}</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
|
||||||
<!-- End Blog container -->
|
<!-- End Blog container -->
|
||||||
{{ partial "top-icon.html" . }}
|
{{ partial "top-icon.html" . }}
|
||||||
</div>
|
|
||||||
<!-- End Blog section -->
|
<!-- End Blog section -->
|
||||||
<div class="container"><hr></div>
|
<div class="container"><hr></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
{{ if $isHome }}
|
{{ if $isHome }}
|
||||||
<a class="navbar-item" href="{{ printf "#%s" ( .Title | urlize) | relLangURL }}">{{ .Title | markdownify }}</a>
|
<a class="navbar-item" href="{{ printf "#%s" ( .Title | urlize) | relLangURL }}">{{ .Title | markdownify }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $pageIsInProjects := eq $.Page.Section "project"}}
|
{{ $pageIsInProjects := eq $.Page.Section "projects"}}
|
||||||
{{ if not (and $pageIsInProjects (eq $.Page.Kind "section")) }}
|
{{ if not (and $pageIsInProjects (eq $.Page.Kind "section")) }}
|
||||||
<a class="navbar-item" href="{{ .Permalink }}">
|
<a class="navbar-item" href="{{ .Permalink }}">
|
||||||
{{ if $pageIsInProjects }}
|
{{ if $pageIsInProjects }}
|
||||||
|
|
Loading…
Reference in a new issue