This is the source repository for termux.github.io and its custom domain termux.dev. The [termux.org] is redirected to termux.dev. The termux.com is mirrored from termux/termux.com currently, until it can be redirected to termux.dev.
Install dependencies as explained at Using Jekyll with Pages, then run
bundle exec jekyll serve
to start a local server at http://localhost:4000.
If [_config.yml] file was updated, then stop server with ctrl + c and start it again for changes to take effect.
- Add a new page file for the category at
<language>/posts/<category_name>.htmlwith the following contents, where<language>is language code likeru. Replace<category_name>with the actual name for the category in the file name and front matter. Thecategory_namevariable is used bycategory.htmlto load posts for the category. Checken/posts/general.htmlfor thegeneralcategory as a sample. The front matter title must be language specific.
---
layout: page
title: <category_name> Posts
no_add_title_heading: true
category_name: <category_name>
page_ref: /posts/<category_name>.html
---
{% include posts/category.html %}
-
Add
[{%- include t.html root="posts" key="views.index.<category_name>" -%}](/{{- page.lang -}}/posts/<category_name>.html)link for the category in_layouts/posts/index.mdlike[{%- include t.html root="posts" key="views.index.general" -%}](/{{- page.lang -}}/posts/general.html). The translation for the category must be added to the_data/posts/t/<language>/view.ymlfile with theindex.<category_name>key, like in_data/posts/t/en/view.yml. Theindex.<category_name>_postskey must also be added that is used bycategory.html. -
Add front matter default values for
categoryfor the_posts/*/<category_name>path scope in [_config.yml] file. This is required because otherwise jekyll will not assign thecategoryautomatically to the posts and posts will not be added to thesite.categoriesused bycategory.htmland so posts won't show for the category. Check jekyll docs for more info. If we used the<category_name>/_posts/path for posts, then<category_name>would have been automatically assigned to the post since its exist above the_postsdirectory in the path (checkpage.categoriesvariable), but we can't use that since we need to maintain_posts/<language>directory structure and we don't want language to be added as the category and added after/postsin url. We can also addcategoryto front matter of each post file but that just creates repeatability.
defaults:
-
scope:
path: "_posts/*/<category_name>"
values:
category: <category_name>
- For each new language added for posts, add following to [
_config.yml] file so that proper language based route is assigned to posts and thelangfront matter value is also assigned so that it can be accessed withpage.lang.
-
scope:
path: "_posts/<language>"
values:
lang: <language>
permalink: /<language>/:collection/:categories/:year/:month/:day/:title:output_ext
Check jekyll docs and github docs for details.
- Add the file for the
enlanguage post under the directory for the category at_posts/en/<category_name>/YYYY-MM-DD-POST_TITLE.md. For example, by creating the file_posts/en/general/1970-01-01-post-title.md, jekyll will automatically create a route for the post aten/posts/general/1970/01/01/post-title.html. For translations of posts to other languages thanen, create a file at_posts/<language>/<category_name>/YYYY-MM-DD-POST_TITLE.md, where<language>is language code likeru. The front matter title must be language specific. You can also addlast_modified_atandauthorkey values in the front matter.
---
title: "Post Title"
page_ref: /posts/<category_name>/YYYY/MM/DD/<post_basename>.html
---
Post Content
-
Add any asset files used by the post under the
assets/posts/globals/<category_name>/YYYY-MM-DD-POST_TITLEorassets/posts/<language>/<category_name>/YYYY-MM-DD-POST_TITLEdirectory, likeassets/posts/globals/general/1970-01-01-post-titleorassets/posts/<language>/general/1970-01-01-post-titleand link to them with[Text Asset](/assets/posts/globals/general/1970-01-01-post-title/asset.txt)or. Check jekyll docs for more. -
Ensure that the first paragraph of the post is a just a short description of the post since that text will show in the posts list for the category. This is done by setting
show_excerptstotruein_config.ymland used bycategory.html. Check jekyll docs for more info. -
Each post of the site must have the
page_refkey in its front matter for its unique absolute path on the site (not local path) without the language prefix to find alternate translations of a page. All translations must have the samepage_refand should equal the english file name. This allows alternate translations to have different language specific filenames, but the same reference to allow site language change and search engine indexing via sitemaps.xml to be added later. For example,_posts/en/general/1970-01-01-post-title.mdfile should havepage_ref: /posts/general/1970/01/01/post-title.htmland so should any of its translations.