diff --git a/CUSTOMIZE.md b/CUSTOMIZE.md index a41bf0d..55526e8 100644 --- a/CUSTOMIZE.md +++ b/CUSTOMIZE.md @@ -46,6 +46,10 @@ Here we will give you some tips on how to customize the website. One important t - [Adding a newsletter](#adding-a-newsletter) - [Configuring search features](#configuring-search-features) - [Managing publication display](#managing-publication-display) + - [Adding a Google Calendar](#adding-a-google-calendar) + - [Basic usage](#basic-usage) + - [Enable the calendar script for your page](#enable-the-calendar-script-for-your-page) + - [Optional: Customize the calendar style](#optional-customize-the-calendar-style) - [Updating third-party libraries](#updating-third-party-libraries) - [Removing content](#removing-content) - [Removing the blog page](#removing-the-blog-page) @@ -619,6 +623,45 @@ To add a thumbnail to a publication, include a `preview` field in your BibTeX en Place the image file in `assets/img/publication_preview/`. +## Adding a Google Calendar + +You can embed a Google Calendar on any page by using the `calendar.liquid` include. The calendar will automatically adapt to light and dark themes. + +### Basic usage + +Add the following to your page's Markdown file (for example, in `_pages/teaching.md`): + +```liquid +{% include calendar.liquid calendar_id='your-calendar-id@group.calendar.google.com' timezone='Your/Timezone' %} +``` + +Replace: + +- `your-calendar-id@group.calendar.google.com` with your actual Google Calendar ID (found in Google Calendar Settings → Integrate calendar → Calendar ID) +- `Your/Timezone` with your timezone (e.g., `UTC`, `Asia/Shanghai`, `America/New_York`). The default is `UTC`. + +### Enable the calendar script for your page + +To prevent unnecessary script loading, add `calendar: true` to the frontmatter of any page that displays a calendar: + +```yaml +--- +layout: page +title: teaching +calendar: true +--- +``` + +### Optional: Customize the calendar style + +You can optionally customize the iframe styling using the `style` parameter: + +```liquid +{% include calendar.liquid calendar_id='your-calendar-id@group.calendar.google.com' timezone='UTC' style='border:0; width:100%; height:800px;' %} +``` + +The default style is `border:0; width:100%; height:600px;`. + ## Updating third-party libraries The theme uses various third-party JavaScript and CSS libraries. You can manage these in the `third_party_libraries` section of [\_config.yml](_config.yml): diff --git a/README.md b/README.md index 25793a9..e577bdc 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ Feel free to add your own page(s) by sending a PR. ★ ★ ★ -★ +★ ★ @@ -254,6 +254,8 @@ Run the test yourself: [Google Lighthouse PageSpeed Insights](https://pagespeed. - [Installing and Deploying](#installing-and-deploying) - [Customizing](#customizing) - [GitHub Copilot Agents](#github-copilot-agents) + - [Customization Agent](#customization-agent) + - [Documentation Agent](#documentation-agent) - [Features](#features) - [Light/Dark Mode](#lightdark-mode) - [CV](#cv) @@ -262,7 +264,7 @@ Run the test yourself: [Google Lighthouse PageSpeed Insights](https://pagespeed. - [Collections](#collections) - [Layouts](#layouts) - [The iconic style of Distill](#the-iconic-style-of-distill) - - [Full support for math & code](#full-support-for-math--code) + - [Full support for math \& code](#full-support-for-math--code) - [Photos, Audio, Video and more](#photos-audio-video-and-more) - [Other features](#other-features) - [GitHub's repositories and user stats](#githubs-repositories-and-user-stats) @@ -277,7 +279,6 @@ Run the test yourself: [Google Lighthouse PageSpeed Insights](https://pagespeed. - [All Contributors](#all-contributors) - [Star History](#star-history) - [License](#license) - ## Getting started diff --git a/_includes/calendar.liquid b/_includes/calendar.liquid new file mode 100644 index 0000000..fab192d --- /dev/null +++ b/_includes/calendar.liquid @@ -0,0 +1,25 @@ +{% if include.calendar_id %} +