Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (18 sloc) 1.01 KB
block variables
- var siteName = locals.site.siteName ? locals.site.siteName : 'Code Line Daily';
- var siteDesc = locals.site.siteDesc ? locals.site.siteDesc : 'A line of code of the day.';
- var siteURL = locals.site.siteURL ? locals.site.siteURL : '/';
//- - var siteImg = locals.site.siteImg ? locals.site.siteImg : '/';
- var og = locals.site.og ? locals.site.og : '/';
- var menu = locals.site.menu ? locals.site.menu : [];
- var menu2 = locals.site.menu2 ? locals.site.menu2 : [];
- var list = locals.data.list ? locals.data.list.filter(item => new Date(item.date) < new Date()) : [];
- var thisItem = list.slice(-1).pop()
- var listArchive = list.slice().reverse();
- var listEvergreen = list.slice().filter(item => item.evergreen);
- var siteImg = siteURL + '/gfx/cover/' + thisItem.date + '.png'
- function formatNumber(num)
- return num < 10 ? '0' + num : num;
- function formatDate(date)
- var d = new Date(date);
- return d.getFullYear() + '-' + formatNumber(d.getMonth() + 1) + '-' + formatNumber(d.getDate());
You can’t perform that action at this time.