mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-08 22:49:44 +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
|
||||
|
||||
|
|
4
exampleSite/content/en/blog/long-form-post.md
Executable file → Normal file
4
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"]
|
||||
|
@ -48,4 +48,4 @@ Nulla pharetra diam:
|
|||
|
||||
Elit ut aliquam purus sit. Tortor id aliquet lectus proin nibh nisl condimentum id venenatis. Dictumst quisque sagittis purus sit. Consectetur purus ut faucibus pulvinar. Neque ornare aenean euismod elementum nisi. Nisl nisi scelerisque eu ultrices vitae auctor. Morbi tristique senectus et netus et malesuada fames ac turpis. Dolor morbi non arcu risus quis. Tortor pretium viverra suspendisse potenti.
|
||||
|
||||
Imperdiet sed euismod nisi porta lorem mollis. In hac habitasse platea dictumst vestibulum. Tincidunt eget nullam non nisi est sit. Facilisis sed odio morbi quis commodo odio. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam. Pulvinar pellentesque habitant morbi tristique senectus. Justo laoreet sit amet cursus sit amet dictum. Imperdiet sed euismod nisi porta lorem mollis aliquam ut. Integer vitae justo eget magna fermentum iaculis eu non diam. Suscipit adipiscing bibendum est ultricies integer quis auctor. Cursus risus at ultrices mi tempus imperdiet nulla. Facilisis leo vel fringilla est. Ut porttitor leo a diam sollicitudin tempor id eu. Curabitur gravida arcu ac tortor dignissim convallis. Egestas tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. Sit amet consectetur adipiscing elit. Nunc lobortis mattis aliquam faucibus purus in. Nulla porttitor massa id neque aliquam vestibulum. Augue ut lectus arcu bibendum at varius vel. Sit amet aliquam id diam maecenas ultricies.
|
||||
Imperdiet sed euismod nisi porta lorem mollis. In hac habitasse platea dictumst vestibulum. Tincidunt eget nullam non nisi est sit. Facilisis sed odio morbi quis commodo odio. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam. Pulvinar pellentesque habitant morbi tristique senectus. Justo laoreet sit amet cursus sit amet dictum. Imperdiet sed euismod nisi porta lorem mollis aliquam ut. Integer vitae justo eget magna fermentum iaculis eu non diam. Suscipit adipiscing bibendum est ultricies integer quis auctor. Cursus risus at ultrices mi tempus imperdiet nulla. Facilisis leo vel fringilla est. Ut porttitor leo a diam sollicitudin tempor id eu. Curabitur gravida arcu ac tortor dignissim convallis. Egestas tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. Sit amet consectetur adipiscing elit. Nunc lobortis mattis aliquam faucibus purus in. Nulla porttitor massa id neque aliquam vestibulum. Augue ut lectus arcu bibendum at varius vel. Sit amet aliquam id diam maecenas ultricies.
|
||||
|
|
|
@ -5,24 +5,27 @@
|
|||
<div class="container">
|
||||
{{ if .Site.Params.home.showLatest | default true }}
|
||||
<h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2>
|
||||
{{ range first 1 .Pages.ByPublishDate.Reverse }}
|
||||
<div class="summary">{{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}{{ end }}
|
||||
<h3 class="title is-3 strong-post-title">
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ .Title | markdownify }}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="markdown">
|
||||
{{ .Summary }}
|
||||
{{ if .Truncated }}
|
||||
<a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a>
|
||||
{{ end }}
|
||||
{{ range first 1 .Pages.ByPublishDate.Reverse }}
|
||||
<div class="summary">{{ if .Params.date }}{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}{{ end }}
|
||||
<h3 class="title is-3 strong-post-title">
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ .Title | markdownify }}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="markdown">
|
||||
{{ .Summary }}
|
||||
{{ if .Truncated }}
|
||||
<a href="{{ .Permalink }}">{{ i18n "index_blog_readMore" . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<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>
|
||||
{{ 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 }}
|
||||
{{ 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>
|
||||
{{ partialCached "blog/li.html" . }}
|
||||
{{ else }}
|
||||
{{ if .Site.Params.home.showAllPosts }}
|
||||
<div class="section" id="all-posts">
|
||||
<div class="container">
|
||||
<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 }}
|
||||
|
||||
<!-- End Blog container -->
|
||||
{{ partial "top-icon.html" . }}
|
||||
|
||||
<!-- 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