File tree 4 files changed +16
-4
lines changed
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ import TranslationContext from "Layout/TranslationContext";
4
4
5
5
const Footer = ( ) => {
6
6
const getTranslation = useContext ( TranslationContext ) ;
7
+ const currentYear = new Date ( ) . getFullYear ( ) ;
7
8
8
9
return (
9
10
< div className = "lingvodoc-page__footer lingvodoc-footer" >
10
11
< div className = "lingvodoc-footer__inner" >
11
- Copyright © 2012-2022
12
+ Copyright © 2012-{ Math . max ( 2023 , Number ( __BUILD_YEAR__ ) , currentYear ) }
12
13
< a href = "https://iling-ran.ru" target = "_blank" rel = "noreferrer" >
13
14
{ getTranslation ( "Institute of Linguistics Russian Academy of Sciences" ) }
14
15
</ a >
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ if ("LINGVODOC_BUILD_TYPE" in process.env) {
63
63
versionString += process . env . LINGVODOC_BUILD_TYPE ;
64
64
}
65
65
66
+ /* Constructing current year. */
67
+
68
+ var buildYear = "" ;
69
+
70
+ try {
71
+ buildYear = new Date ( ) . getFullYear ( ) . toString ( ) ;
72
+ } catch ( error ) { }
73
+
66
74
module . exports = {
67
75
cwd ( file ) {
68
76
return path . join ( process . cwd ( ) , file || "" ) ;
@@ -80,5 +88,6 @@ module.exports = {
80
88
}
81
89
} ;
82
90
} ,
83
- versionString
91
+ versionString,
92
+ buildYear
84
93
} ;
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ base.plugins.push(
54
54
} ) ,
55
55
new webpack . DefinePlugin ( {
56
56
"process.env.NODE_ENV" : JSON . stringify ( "development" ) ,
57
- __VERSION__ : JSON . stringify ( _ . versionString )
57
+ __VERSION__ : JSON . stringify ( _ . versionString ) ,
58
+ __BUILD_YEAR__ : JSON . stringify ( _ . buildYear )
58
59
} ) ,
59
60
new webpack . HotModuleReplacementPlugin ( ) ,
60
61
new ReactRefreshWebpackPlugin ( ) ,
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ base.plugins.push(
64
64
new MiniCssExtractPlugin ( { filename : "[name].[contenthash:8].css" , chunkFilename : "[id].[contenthash:8].css" } ) ,
65
65
new webpack . DefinePlugin ( {
66
66
"process.env.NODE_ENV" : JSON . stringify ( "production" ) ,
67
- __VERSION__ : JSON . stringify ( _ . versionString )
67
+ __VERSION__ : JSON . stringify ( _ . versionString ) ,
68
+ __BUILD_YEAR__ : JSON . stringify ( _ . buildYear )
68
69
} )
69
70
) ;
70
71
You can’t perform that action at this time.
0 commit comments