{"action":"created","issue":{"url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/197","repository_url":"https://api.github.com/repos/kaushalmodi/ox-hugo","labels_url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/197/comments","events_url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/197/events","html_url":"https://github.com/kaushalmodi/ox-hugo/pull/197","id":356220329,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTU2OTE2","number":197,"title":"Add org-hugo-suppress-lastmod-period","user":{"login":"takaxp","id":136673,"node_id":"MDQ6VXNlcjEzNjY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/136673?v=4","gravatar_id":"","url":"https://api.github.com/users/takaxp","html_url":"https://github.com/takaxp","followers_url":"https://api.github.com/users/takaxp/followers","following_url":"https://api.github.com/users/takaxp/following{/other_user}","gists_url":"https://api.github.com/users/takaxp/gists{/gist_id}","starred_url":"https://api.github.com/users/takaxp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaxp/subscriptions","organizations_url":"https://api.github.com/users/takaxp/orgs","repos_url":"https://api.github.com/users/takaxp/repos","events_url":"https://api.github.com/users/takaxp/events{/privacy}","received_events_url":"https://api.github.com/users/takaxp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-01T17:40:44Z","updated_at":"2018-09-04T18:55:28Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/kaushalmodi/ox-hugo/pulls/197","html_url":"https://github.com/kaushalmodi/ox-hugo/pull/197","diff_url":"https://github.com/kaushalmodi/ox-hugo/pull/197.diff","patch_url":"https://github.com/kaushalmodi/ox-hugo/pull/197.patch"},"body":"Hi.\r\n\r\nWhen I use `ox-hugo` with the following condition, `lastmod` is generated unexpectedly when I initially change the Org state to `DONE`. This user action is not actually modification of a post, it's just a creation of new post.\r\n\r\n- org-hugo-auto-set-lastmod = t\r\n- org-hugo-auto-export-on-save = t\r\n- org-log-done = time\r\n- using auto-save-buffers.el\r\n\r\nSo, I introduced `org-hugo-suppress-lastmod-period` variable to precisely control the period between the initial creation of an entry and actual modification of it.\r\n\r\nFor instance, when you change the Org state to `DONE` from `TODO` in an entry, the `date` is exported as `2018-09-02T02:01:00+09:00` derived from `CLOSED: [2018-09-02 Sun 02:01]`. This means the initial creation time is set to `02:01:00` but right after that the `lastmod` could be exported as `2018-09-02T02:01:14+09:00` based on the value of `(org-current-time)` at the moment of saving the file. So tiny time difference could be naturally occurred between changing Org state and file saving but this combined action is not actually modification of the entry.\r\n\r\nIf you set `org-hugo-suppress-lastmod-period` to `60.0` or other appropriate value, it can be avoided. Moreover, if you set it to `86400.0`, this means the modification to the entry will not create `lastmod` value in front matter until the next day of the initially change of Org state. This is also useful because some Hugo themes only show year, month, and day.\r\n\r\nWhat I did:\r\n- Added a new variable\r\n- Added two functions\r\n- Updated ox-hugo-manual\r\n- Added 5 testcases in 3 files\r\n- `-j1` applied to build doc as `make -j1 doc`\r\n\r\nUnresolved:\r\n- Applying local-variables in org files when building test\r\n- Checking the changes from \"TODO\" to \"DONE\" when building test in batch-mode\r\n\r\nBest regards,\r\nTakaaki"},"comment":{"url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/comments/418479267","html_url":"https://github.com/kaushalmodi/ox-hugo/pull/197#issuecomment-418479267","issue_url":"https://api.github.com/repos/kaushalmodi/ox-hugo/issues/197","id":418479267,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODQ3OTI2Nw==","user":{"login":"takaxp","id":136673,"node_id":"MDQ6VXNlcjEzNjY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/136673?v=4","gravatar_id":"","url":"https://api.github.com/users/takaxp","html_url":"https://github.com/takaxp","followers_url":"https://api.github.com/users/takaxp/followers","following_url":"https://api.github.com/users/takaxp/following{/other_user}","gists_url":"https://api.github.com/users/takaxp/gists{/gist_id}","starred_url":"https://api.github.com/users/takaxp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takaxp/subscriptions","organizations_url":"https://api.github.com/users/takaxp/orgs","repos_url":"https://api.github.com/users/takaxp/repos","events_url":"https://api.github.com/users/takaxp/events{/privacy}","received_events_url":"https://api.github.com/users/takaxp/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T18:55:28Z","updated_at":"2018-09-04T18:55:28Z","author_association":"CONTRIBUTOR","body":"BTW, do you think the name of `org-hugo-suppress-lastmod-period` is good to understand the variable? I'm not English native speaker so if you have any suggestions I'd like to follow you."}}
{"actor":{"display_login":"takaxp"}}