GithubHelp home page GithubHelp logo

Support of `lastmod` about hugotex HOT 3 CLOSED

kaisugi avatar kaisugi commented on June 12, 2024 1
Support of `lastmod`

from hugotex.

Comments (3)

kaisugi avatar kaisugi commented on June 12, 2024

honestly I don't come up with a good idea because I don’t use this theme personally

If you have a good solution, feel free to send a PR (I guess you already added a new commint to the PR related to this issue

from hugotex.

catap avatar catap commented on June 12, 2024

I've added a draft commit by mistake to that PR O:-)

The best option that I have in mind is:

Screenshot 2024-01-05 at 11 34 06

from hugotex.

catap avatar catap commented on June 12, 2024

After some thought I've decided to move with following format:

--- a/layouts/partials/postmeta.html
+++ b/layouts/partials/postmeta.html
@@ -1,5 +1,11 @@
 <span class="meta-post">
-  <i class="fa fa-calendar-alt"></i>{{ .Lastmod.Format ( .Site.Params.dateformat | default "Jan 2, 2006") }}
+  {{- $lastmod := .Lastmod.Format ( .Site.Params.dateformat | default "Jan 2, 2006") }}
+  {{- $pubdate := .PublishDate.Format ( .Site.Params.dateformat | default "Jan 2, 2006") }}
+  <i class="fa fa-calendar-alt"></i>
+  {{ $pubdate }}
+  {{- if ne $lastmod $pubdate }}
+  ({{ $lastmod }})
+  {{- end }}
   {{ if .Params.categories }}
     <br><i class="fa fa-folder-open"></i>
     {{ range .Params.categories }}

See example at https://kirill.korins.ky

I'll play with it for some time, and I satisfied I'll open PR.

from hugotex.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.