Doc: Added cache buster timestamp to CSS and JS files

pull/5176/head
Laurent Cozic 2021-07-10 11:29:18 +01:00
parent d411d14818
commit e3db3871b6
4 changed files with 9 additions and 6 deletions

View File

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Jopli website" />
<link rel="stylesheet" href="{{cssBaseUrl}}/fontawesome-all.min.css">
<link rel="stylesheet" href="{{cssBaseUrl}}/fontawesome-all.min.css?t={{buildTime}}">
<link
rel="stylesheet"
href="{{cssBaseUrl}}/bootstrap5.0.2.min.css"
@ -23,7 +23,7 @@
media="all"
onload="this.media='all'; this.onload = null"
/>
<link rel="stylesheet" href="{{cssBaseUrl}}/site.css" as="style" />
<link rel="stylesheet" href="{{cssBaseUrl}}/site.css?t={{buildTime}}" as="style" />
<title>Joplin</title>
</head>
<body class="front-page website-env-{{env}}">
@ -403,7 +403,7 @@
rel="preload"
as="script"
></script>
<script src="{{jsBaseUrl}}/script.js"></script>
<script src="{{jsBaseUrl}}/script.js?t={{buildTime}}"></script>
{{> analytics}}
</body>
</html>

View File

@ -28,7 +28,7 @@ https://github.com/laurent22/joplin/blob/dev/{{{sourceMarkdownFile}}}
href="{{cssBaseUrl}}/bootstrap5.0.2.min.css"
as="style"
/>
<link rel="stylesheet" href="{{cssBaseUrl}}/fontawesome-all.min.css">
<link rel="stylesheet" href="{{cssBaseUrl}}/fontawesome-all.min.css?t={{buildTime}}">
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap"
rel="stylesheet"
@ -36,7 +36,7 @@ https://github.com/laurent22/joplin/blob/dev/{{{sourceMarkdownFile}}}
media="all"
onload="this.media='all'; this.onload = null"
/>
<link rel="stylesheet" href="{{cssBaseUrl}}/site.css" as="style" />
<link rel="stylesheet" href="{{cssBaseUrl}}/site.css?t={{buildTime}}" as="style" />
<title>{{pageTitle}}</title>
</head>
<body class="website-env-{{env}}">
@ -107,7 +107,7 @@ https://github.com/laurent22/joplin/blob/dev/{{{sourceMarkdownFile}}}
rel="preload"
as="script"
></script>
<script src="{{jsBaseUrl}}/script.js"></script>
<script src="{{jsBaseUrl}}/script.js?t={{buildTime}}"></script>
{{> analytics}}
</body>

View File

@ -9,6 +9,7 @@ const glob = require('glob');
const path = require('path');
const env = Env.Prod;
const buildTime = Date.now();
const websiteAssetDir = `${rootDir}/Assets/WebsiteAssets`;
const mainTemplateHtml = fs.readFileSync(`${websiteAssetDir}/templates/main-new.mustache`, 'utf8');
@ -77,6 +78,7 @@ function defaultTemplateParams(): TemplateParams {
navbar: {
isFrontPage: false,
},
buildTime,
};
}

View File

@ -61,6 +61,7 @@ export interface TemplateParams {
contentHtml?: string;
navbar?: NavBar;
showJoplinCloudLinks?: boolean;
buildTime?: number;
}
export interface Plan {