CyrusYip / cyrusyip-blog

Cyrus Yip's Blog built with Hugo | 叶寻的博客
https://cyrusyip.org/
MIT License
5 stars 1 forks source link

lastmod is wrong on Vercel and Cloudflare Pages #8

Closed CyrusYip closed 11 months ago

CyrusYip commented 1 year ago

https://cyrusyip.org/en/post/2023/01/11/fix-jellyfin-permission/

https://github.com/CyrusYip/cyrusyip-blog/commit/aaffd86505c102e5ed5d75cfac8317f3d61c5ea4

vercel:

image

cloudflare pages:

image

local:

image

CyrusYip commented 1 year ago

On the site host, your repository must be “deep-cloned,” so the returned .GitInfo data will be accurate. Otherwise, your site may display only data from your latest commit.

https://gohugo.io/variables/git/#hosting-considerations

When you make a deployment, Vercel builds your project. During this time, Vercel performs a "shallow clone" on your Git repository using the command git clone --depth=10 (...) and fetches ten levels of git commit history. This means that only the latest ten commits are pulled and not the entire repository history.

https://vercel.com/docs/deployments/configure-a-build

CyrusYip commented 1 year ago

I will probably migrate to Cloudflare Pages.

Todo:

comment:

{
  "redirects": [
    {
      "source": "/post/(index.xml)",
      "destination": "/zh-cn/$1"
      # /post/index.xml -> /zh-cn/index.xml
      # 应该是 /zh-cn/post/index.xml 才对,但 /zh-cn/post/index.xml 没有全文,/zh-cn/index.xml 有全文,将错就错还是改正呢?
      # 是不是还要加上 index.xml -> /zh-cn/index.xml ?
    },
    {
      "source": "/(about|subscribe|donate)(/?)",
      "destination": "/zh-cn/$1$2"
      # /about -> /zh-cn/about
    },
    {
      "source": "(/post/[0-9].*)",
      "destination": "/zh-cn$1"
      # /post/2020/10/02/ubuntu-compile-goldendict/ -> /zh-cn/post/2020/10/02/ubuntu-compile-goldendict/
      # 只判断了前面的日期数字,偷懒之举
    }
  ]
}
CyrusYip commented 11 months ago

I replaced Vercel with Cloudflare Pages.