diff --git a/_config.yml b/_config.yml index 38e5873c5..d5b3d9f0a 100755 --- a/_config.yml +++ b/_config.yml @@ -33,6 +33,7 @@ menu: #about: /about archives: /archives tags: /tags + schedule: /schedule #commonweal: /404.html @@ -42,11 +43,12 @@ menu: # Key is the name of menu item and value is the name of FontAwsome icon. Key is case-senstive. # When an question mask icon presenting up means that the item has no mapping icon. menu_icons: - enable: true + enable: false #KeyMapsToMenuItemKey: NameOfTheIconFromFontAwesome home: home about: user categories: th + schedule: calendar tags: tags archives: archive commonweal: heartbeat @@ -333,6 +335,22 @@ busuanzi_count: # Enable baidu push so that the blog will push the url to baidu automatically which is very helpful for SEO baidu_push: false +# Google Calendar +# Share your recent schedule to others via calendar page +# +# API Documentation: +# https://developers.google.com/google-apps/calendar/v3/reference/events/list +calendar: + enable: false + calendar_id: + api_key: + orderBy: startTime + offsetMax: 24 + offsetMin: 4 + timeZone: + showDeleted: false + singleEvents: true + maxResults: 250 #! --------------------------------------------------------------- diff --git a/languages/en.yml b/languages/en.yml index 18854ea32..210c24b37 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -1,6 +1,7 @@ title: archive: Archive category: Category + schedule: Schedule tag: Tag author: Author @@ -9,6 +10,7 @@ menu: home: Home archives: Archives categories: Categories + schedule: Schedule tags: Tags about: About search: Search diff --git a/languages/zh-Hans.yml b/languages/zh-Hans.yml index 5d7e72be0..56f57fa0d 100644 --- a/languages/zh-Hans.yml +++ b/languages/zh-Hans.yml @@ -1,6 +1,7 @@ title: archive: 归档 category: 分类 + schedule: 日程 tag: 标签 author: 博主 @@ -9,6 +10,7 @@ menu: home: 首页 archives: 归档 categories: 分类 + schedule: 日程 tags: 标签 about: 关于 search: 搜索 diff --git a/layout/_layout.swig b/layout/_layout.swig index aa458112c..41f8c7f51 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -71,6 +71,7 @@ {% include '_scripts/third-party/mathjax.swig' %} {% include '_scripts/third-party/lean-analytics.swig' %} {% include '_scripts/baidu-push.swig' %} + {% include '_scripts/third-party/schedule.swig' %} diff --git a/layout/_scripts/third-party/schedule.swig b/layout/_scripts/third-party/schedule.swig new file mode 100644 index 000000000..6db3a3c46 --- /dev/null +++ b/layout/_scripts/third-party/schedule.swig @@ -0,0 +1,185 @@ +{% if theme.calendar.enable %} +{% if page.type == 'schedule' %} + + + +{% endif %} +{% endif %} diff --git a/layout/schedule.swig b/layout/schedule.swig new file mode 100644 index 000000000..cc9d50692 --- /dev/null +++ b/layout/schedule.swig @@ -0,0 +1,19 @@ +{% extends '_layout.swig' %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %} {{ __('title.schedule') }} | {{ config.title }} {% endblock %} + +{% block page_calendar %}page-post-detail{% endblock %} + +{% block content %} + +
+
    +
+
+ +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/source/css/_common/components/pages/pages.styl b/source/css/_common/components/pages/pages.styl index 769d94d31..cb14d04cb 100644 --- a/source/css/_common/components/pages/pages.styl +++ b/source/css/_common/components/pages/pages.styl @@ -2,4 +2,5 @@ @import "archive"; @import "categories"; +@import "schedule"; @import "post-detail"; diff --git a/source/css/_common/components/pages/schedule.styl b/source/css/_common/components/pages/schedule.styl new file mode 100644 index 000000000..18ec9334a --- /dev/null +++ b/source/css/_common/components/pages/schedule.styl @@ -0,0 +1,101 @@ +@keyframes dot-flash { + from {opacity: 1; transform:scale(1.1);} + to {opacity: 0; transform:scale(1);} +} + +#schedule { + ul#event-list { + padding-left: 30px + hr { + margin: 20px 0 45px 0!important + background: #222 + &:after { + display: inline-block + content: 'NOW' + background: #222 + color: #FFF + font-weight:bold + text-align: right + padding: 0 5px + } + } + li.event { + margin: 20px 0px + background: #F9F9F9 + padding-left: 10px + min-height: 40px + h2.event-summary { + margin: 0 + padding-bottom: 3px + &:before { + display: inline-block + font-family: FontAwesome + font-size: 8px + content: '\f111' + vertical-align: middle + margin-right: 25px + color: #bbb + } + } + span.event-relative-time { + display: inline-block + font-size: 12px + font-weight: 400 + padding-left: 12px + color: #bbb + } + span.event-details { + display: block + color: #bbb + margin-left: 56px + padding-top: 3px + padding-bottom: 6px + text-indent: -24px + line-height: 18px + &:before { + text-indent: 0 + display: inline-block + width: 14px + font-family: FontAwesome + text-align: center + margin-right: 9px + color: #bbb + } + &.event-location:before { + content: '\f041' + } + &.event-duration:before { + content: '\f017' + } + } + } + li.event-past { + background: #FCFCFC + & > * { + opacity: .6 + } + h2.event-summary { + color: #bbb + &:before { + color: #DFDFDF + } + } + } + li.event-now { + background: #222 + color: #FFF + padding: 15px 0 15px 10px + h2.event-summary { + &:before { + transform: scale(1.2) + color: #FFF + animation: dot-flash 1s alternate infinite ease-in-out; + } + } + * { + color: #FFF!important + } + } + } +} +