diff --git a/.gitignore b/.gitignore index 521ff00..135a284 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .DS_Store /public -/static/processed_images +/static/processed_images \ No newline at end of file diff --git a/README.md b/README.md index 4f9973a..3b4400b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ A clean [Zola](https://getzola.org) theme for blogging and projects, forked from - Blog posts - Project pages - Categories and tags +- Multilingual support +- Customizable sections and navigation menu links - Featured images for posts/pages - Smart image embedding shortcode (`{{ img() }}`) - GitHub repository star/fork counts @@ -44,8 +46,9 @@ A clean [Zola](https://getzola.org) theme for blogging and projects, forked from { name = "tags" }, ] ``` + 4. In your `content` directory, add new `blog` and `projects` directories. Copy the `_index.md` file from Papaya's `content/blog` into your `content/blog`, and the `_index.md` and `categories.json` files from Papaya's `content/projects` into your `content/projects`. - + Your `content` directory structure should look like this: ``` content @@ -55,7 +58,7 @@ A clean [Zola](https://getzola.org) theme for blogging and projects, forked from └── _index.md └── categories.json ``` - + 5. _(optional)_ To enable GitHub repository stars/fork counts (disabled by default to avoid hitting API rate limits), set the `$ZOLA_ENV` environment variable to `prod` prior to your `zola serve`/`zola build` execution. For csh/tsch: @@ -72,37 +75,283 @@ A clean [Zola](https://getzola.org) theme for blogging and projects, forked from Here are the customizable features of Papaya: -- Navigation menu links -- Post/project date formats -- Post/project featured images -- Project categories -- Open Graph Protocol locale/profile information -- Social/contact links +- [Project categories](#project-categories) +- [Multilingual support](#multilingual-support) +- [Custom sections and navigation menu links](#custom-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) +- [Social/contact links](#socialcontact-links) -### Navigation menu links +### Project categories -In your `config.toml` under the `[extra]` section you need to set the `papaya_menu_links` list. +In your `content/projects/categories.json`, you can specify the categories of projects. The formatting of the file is: -Example: +```json +{ + "title": "keyword" +} +``` + +- `"title"`: the title text displayed for each category grouping on your projects page. +- `"keyword"`: the taxonomy term you'll use in your project pages. + +A project can have multiple categories, and will be displayed once in each category configured. + +Projects without categories will be displayed in the "Other" category listing of your project page. If you don't want the "Other" category displayed, you can copy the `templates/projects.html` to your own `templates` directory and delete/comment out the "Other" category code. + +Example `categories.json`: + +```json +{ + "Software": "software", + "Films": "film" +} +``` + +Example project page front matter: + +```toml +title = "Example software project" +date = 2021-08-11 + +[taxonomies] +categories = ["software"] +``` + +The example project page above would be grouped into & displayed within the "Software" category of your projects page. + +### Multilingual support + +Currently Zola has a basic internationalization (i18n) support, you can see this at [zola doc](https://www.getzola.org/documentation/content/multilingual/). + +To write a multilingual site, follow the steps below (English and Chinese in this example): + +1. Add a `default_language` configuration and `[languages.zh]` and `[languages.en]` sections to your `config.toml`: + + ```toml + default_language = "en" + + [languages] + + [languages.en] + + [languages.zh] + title = "中文标题" + description = "中文描述" + ``` + + Under the `[languages.zh]` section you can override default configurations like `title`, `description`, etc. + +2. Add translations of all keywords in `[languages.zh.translations]` and `languages.en.translations]` sections (see Papaya's [`config.toml`](config.toml) for a listing of all keywords): + + ```toml + [languages] + + [languages.en] + + [languages.en.translations] + projects = "Projects" + blog = "Blog" + about = "About" + recent_projects = "Recent Projects" + more_projects = "More Projects" + recent_blog_posts = "Recent Blog Posts" + more_blog_posts = "More blog posts" + ... + + [languages.zh] + + [languages.zh.translations] + projects = "项目" + blog = "博文" + about = "关于" + recent_projects = "近期项目" + more_projects = "更多项目" + recent_blog_posts = "近期博文" + more_blog_posts = "更多博文" + ... + ``` + +3. Add a `_index.zh.md` file into every section. + + For example: add `content/blog/_index.zh.md` and `content/projects/_index.zh.md`. + +4. Provide a `{page-name}.zh.md` (or `index.zh.md` into the page's directory, if it has one) for every page you'd like to translate. + + For example: add `content/blog/what-is-zola.zh.md` and `content/blog/blog-with-image/index.zh.md`. + +6. Add a `content/categories.zh.json` file. For example: + + ```json + { + "软件": "software", + "电影": "film" + } + ``` + +Now you will have a website that supports both English and Chinese! Since `default_language` in `config.toml` is set to "en", by visiting `{base_url}` you will see the English version of this blog. You can visit the Chinese version by visiting `{base_url}/zh`. + +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 + +The navigation menu is constructed from a list of `menu_items` in your `config.toml`. For example: +```toml +[extra] + +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" }, + { name = "blog", url = "$LANG_BASE_URL/blog", show_recent = true, recent_items = 3, recent_trans_key = "recent_blog_posts", more_trans_key = "more_blog_posts" }, + { name = "tags", url = "$LANG_BASE_URL/tags" }, + { name = "about", url = "$LANG_BASE_URL/about" }, +] +``` + +A `menu_item` can be one of two things: + +- **a link to a section.** Section links can be optionally configured to display its most recently authored items on your index page. See [Configuring section menu items](#configuring-section-menu-items). + +- **a link to a URL.** See [Configuring URL menu items](#configuring-url-menu-items) + +#### Configuring section menu items + +A section is created whenever a directory (or subdirectory) in the content section contains an `_index.md` file; see the [Zola docs on sections](https://www.getzola.org/documentation/content/section/). + +Papaya has two sections by default: `projects` and `blog`. You can add additional sections or change section names. For example, you can add a section called _Diary_. In order to add this section, you need to: + +1. Create a directory called `diary` in `content/`. + +2. Create an `_index.md` inside `content/diary/`, for example: + + ```toml + +++ + title = "Diary" + render = true + # diary will use blog.html for its template + template = "blog.html" + +++ + ``` + +Sections can be added to the navigation menu, and optionally configured to display its most recently authored items on your index page. To add your section to the navigation menu: + +1. In your `config.toml` under the `[extra]` section, add your section to the `menu_items`: + + ```toml + [extra] + menu_items = [ + ... + { name = "diary", url = "$LANG_BASE_URL/diary" } + ] + ``` + +2. In your `config.toml` under the `[languages..translations]` section, add your section name translation keys: + + ```toml + [languages] + + [languages.en] + + [languages.en.translations] + diary = "Diary" + + [languages.zh] + + [languages.zh.translations] + diary = "日记" + ``` + + This will add a simple hyperlink to your new _Diary_ section in the navigation menu. + +To also display recently authored items from your _Diary_ section on your index page: + +1. Add the following attributes to your menu item: + + - `show_recent`: Adds the section's recent items listing to your index page. + - `recent_items`: Number of recent items to display. + - `recent_trans_key`: Translation key for the recent items listing title text. + - `more_trans_key`: Translation key for the hyperlink text to the section. + + For example: + + ```toml + [extra] + menu_items = [ + ... + { name = "diary", url = "$LANG_BASE_URL/diary", show_recent = true, recent_items = 3, recent_trans_key = "recent_diary", more_trans_key = "more_diary" } + ] + ``` + +2. In your `config.toml` under the `[languages..translations]` section, add your section name, `recent_trans_key`, and `more_trans_key` translation keys: + + ```toml + [languages] + + [languages.en] + + [languages.en.translations] + diary = "Diary" + recent_diary = "Recent Diaries" + more_diary = "More Diaries" + + [languages.zh] + + [languages.zh.translations] + diary = "日记" + recent_diary = "近期日记" + more_diary = "更多日记" + ``` + + This will add both a hyperlink to your new _Diary_ section in the navigation menu, and a listing of the three most recent items from your _Diary_ section on your index page. + +#### Configuring URL menu items + +If you want to add a simple link to the navigation menu, add an item with a `name` and `url`. For example: ```toml [extra] -papaya_menu_links = [ - { url = "$BASE_URL/about/", name = "About" }, +sections = [ + ... + { name = "tag", url = "$LANG_BASE_URL/tags" } ] ``` -If you include `$BASE_URL` in the URL of a link it will be replaced with the base URL of your site. +A translation key for your link's `name` must be added into your `config.toml`: + +```toml +[languages] + +[languages.en] + +[languages.en.translations] +tag = "Tag" + +[languages.zh] + +[langauges.zh.translations] +tag = "标签" +``` + +If you include `$BASE_URL` in the URL of a link it will be replaced with the base URL of your site, and `$LANG_BASE_URL` will be replaced with the language-specific base URL of your site. ### Post/project date formats -In your `config.toml` under the `[extra]` section you need to set the `papaya_date_format` value. +You can have different date formats in different languages. You need to set the `date_format` value in every langauge's translation section. Example: ```toml -[extra] -papaya_date_format = "%e %B %Y" +[languages] + +[languages.en] + +[languages.en.translations] +date_format = "%e %B %Y" + +[languages.zh] + +[languages.zh.translations] +date_format = "%Y 年 %m 月 %d 日" ``` The formatting uses the standard `date` filter in Tera. The date format options you can use are listed in the [chrono crate documentation](https://tera.netlify.app/docs/#date). @@ -130,44 +379,6 @@ featured_image_extended = true ![Featured image, extended](pics/featured_image_extended.png) - -### Project categories - -In your `content/projects/categories.json`, you can specify the categories of projects. The formatting of the file is: - -```json -{ - "title": "keyword" -} -``` - -- `"title"`: the title text displayed for each category grouping on your projects page. -- `"keyword"`: the taxonomy term you'll use in your project pages. - -A project can have multiple categories, and will be displayed once in each category configured. - -Projects without categories will be displayed in the "Other" category listing of your project page. If you don't want the "Other" category displayed, you can copy the `templates/projects.html` to your own `templates` directory and delete/comment out the "Other" category code. - -Example `categories.json`: - -```json -{ - "Software": "software", - "Films": "film" -} -``` - -Example project page front matter: -```toml -title = "Example software project" -date = 2021-08-11 - -[taxonomies] -categories = ["software"] -``` - -The example project page above would be grouped into & displayed within the "Software" category of your projects page. - ### Open Graph Protocol locale/profile information In your `config.toml` you can add a `[extra.ogp]` section to specify your Open Graph Protocol locale and profile information. @@ -198,6 +409,27 @@ Example: email = "papaya@tiliqua.sp" github = "papaya" linkedin = "papayatiliqua" +twitter = "papayathehisser" +``` + +If you want to include other custom social websites, you can add them to `other`: + +Example: + +```toml +[extra.social] +other = [ + { name = "BTC", font_awesome = "fa-brands fa-btc", url = "https://www.bitcoin.com/" } +] +``` + +The `font_awesome` attribute specifies the Font Awesome classes; you can find them in [Font Awesome](https://fontawesome.com/). Be aware that different versions of Font Awesome may include different sets of icons; you can change your version of Font Awesome by updating the CDN path in the `[extra.cdn]` section: + +```toml +[extra] + +[extra.cdn] +font_awesome = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" ``` ## Image embedding shortcode @@ -208,9 +440,14 @@ Included with Papaya is a shortcode for embedding images into your posts: img(path, alt, caption, class, extended_width_pct, quality) ``` +You can use `./` to specify the relative path of image which is relative to current markdown file. + ### Arguments -- `path`: The path to the image relative to the `content` directory in the [directory structure](https://www.getzola.org/documentation/getting-started/directory-structure/). +- `path`: The path to the image. It can be either: + - a full path (eg: `https://somesite.com/my-image.jpg`), + - relative to the `content` directory in the [directory structure](https://www.getzola.org/documentation/getting-started/directory-structure/) (eg: `@/projects/project-1/my-image.jpg`), or + - relative to the current markdown file (eg: `./my-image.jpg`). - `alt`: _(optional)_ The alternate text for the image. - `caption`: _(optional)_ A caption for the image. Text/HTML/Tera templates supported. - `class`: _(optional)_ Any CSS classes to assign to the image. Multiple classes should be separated with a space (`" "`). diff --git a/config.toml b/config.toml index 6d4ef68..e19abbc 100644 --- a/config.toml +++ b/config.toml @@ -1,37 +1,104 @@ # The URL the site will be built for base_url = "https://justintennant.me/papaya" +title = "Papaya" +description = "A clean Zola theme for blogging and projects" +default_language = "en" + # Whether to automatically compile all Sass files in the sass directory compile_sass = true -# Whether to do syntax highlighting -# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +# When set to "true", a search index is built from the pages and section +# content for `default_language`. +build_search_index = false + +# When set to "true", a feed is automatically generated. +generate_feed = true + +# The taxonomies to be rendered for the site and their configuration of the default languages +taxonomies = [ + { name = "tags", rss = true }, + { name = "categories", rss = true }, +] + +[markdown] +# When set to "true", all code blocks are highlighted. highlight_code = true -# Whether to build a search index to be used later on by a JavaScript library -build_search_index = false +# The theme to use for code highlighting. +# See Zola configuration docs for list of allowed values. +highlight_theme = "material-light" +[languages] + +[languages.en] title = "Papaya" description = "A clean Zola theme for blogging and projects" -generate_feed = true +[languages.en.translations] +projects = "Projects" +blog = "Blog" +about = "About" +recent_projects = "Recent Projects" +more_projects = "More Projects" +recent_blog_posts = "Recent Blog Posts" +more_blog_posts = "More blog posts" +tag = "Tag" +tags = "Tags" +to_all_tags = "To all tags" +category = "Category" +categories = "Categories" +to_all_categories = "To all categories" +view_by = "View by" +other = "Other" +minute = "min" +prev_page = "To newer posts" +next_page = "To older posts" +# Customize your post date format. See: https://tera.netlify.app/docs/#date +date_format = "%B %e, %Y" + +[languages.zh] +title = "帕帕雅" +description = "一个清新的 Zola 博客与项目模板" +base_url = "https://justintennant.me/papaya/zh" taxonomies = [ - {name = "tags", rss = true}, - {name = "categories", rss = true}, + { name = "tags", rss = true }, + { name = "categories", rss = true }, ] +[languages.zh.translations] +projects = "项目" +blog = "博文" +about = "关于" +recent_projects = "近期项目" +more_projects = "更多项目" +recent_blog_posts = "近期博文" +more_blog_posts = "更多博文" +tag = "标签" +tags = "所有标签" +to_all_tags = "所有标签" +category = "类别" +categories = "所有类别" +to_all_categories = "所有类别" +view_by = "查看方式" +other = "其他" +minute = "分钟" +prev_page = "上一页" +next_page = "下一页" +# Customize your post date format. See: https://tera.netlify.app/docs/#date +date_format = "%Y 年 %m 月 %d 日" + [extra] # Development environment. Used by the page macros to load remote content only when in "prod" mode env = "ZOLA_ENV" -# Customize your post date format. See: https://tera.netlify.app/docs/#date -papaya_date_format="%B %e, %Y" - -# Top navigation menu links -papaya_menu_links = [ - { url = "$BASE_URL/projects/", name = "Projects" }, - { url = "$BASE_URL/blog/", name = "Blog" }, - { url = "$BASE_URL/about/", name = "About" } +# 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" }, + { name = "blog", url = "$LANG_BASE_URL/blog", show_recent = true, recent_items = 3, recent_trans_key = "recent_blog_posts", more_trans_key = "more_blog_posts" }, + # tag is not a zola section, it's just a link. + { name = "tags", url = "$LANG_BASE_URL/tags" }, + { name = "about", url = "$LANG_BASE_URL/about", show_recent = false }, ] [extra.images] @@ -49,3 +116,16 @@ username = "tiliquasp" # Footer social links; full options listed in macros/social.html [extra.social] email = "papaya@tiliqua.sp" +github = "papaya" +linkedin = "papayatiliqua" +twitter = "your-user-name" +zhihu = "your-user-name" +weibo = "your-user-name" +bilibili = "your-user-name" +other = [ + { name = "BTC", font_awesome = "fa-brands fa-btc", url = "https://www.bitcoin.com/" } +] + +# CDN links +[extra.cdn] +font_awesome = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" diff --git a/content/about/index.md b/content/about/index.md new file mode 100644 index 0000000..6874b90 --- /dev/null +++ b/content/about/index.md @@ -0,0 +1,11 @@ ++++ +title = "About" +render = true +template = "about.html" ++++ + +{{ img(path="@/about/me.jpg", class="bordered", alt="It's me!", caption="It's me!") }} + +  + +Hello, World! \ No newline at end of file diff --git a/content/about/index.zh.md b/content/about/index.zh.md new file mode 100644 index 0000000..3db3101 --- /dev/null +++ b/content/about/index.zh.md @@ -0,0 +1,10 @@ ++++ +title = "关于" +template = "about.html" ++++ + +{{ img(path="@/about/me.jpg", class="bordered", alt="这是我!", caption="这是我!") }} + +  + +你好,世界! \ No newline at end of file diff --git a/content/pages/about/me.jpg b/content/about/me.jpg similarity index 100% rename from content/pages/about/me.jpg rename to content/about/me.jpg diff --git a/content/blog/_index.zh.md b/content/blog/_index.zh.md new file mode 100644 index 0000000..0b9042f --- /dev/null +++ b/content/blog/_index.zh.md @@ -0,0 +1,10 @@ ++++ +title = "博客" + +sort_by = "date" +paginate_by = 10 +render = true +template = "blog.html" + +insert_anchor_links = "right" ++++ diff --git a/content/blog/another-post.md b/content/blog/another-post.md index eedd21f..78d42cf 100644 --- a/content/blog/another-post.md +++ b/content/blog/another-post.md @@ -1,6 +1,6 @@ +++ title = "More on Skinks" -date = 2020-01-06 +date = 2021-10-02 [taxonomies] tags = ["other"] diff --git a/content/blog/blog-with-image/image.jpg b/content/blog/blog-with-image/image.jpg new file mode 100644 index 0000000..7b9e98d Binary files /dev/null and b/content/blog/blog-with-image/image.jpg differ diff --git a/content/blog/blog-with-image/index.md b/content/blog/blog-with-image/index.md new file mode 100644 index 0000000..d717d50 --- /dev/null +++ b/content/blog/blog-with-image/index.md @@ -0,0 +1,13 @@ ++++ +title = "Relative Path of Image" +date = 2021-10-01 + +[taxonomies] +tags = ["other"] ++++ + +Use `img()` to specify the relative path of image. + + + +{{ img(path="./image.jpg", alt="") }} \ No newline at end of file diff --git a/content/blog/blog-with-image/index.zh.md b/content/blog/blog-with-image/index.zh.md new file mode 100644 index 0000000..d2dbfe0 --- /dev/null +++ b/content/blog/blog-with-image/index.zh.md @@ -0,0 +1,13 @@ ++++ +title = "图片相对路径" +date = 2021-10-01 + +[taxonomies] +tags = ["other"] ++++ + +使用 `img()` 指定相对路径 + + + +{{ img(path="./image.jpg", alt="") }} \ No newline at end of file diff --git a/content/blog/what-is-zola.md b/content/blog/what-is-zola.md index df360c3..d3935fe 100644 --- a/content/blog/what-is-zola.md +++ b/content/blog/what-is-zola.md @@ -1,6 +1,6 @@ +++ title = "What is Zola" -date = 2019-01-06 +date = 2021-10-03 [taxonomies] tags = ["rust", "other"] @@ -40,7 +40,7 @@ Tables aren't part of the core Markdown spec, but Zola supports them out-of-the- Bob | 27 Alice | 23 -## Inline Markdown within tables +### Inline Markdown within tables | Inline    | Markdown    | In    | Table | | ---------- | --------- | ----------------- | ---------- | diff --git a/content/blog/what-is-zola.zh.md b/content/blog/what-is-zola.zh.md new file mode 100644 index 0000000..adef2e5 --- /dev/null +++ b/content/blog/what-is-zola.zh.md @@ -0,0 +1,103 @@ ++++ +title = "什么是 Zola" +date = 2021-10-03 + +[taxonomies] +tags = ["rust", "other"] ++++ + +Zola 是一个 Rust 编写的静态博客框架。 + + + +# 一级标题 + +## 二级标题 + +### 三级标题 + +#### 四级标题 + +##### 五级标题 + +###### 六级标题 + +轻轻地我走了,正如我轻轻地来;我轻轻地招手,作别西天的云彩。 + +那河畔的金柳,是夕阳中的新娘;波光里的艳影,在我的心头荡漾。 + +软泥上的青荇,油油的在水底招摇;在康河的柔波里,我甘心做一条水草。 + +那榆荫下的一潭,不是清泉,是天上的虹,揉碎在浮藻间,沉淀着彩虹似的梦。 + +寻梦?撑一支长篙,向青草更青处漫溯,满载一船星辉,在星辉斑斓里放歌。 + +但我不能放歌,悄悄是别离的笙箫;夏虫也为我沉默,沉默是今晚的康桥! + +悄悄的我走了,正如我悄悄的来,我挥一挥衣袖,不带走一片云彩。 + +## 引用 + +> 轻轻地我走了,正如我轻轻地来;我轻轻地招手,作别西天的云彩。 + +## 表格 + +表格并不属于 Markdown 核心规范,但是 Zola 提供了对表格的支持。 + + 姓名 | 年龄 +-------|------ + 张三 | 27 + 李四 | 23 + +### 表格中的行内 Markdown + +| 表格    | 可以使用    | 行内    | Markdown | +| ---------- | --------- | ----------------- | ---------- | +| *斜体* | **粗体** | ~~删除~~    | `代码` | + +## 代码块 + +#### 使用三个反引号\`表示代码块 + +```python +prices = {'apple': 0.40, 'banana': 0.50} +my_purchase = { + 'apple': 1, + 'banana': 6 +} +grocery_bill = sum(prices[fruit] * my_purchase[fruit] + for fruit in my_purchase) +print('I owe the grocer $%.2f' % grocery_bill) +``` + +## 列表 + +#### 有序列表 + +1. 第一项 +2. 第二项 +3. 第三项 + +#### 无序列表 + +* 某一项 +* 另一项 +* 其他项 + +#### 多级列表 + +* 第一级 + 1. 第二级 + 2. 还是第二级 + +## 其他元素:缩写、上下标、键位、突出 + +GIF 是一个位图格式。 + +H2O + +Xn + Yn = Zn + +按下 CTRL+ALT+Delete 来结束会话。 + +蜥蜴外表有保护色(伪装),使得它们可以很容易地在栖息地中隐藏。 \ No newline at end of file diff --git "a/content/blog/\345\206\215\345\210\253\345\272\267\346\241\245.zh.md" "b/content/blog/\345\206\215\345\210\253\345\272\267\346\241\245.zh.md" new file mode 100644 index 0000000..f29feb6 --- /dev/null +++ "b/content/blog/\345\206\215\345\210\253\345\272\267\346\241\245.zh.md" @@ -0,0 +1,46 @@ ++++ +title = "再别康桥" +date = 2021-10-02 + +[taxonomies] +tags = ["poem"] ++++ + +轻轻地我走了,正如我轻轻地来;我轻轻地招手,作别西天的云彩。 + + + +> 轻轻地我走了,
+> 正如我轻轻地来;
+> 我轻轻地招手,
+> 作别西天的云彩。
+>
+> 那河畔的金柳,
+> 是夕阳中的新娘;
+> 波光里的艳影,
+> 在我的心头荡漾。
+>
+> 软泥上的青荇,
+> 油油的在水底招摇;
+> 在康河的柔波里,
+> 我甘心做一条水草。
+>
+> 那榆荫下的一潭,
+> 不是清泉,是天上的虹,
+> 揉碎在浮藻间,
+> 沉淀着彩虹似的梦。
+>
+> 寻梦?撑一支长篙,
+> 向青草更青处漫溯,
+> 满载一船星辉,
+> 在星辉斑斓里放歌。
+>
+> 但我不能放歌,
+> 悄悄是别离的笙箫;
+> 夏虫也为我沉默,
+> 沉默是今晚的康桥!
+>
+> 悄悄的我走了,
+> 正如我悄悄的来,
+> 我挥一挥衣袖,
+> 不带走一片云彩。 \ No newline at end of file diff --git a/content/pages/_index.md b/content/pages/_index.md deleted file mode 100644 index a8102f1..0000000 --- a/content/pages/_index.md +++ /dev/null @@ -1,3 +0,0 @@ -+++ -render = false -+++ \ No newline at end of file diff --git a/content/pages/about/index.md b/content/pages/about/index.md deleted file mode 100644 index c1a7a13..0000000 --- a/content/pages/about/index.md +++ /dev/null @@ -1,11 +0,0 @@ -+++ -title = "About" -path = "about" -template = "about.html" -+++ - -{{ img(path="@/pages/about/me.jpg", class="bordered", alt="It's me!", caption="It's me!") }} - -  - -Hello, World! \ No newline at end of file diff --git a/content/projects/_index.zh.md b/content/projects/_index.zh.md new file mode 100644 index 0000000..7add44a --- /dev/null +++ b/content/projects/_index.zh.md @@ -0,0 +1,4 @@ ++++ +render = true +template = "projects.html" ++++ \ No newline at end of file diff --git a/content/projects/categories.zh.json b/content/projects/categories.zh.json new file mode 100644 index 0000000..0cd6d29 --- /dev/null +++ b/content/projects/categories.zh.json @@ -0,0 +1,4 @@ +{ + "软件": "software", + "电影": "film" +} \ No newline at end of file diff --git a/content/projects/project-1/index.zh.md b/content/projects/project-1/index.zh.md new file mode 100644 index 0000000..2bc2844 --- /dev/null +++ b/content/projects/project-1/index.zh.md @@ -0,0 +1,28 @@ ++++ +title = "软件示例" +date = 2021-08-11 + +[taxonomies] +categories = ["software"] + +[extra] +repo_path = "justint/papaya" ++++ + +这是我写的第一个软件! + + + +轻轻地我走了,正如我轻轻地来;我轻轻地招手,作别西天的云彩。 + +那河畔的金柳,是夕阳中的新娘;波光里的艳影,在我的心头荡漾。 + +软泥上的青荇,油油的在水底招摇;在康河的柔波里,我甘心做一条水草。 + +那榆荫下的一潭,不是清泉,是天上的虹,揉碎在浮藻间,沉淀着彩虹似的梦。 + +寻梦?撑一支长篙,向青草更青处漫溯,满载一船星辉,在星辉斑斓里放歌。 + +但我不能放歌,悄悄是别离的笙箫;夏虫也为我沉默,沉默是今晚的康桥! + +悄悄的我走了,正如我悄悄的来,我挥一挥衣袖,不带走一片云彩。 \ No newline at end of file diff --git a/sass/main.scss b/sass/main.scss index 3871296..f34e58e 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -62,6 +62,7 @@ main { justify-content: space-between; } .index-listing { + min-width: 48%; max-width: 48%; flex-grow: 1; } @@ -312,7 +313,7 @@ article header h1 { li { display: inline; - margin-right: 1em; + margin-right: 0.2em; } li:last-of-type { margin-right: 0; @@ -327,7 +328,7 @@ article header h1 { li { display: inline; - margin-right: 1em; + margin-right: 0.2em; } } diff --git a/templates/about.html b/templates/about.html index 0ec46f4..c7429d0 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,10 +1,10 @@ {% import "macros/page.html" as page_macros %} {% extends "base.html" %} -{% block title %}About {{config.extra.ogp.first_name}} {{config.extra.ogp.last_name}}{% endblock title %} +{% block title %}{{ trans(key="about", lang=lang) }} {{config.extra.ogp.first_name}} {{config.extra.ogp.last_name}}{% endblock title %} {% block ogp_head %} - + diff --git a/templates/base.html b/templates/base.html index 7e56ec0..ada982d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -13,8 +13,8 @@ - - + + {% if config.generate_feed %} @@ -31,16 +31,17 @@
{% block header %} + {% set base_url = get_url(path="", lang=lang) %}

- {{ config.title }} + {{ config.title }}