Skip to content

The formatUpdated config doesn't display any thing #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
immortalt opened this issue May 18, 2021 · 3 comments
Closed
1 task done

The formatUpdated config doesn't display any thing #1573

immortalt opened this issue May 18, 2021 · 3 comments

Comments

@immortalt
Copy link

immortalt commented May 18, 2021

Bug Report

You can see in this page's code:
https://github.com/immortal-blog/immortal-blog.github.io/blob/main/docs/index.html
and you can see that all pages don't have update time:
https://immortal-blog.github.io/#/golang/migrate-mgo-to-qmgo
I added the config as the doc mentioned,

window.$docsify = {
                formatUpdated: '{YYYY}-{MM}-{DD}',

but I still can't see any change in my blog. There is no time.
(I'm sure that I cleaned the cache before refreshing the page)

Steps to reproduce

  1. Create a Github Page using docsify like https://immortal-blog.github.io/#/, or you can just fork this git.
  2. Add the config option: formatUpdated: '{YYYY}-{MM}-{DD}'.
  3. Clean the browser cache and refresh the Github Page.

What is current behaviour

Nothing changed.
There is no update time on the page.

What is the expected behaviour

There is an update time on the page.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Ubuntu 20.04 LTS

  • Node.js version: v14.16.1

  • npm/yarn version: 7.12.0

  • Browser version: Firefox 88.0.1 x64

  • Docsify version: 4.4.3

  • Docsify plugins: disabled all

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

@sy-records
Copy link
Member

you need add {docsify-updated}

    window.$docsify = {
        formatUpdated: '{YYYY}-{MM}-{DD}',
        name: 'Immortal Blog',
        repo: '',
        auto2top: true,
        coverpage: true,
        loadSidebar: true,
        maxLevel: 4,
        subMaxLevel: 2,
+        plugins: [
+            function(hook, vm) {
+                hook.beforeEach(function(html) {
+                    return (
+                        html +
+                        '\n----\n' +
+                        'Last modified {docsify-updated}'
+                    );
+                });
+            }
+        ]
+    }

@immortalt
Copy link
Author

immortalt commented May 18, 2021

you need add {docsify-updated}

    window.$docsify = {
        formatUpdated: '{YYYY}-{MM}-{DD}',
        name: 'Immortal Blog',
        repo: '',
        auto2top: true,
        coverpage: true,
        loadSidebar: true,
        maxLevel: 4,
        subMaxLevel: 2,
+        plugins: [
+            function(hook, vm) {
+                hook.beforeEach(function(html) {
+                    return (
+                        html +
+                        '\n----\n' +
+                        'Last modified {docsify-updated}'
+                    );
+                });
+            }
+        ]
+    }

It seems that the problem solved. Thanks!
But I think docsify's doc needs to add this info, otherwise other user will also meet this problem and waste some time again and again.
The doc that needs to be completed is here: https://docsify.js.org/#/configuration?id=formatupdated.

@sy-records
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants