Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opeik's dark mode #15

Merged
merged 10 commits into from Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 24 additions & 6 deletions README.md
Expand Up @@ -2,26 +2,37 @@

A clean [Zola](https://getzola.org) theme for blogging and projects, forked from [Anpu](https://github.com/zbrox/anpu-zola-theme).

## Preview

**Demo site**: [https://justintennant.me/papaya/](https://justintennant.me/papaya/)

![index](pics/index.png)
![index light/dark](https://raw.githubusercontent.com/justint/papaya/main/pics/blendedindex.png)

![projects](pics/projects.png)
<p align="center">
<img alt="Light Projects" src="https://raw.githubusercontent.com/justint/papaya/main/pics/projects.png" width="45%">
&nbsp; &nbsp; &nbsp; &nbsp;
<img alt="Dark Projects" src="https://raw.githubusercontent.com/justint/papaya/main/pics/projects_dark.png" width="45%">
</p>

![project](pics/project.png)
<p align="center">
<img alt="Light Project" src="https://raw.githubusercontent.com/justint/papaya/main/pics/project.png" width="45%">
&nbsp; &nbsp; &nbsp; &nbsp;
<img alt="Dark Project" src="https://raw.githubusercontent.com/justint/papaya/main/pics/project_dark.png" width="45%">
</p>

## Features

- Blog posts
- Project pages
- Automatic light/dark mode
- Categories and tags
- Optional multilingual support
- Customizable sections and navigation menu links
- Featured images for posts/pages
- Smart image embedding shortcode (`{{ img() }}`)
- GitHub repository star/fork counts
- [Open Graph Protocol](https://ogp.me/) tags
- Social/contact links
- Social/contact links
- 100% Google Lighthouse score

## Installation
Expand Down Expand Up @@ -75,8 +86,9 @@ A clean [Zola](https://getzola.org) theme for blogging and projects, forked from
Here are the customizable features of Papaya:

- [Project categories](#project-categories)
- [Light/dark mode](#lightdark-mode)
- [Multilingual support](#multilingual-support)
- [Custom sections and navigation menu links](#custom-sections-and-navigation-menu-links)
- [Sections and navigation menu links](#sections-and-navigation-menu-links)
- [Post/project date formats](#postproject-date-formats)
- [Post/project featured images](#postproject-featured-images)
- [Open Graph Protocol locale/profile information](#open-graph-protocol-localeprofile-information)
Expand Down Expand Up @@ -120,6 +132,12 @@ categories = ["software"]

The example project page above would be grouped into & displayed within the "Software" category of your projects page.

### Light/dark mode

The Papaya theme can be set to `"light"`, `"dark"`, or `"auto"` mode in the `config.toml`.

In `"auto"`, the light and dark modes are implicitly chosen by the `prefers-color-scheme` CSS media feature. The theme will switch automatically based on the viewer's OS or user agent setting.

### Multilingual support

Currently Zola has basic internationalization (`i18n`) support, you can read more in [zola's Multilingual Sites doc](https://www.getzola.org/documentation/content/multilingual/).
Expand Down Expand Up @@ -193,7 +211,7 @@ Now you will have a website that supports both English and Chinese! Since `defau

A page (post or project) can be available in both languages or only in one language, and it's not necessary that a page is available in the default language.

### Custom sections and navigation menu links
### Sections and navigation menu links

The navigation menu is constructed from a list of `menu_items` in your `config.toml`. For example:
```toml
Expand Down
9 changes: 8 additions & 1 deletion config.toml
Expand Up @@ -19,7 +19,11 @@ highlight_code = true

# The theme to use for code highlighting.
# See Zola configuration docs for list of allowed values.
highlight_theme = "material-light"
highlight_theme = "css"
highlight_themes_css = [
{ theme = "material-dark", filename = "syntax-theme-dark.css" },
{ theme = "material-light", filename = "syntax-theme-light.css" },
]

[languages]

Expand Down Expand Up @@ -93,6 +97,9 @@ date_format = "%Y 年 %m 月 %d 日"
# Development environment. Used by the page macros to load remote content only when in "prod" mode
env = "ZOLA_ENV"

# Color theme mode. Options: light, dark, auto (automatically switch depending on OS/user agent settings)
color_mode = "auto"

# List of Papaya navigational menu items. Used to construct the navigation bar. See the README for item schema.
menu_items = [
{ name = "projects", url = "$LANG_BASE_URL/projects", show_recent = true, recent_items = 3, recent_trans_key = "recent_projects", more_trans_key = "more_projects" },
Expand Down
Binary file added pics/blendedindex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pics/index_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pics/project_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pics/projects_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.