render: remove dummy argument in handlebars helper

turns out they just can't handle `||` -- adding a space in between fixes
the problem.
This commit is contained in:
Peter Cai 2020-04-11 09:18:02 +08:00
parent e8fdba132b
commit d8f05bad95
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
4 changed files with 7 additions and 8 deletions

View File

@ -82,9 +82,8 @@ lazy_static! {
}; };
} }
handlebars_helper!(cur_year: |dummy: u64| Date::new_0().get_full_year()); handlebars_helper!(cur_year: | | Date::new_0().get_full_year());
handlebars_helper!(build_num: |dummy: u64| BuildTag{}.get_build_timestamp()); handlebars_helper!(build_num: | | BuildTag{}.get_build_timestamp());
// TODO: actually implement this helper
handlebars_helper!(format_date: |date: u64, format: str| { handlebars_helper!(format_date: |date: u64, format: str| {
NaiveDateTime::from_timestamp(date as i64, 0).format(format).to_string() NaiveDateTime::from_timestamp(date as i64, 0).format(format).to_string()
}); });

View File

@ -2,7 +2,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{ blog.title }}</title> <title>{{ blog.title }}</title>
<link rel="stylesheet" href="/static/style.css?ver={{ build_num 0 }}"/> <link rel="stylesheet" href="/static/style.css?ver={{ build_num }}"/>
</head> </head>
<body> <body>
{{> loading.hbs }} {{> loading.hbs }}
@ -29,6 +29,6 @@
</div> </div>
</div> </div>
</div> </div>
<script src="/static/script.js?ver={{ build_num 0 }}"></script> <script src="/static/script.js?ver={{ build_num }}"></script>
</body> </body>
</html> </html>

View File

@ -2,7 +2,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{ title }} - {{ blog.title }}</title> <title>{{ title }} - {{ blog.title }}</title>
<link rel="stylesheet" href="/static/style.css?ver={{ build_num 0 }}"/> <link rel="stylesheet" href="/static/style.css?ver={{ build_num }}"/>
</head> </head>
<body> <body>
{{> loading.hbs }} {{> loading.hbs }}
@ -20,6 +20,6 @@
<!-- We don't handle this in backend --> <!-- We don't handle this in backend -->
</div> </div>
</div> </div>
<script src="/static/script.js?ver={{ build_num 0 }}"></script> <script src="/static/script.js?ver={{ build_num }}"></script>
</body> </body>
</html> </html>

View File

@ -13,7 +13,7 @@
</ul> </ul>
</section> </section>
<section class="copyright"> <section class="copyright">
Copyright © {{ cur_year 0 }} {{ blog.title }}<br /> Copyright © {{ cur_year }} {{ blog.title }}<br />
Powered by <a href="https://github.com/PeterCxy/paprika" target="_blank">paprika</a><br /> Powered by <a href="https://github.com/PeterCxy/paprika" target="_blank">paprika</a><br />
Hosted on <a href="https://workers.cloudflare.com/" target="_blank">Cloudflare Workers</a> Hosted on <a href="https://workers.cloudflare.com/" target="_blank">Cloudflare Workers</a>
</section> </section>