Skip to content

'updated time' is not reflected in deploy and public #6

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
foxcodegit opened this issue Jun 1, 2022 · 7 comments
Closed

'updated time' is not reflected in deploy and public #6

foxcodegit opened this issue Jun 1, 2022 · 7 comments

Comments

@foxcodegit
Copy link

Hello. Actually, the updated time shows up on the local server,
but when I deploy and publish it, it shows {docsify-updated}.
I used both min and normal js and it was the same.
How can I solve this problem?

@pfeak
Copy link
Owner

pfeak commented Jun 1, 2022

Can you show me how index.html is defined and how it is deployed?

@foxcodegit
Copy link
Author

foxcodegit commented Jun 2, 2022

Thank you for your fast reply. Here it is.

how: git → github → netlify

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>docsify</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>

  <div id="app"></div>
  <script>
    window.$docsify = {

      // basePath: '/top/',
      name: 'docsify',
      repo: '',
      loadSidebar: true,
      maxLevel: 6,
      subMaxLevel: 3,
      coverpage: false,
      onlyCover: true,
      autoHeader: true,
      topMargin: 40,
      auto2top: true,
      loadNavbar: false,
      mergeNavbar: false,
      // notFoundPage: '_404.md',

      //Search
      search: 'auto', // 初期値
      search: {
        paths: 'auto',
        placeholder: {
          '/ja-jp/': '検索',
          '/': 'Type to search'
        },
        noData: {
          '/ja-jp/': '結果がありません',
          '/': 'No Results'
        },
      }, //Search

      //PageNation
      pagination: {
        previousText: 'Prev',
        nextText: 'Next',
        crossChapter: true,
        crossChapterText: true,
      },

      // Plugin - Display Updated DateTime
      timeUpdater: {
        text: "<div id='update-time' align='right'>update : {docsify-updated}</div>",
        formatUpdated: "{YY}.{MM}.{DD}",
        whereToPlace: "top",  // "top" or "bottom", default to "bottom"
      },

      plugins: [
        function(hook) {
          //Footer
          // var footer = [
          //   '<hr/>',
          //   '<footer>',
          //   '<span><a href="https://github.com/QingWei-Li">cinwell</a> &copy;2017.</span>',
          //   '<span>Proudly published with <a href="https://github.com/docsifyjs/docsify" target="_blank">docsify</a>.</span>',
          //   '</footer>'
          // ].join('');
          // hook.afterEach(function(html) {
          //   return html + footer;
          // })
        }
      ],

    } //window.$docsify

  </script>
  <!-- Docsify v4 -->
  <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
  <script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
  <!-- Plugin - Display Updated DateTime -->
  <script src="//cdn.jsdelivr.net/npm/docsify-updated/src/time-updater.min.js"></script>
</body>
</html>

@pfeak
Copy link
Owner

pfeak commented Jun 3, 2022

Thank you for your use and problem submission.
After testing, it was found that this is a problem with the docsfiy configuration. I have submitted an issue to docsify.

docsifyjs/docsify#1813

@pfeak
Copy link
Owner

pfeak commented Jun 20, 2022

It seems that netlify and CodeSandbox filter the last-modified field in the returned response, which is irrelevant to their business (docsifyjs/docsify#1813 (comment)).

@foxcodegit
Copy link
Author

Since netlify and codesandbox don't show last-modified and don't have an api, does that mean the only solution we have now is GitHub Pages?

@pfeak
Copy link
Owner

pfeak commented Jul 14, 2022

Now it seems that in addition to GitHub Pages, it can also be deployed manually to cloud servers, or other methods that support the return of the last-modified field in the request header.

@foxcodegit
Copy link
Author

I'll try to figure out which way is best.
Thanks for your support.

@pfeak pfeak closed this as completed Aug 30, 2022
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