I’ve been working through this and I believe I am seeing some inconsistency in the way .Lastmod
is populated.
Note: throughout all my tests, I always use full Hugo renders, with --enableGitInfo --disableFastRender
I built a partial to dump a range of pages like this:
<div class="">
<h2>ByLastMod</h2>
{{ $byLastMod := .Site.RegularPages.ByLastmod }}
{{ $recent := ($byLastMod | last 5).Reverse }}
<ol>
{{ range $byLastMod }}
<li>
<p class="" style="margin:0 0;">
File <b>{{ .Title }}</b> Lastmod date is <b>{{ .Lastmod }}</b>
</p>
</li>
{{ end }}
</ol>
</div>
This gives me the following list:
ByLastMod
1. File 18. Best Practices Lastmod date is 0001-01-01 00:00:00 +0000 UTC
2. File 17.API-8 Lastmod date is 0001-01-01 00:00:00 +0000 UTC
3. File 19. Performance Tweaks Lastmod date is 0001-01-01 00:00:00 +0000 UTC
4. File 20. Further Resources Lastmod date is 0001-01-01 00:00:00 +0000 UTC
5. File 21. Appendix A - Code Examples Lastmod date is 0001-01-01 00:00:00 +0000 UTC
6. File Downloading & Installing Lastmod date is 0001-01-01 00:00:00 +0000 UTC
7. File Getting Started Lastmod date is 0001-01-01 00:00:00 +0000 UTC
8. File Opening an Issue about a page Lastmod date is 0001-01-01 00:00:00 +0000 UTC
9. File Raising Issues Lastmod date is 0001-01-01 00:00:00 +0000 UTC
10. File Troubleshooting and Support Lastmod date is 0001-01-01 00:00:00 +0000 UTC
11. File 22. Appendix B - API Methods Lastmod date is 0001-01-01 00:00:00 +0000 UTC
12. File Forking SuiteCRM Lastmod date is 0001-01-01 00:00:00 +0000 UTC
13. File Licensing Lastmod date is 0001-01-01 00:00:00 +0000 UTC
14. File Upgrading Lastmod date is 0001-01-01 00:00:00 +0000 UTC
15. File User Wizard Lastmod date is 0001-01-01 00:00:00 +0000 UTC
16. File Local Setup for Documentation Work Lastmod date is 0001-01-01 00:00:00 +0000 UTC
17. File Managing User Accounts Lastmod date is 0001-01-01 00:00:00 +0000 UTC
18. File Using the Upgrade Wizard Lastmod date is 0001-01-01 00:00:00 +0000 UTC
19. File Coding Standards Lastmod date is 0001-01-01 00:00:00 +0000 UTC
20. File Releases Lastmod date is 0001-01-01 00:00:00 +0000 UTC
21. File Uninstalling Lastmod date is 0001-01-01 00:00:00 +0000 UTC
22. File User Interface Lastmod date is 0001-01-01 00:00:00 +0000 UTC
23. File Bug Fixes Lastmod date is 0001-01-01 00:00:00 +0000 UTC
24. File Compatibility Matrix Lastmod date is 0001-01-01 00:00:00 +0000 UTC
25. File Accounts Lastmod date is 0001-01-01 00:00:00 +0000 UTC
26. File Contacts Lastmod date is 0001-01-01 00:00:00 +0000 UTC
27. File Providing a Feature Lastmod date is 0001-01-01 00:00:00 +0000 UTC
28. File Opportunities Lastmod date is 0001-01-01 00:00:00 +0000 UTC
29. File Leads Lastmod date is 0001-01-01 00:00:00 +0000 UTC
30. File Calendar Lastmod date is 0001-01-01 00:00:00 +0000 UTC
31. File Calls Lastmod date is 0001-01-01 00:00:00 +0000 UTC
32. File Meetings Lastmod date is 0001-01-01 00:00:00 +0000 UTC
33. File Email Settings Lastmod date is 0001-01-01 00:00:00 +0000 UTC
34. File Email Templates Lastmod date is 0001-01-01 00:00:00 +0000 UTC
35. File Emails Lastmod date is 0001-01-01 00:00:00 +0000 UTC
36. File Emails - LTS Lastmod date is 0001-01-01 00:00:00 +0000 UTC
37. File Themes Lastmod date is 0001-01-01 00:00:00 +0000 UTC
38. File Confirmed Opt-In Lastmod date is 0001-01-01 00:00:00 +0000 UTC
39. File Tasks Lastmod date is 0001-01-01 00:00:00 +0000 UTC
40. File Notes Lastmod date is 0001-01-01 00:00:00 +0000 UTC
41. File Documents Lastmod date is 0001-01-01 00:00:00 +0000 UTC
42. File Targets Lastmod date is 0001-01-01 00:00:00 +0000 UTC
43. File Target Lists Lastmod date is 0001-01-01 00:00:00 +0000 UTC
44. File Campaigns Lastmod date is 0001-01-01 00:00:00 +0000 UTC
45. File Surveys Lastmod date is 0001-01-01 00:00:00 +0000 UTC
46. File Cases Lastmod date is 0001-01-01 00:00:00 +0000 UTC
47. File Projects Lastmod date is 0001-01-01 00:00:00 +0000 UTC
48. File Sales Lastmod date is 0001-01-01 00:00:00 +0000 UTC
49. File Workflow Lastmod date is 0001-01-01 00:00:00 +0000 UTC
50. File Cases with Portal Lastmod date is 0001-01-01 00:00:00 +0000 UTC
51. File Events Lastmod date is 0001-01-01 00:00:00 +0000 UTC
52. File Reports Lastmod date is 0001-01-01 00:00:00 +0000 UTC
53. File Reschedule Lastmod date is 0001-01-01 00:00:00 +0000 UTC
54. File Security Suite (Groups) Lastmod date is 0001-01-01 00:00:00 +0000 UTC
55. File JJW Maps Lastmod date is 0001-01-01 00:00:00 +0000 UTC
56. File Appendix A Lastmod date is 0001-01-01 00:00:00 +0000 UTC
57. File Code of Conduct Lastmod date is 0001-01-01 00:00:00 +0000 UTC
58. File Contributor Agreement Lastmod date is 0001-01-01 00:00:00 +0000 UTC
59. File Creating an Alert in SuiteCRM Lastmod date is 2015-08-25 12:00:00 +0100 WEST
60. File ListView Conditional Formatting Lastmod date is 2016-03-04 12:00:00 +0100 +0100
61. File Scheduler Jobs in SuiteCRM in Linux - the Definitive Guide Lastmod date is 2017-04-14 12:00:00 +0100 WEST
62. File 1. Introduction Lastmod date is 2018-01-12 17:04:03 +0000 WET
63. File 2. SuiteCRM Directory Structure Lastmod date is 2018-01-12 17:04:03 +0000 WET
64. File 3. Working with Beans Lastmod date is 2018-01-12 17:04:03 +0000 WET
65. File 4. Vardefs Lastmod date is 2018-01-12 17:04:03 +0000 WET
66. File 5. Views Lastmod date is 2018-01-12 17:04:03 +0000 WET
67. File 6. Metadata Lastmod date is 2018-01-12 17:04:03 +0000 WET
68. File 7. Controllers Lastmod date is 2018-01-12 17:04:03 +0000 WET
69. File 8. Entry Points Lastmod date is 2018-01-12 17:04:03 +0000 WET
70. File 9. Language Strings Lastmod date is 2018-01-12 17:04:03 +0000 WET
71. File 10. Config Lastmod date is 2018-01-12 17:04:03 +0000 WET
72. File 11. Logging Lastmod date is 2018-01-12 17:04:03 +0000 WET
73. File 12. Logic Hooks Lastmod date is 2018-01-12 17:04:03 +0000 WET
74. File 13. Scheduled Tasks Lastmod date is 2018-01-12 17:04:03 +0000 WET
75. File 14. Extension Framework Lastmod date is 2018-01-12 17:04:03 +0000 WET
76. File 15. Module Installer Lastmod date is 2018-01-12 17:04:03 +0000 WET
77. File Editing a page Lastmod date is 2018-02-21 23:39:10 +0000 WET
78. File 16. API-4_1 Lastmod date is 2018-02-22 00:33:52 +0000 WET
79. File Test page Lastmod date is 2018-02-22 14:22:04 +0000 WET
So, a bunch of files don’t get a proper .Lastmod
date. Note that these pages don’t generally contain lastmod
in the front-matter, nor date
, so I’m expecting this to come from GitInfo.AuthorDate
as defined here (in the .Lastmod
section). The exception to this are those 3 files showing dates from 2015-2017, that’s coming from front-matter.
Now, sometimes it seems to pick up my commit date. But it’s very irregular. I’ve even seen the same file get a .Lastmod
date from a commit, but then not from a subsequent commit done afterwards.
I attempted several things trying to look for a pattern of when it fails:
- is it when I commit several files in one commit, versus single-file commits?
- is it merge commits versus other commits?
- is it when I commit files with spaces in their names?
None of these were conclusive, it must be something else…
Although I don’t know any Go, I’ve even looked at Hugo code to try and figure out how GitInfo grabs information from Git. I’ve tracked it down to this and this. I got stuck on this line, it’s not the kind of thing one can figure out easily without actually running it and testing it 
If you can just tell me exactly what git
command that produces I think I can continue debugging on my own, trying to see how the git log
output is coming from my git repo.