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 https://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>.html
with 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_name
variable is used bycategory.html
to load posts for the category. Checken/posts/general.html
for thegeneral
category 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.md
like[{%- 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.yml
file with theindex.<category_name>
key, like in_data/posts/t/en/view.yml
. Theindex.<category_name>_posts
key must also be added that is used bycategory.html
. -
Add front matter default values for
category
for the_posts/*/<category_name>
path scope in [_config.yml
] file. This is required because otherwise jekyll will not assign thecategory
automatically to the posts and posts will not be added to thesite.categories
used bycategory.html
and 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_posts
directory in the path (checkpage.categories
variable), 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/posts
in url. We can also addcategory
to 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 thelang
front 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
en
language 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_at
andauthor
key 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_TITLE
orassets/posts/<language>/<category_name>/YYYY-MM-DD-POST_TITLE
directory, likeassets/posts/globals/general/1970-01-01-post-title
orassets/posts/<language>/general/1970-01-01-post-title
and link to them with[Text Asset](/assets/posts/globals/general/1970-01-01-post-title/asset.txt)
or![Image Asset](/assets/posts/globals/general/1970-01-01-post-title/asset.png)
. 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_excerpts
totrue
in_config.yml
and used bycategory.html
. Check jekyll docs for more info. -
Each post of the site must have the
page_ref
key 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_ref
and 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.md
file should havepage_ref: /posts/general/1970/01/01/post-title.html
and so should any of its translations.