mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-21 19:42:52 +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"
|
||||
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
|
||||
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
|
||||
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
|
||||
timeFormat = "h:mm A" # https://momentjs.com/docs/#/displaying/format/
|
||||
timeFormat = "en-US" # Language specific format to use
|
||||
[params.projects]
|
||||
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!"
|
||||
date: 2020-05-30T20:18:53-05:00
|
||||
date: 2019-05-30T20:18:53-05:00
|
||||
showDate: true
|
||||
draft: false
|
||||
tags: ["blog","code"]
|
||||
|
|
|
@ -20,9 +20,12 @@
|
|||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
||||
{{if .Site.Params.home.allPostsArchiveFormat}}
|
||||
{{ partialCached "blog/archive.html" .}}
|
||||
{{else}}
|
||||
{{ partialCached "blog/li.html" . }}
|
||||
{{end}}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
{{ .Content }}
|
||||
</div>
|
||||
{{ 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 }}
|
||||
{{ with .Site.Params.email }}
|
||||
<h3 class="subtitle is-3 has-text-centered top-pad">
|
||||
|
@ -132,12 +132,15 @@
|
|||
{{ partial "js/owlCarousel.html" . }}
|
||||
|
||||
{{ if .Site.Params.home.localTime }}
|
||||
{{ $momentjs := resources.Get "vendor/momentjs/moment.min.js" }}
|
||||
{{ $momentTimezone := resources.Get "vendor/momentjs/moment-timezone.min.js" }}
|
||||
{{ $momentTimezoneWithData := resources.Get "vendor/momentjs/moment-timezone-with-data-2012-2022.min.js" }}
|
||||
{{ $initMomentjs := resources.Get "js/initMoment.js" }}
|
||||
{{ $bundleMoment := slice $momentjs $momentTimezone $momentTimezoneWithData $initMomentjs | resources.Concat "js/bundleMoment.js" | fingerprint }}
|
||||
<script src="{{ $bundleMoment.Permalink }}" integrity="{{ $bundleMoment.Data.Integrity }}"></script>
|
||||
<script>
|
||||
function update_localtime() {
|
||||
const time = new Date().toLocaleTimeString('{{ .Site.Params.home.timeFormat }}', { timeZone: '{{ .Site.Params.home.timeZone }}', timeStyle: 'short' });
|
||||
document.getElementById('time').innerHTML = time;
|
||||
}
|
||||
update_localtime();
|
||||
// Updating every second to prevent seconds looking like stood still when timeStyle is ignored.
|
||||
setInterval(update_localtime, 1000);
|
||||
</script>
|
||||
{{ end }}
|
||||
</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 }}
|
||||
<div class="disqus">
|
||||
<div class="container disqus">
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
|
|
@ -16,22 +16,28 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ if .Site.Params.home.showAllPosts }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="all-posts">
|
||||
<div class="container">
|
||||
<h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
||||
<h2 class="title is-2 top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
|
||||
{{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">
|
||||
<a href="{{ .Permalink }}">{{ i18n "index_blog_allPosts" . }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- End Blog container -->
|
||||
{{ partial "top-icon.html" . }}
|
||||
</div>
|
||||
|
||||
<!-- End Blog section -->
|
||||
<div class="container"><hr></div>
|
||||
{{ end }}
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
{{ if $isHome }}
|
||||
<a class="navbar-item" href="{{ printf "#%s" ( .Title | urlize) | relLangURL }}">{{ .Title | markdownify }}</a>
|
||||
{{ else }}
|
||||
{{ $pageIsInProjects := eq $.Page.Section "project"}}
|
||||
{{ $pageIsInProjects := eq $.Page.Section "projects"}}
|
||||
{{ if not (and $pageIsInProjects (eq $.Page.Kind "section")) }}
|
||||
<a class="navbar-item" href="{{ .Permalink }}">
|
||||
{{ if $pageIsInProjects }}
|
||||
|
|
Loading…
Reference in a new issue