Skip to content

Commit

Permalink
Anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
harrymkt committed Dec 21, 2024
1 parent 6eaa4d0 commit 951ed35
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 42 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Website
name: Deploy
on:
push:
paths: ["content/**", "static/**", "langs/**", "templates/**", "config.toml"]
Expand All @@ -21,16 +21,16 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Zola
- name: Install
uses: taiki-e/install-action@zola
- name: Install Python Requirements
run: pip install -r requirements.txt
- name: Build the site
- name: Build
run: zola build
# Ignore below name if you do not use pagefind.
- name: Generate Pagefind Search
run: python -m pagefind --site ${{ env.outdir }}
- name: Deploy to GitHub Pages
- name: Deploy Site
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This theme is distributed under the terms of the [MIT License](https://github.co
- Copy code blocks; add code blocks which can then be copied using buttons and display the code language if available, helped by JavaScript.
- Variables; add [variables](https://harrymkt.github.io/zluinav/docs/writing) to your page content to be replaced during the site generate.
- Local date display; display dates in user's local timezone, no madder what timezone the date is set.
- Use extensive [macros](https://harrymkt.github.io/zluinav/docs#macros) and [shortcodes](https://harrymkt.github.io/zluinav/docs#shortcodes) to make your content length shorten.
- Use extensive macros and shortcodes to make your content length shorten.
- Comprehensive documentation; Zluinav provides a full Comprehensive documentation including possible templates, shortcodes, blocks, configurable parameters, and more, everything as it updates.

## Installation
Expand Down
1 change: 1 addition & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = "Home"
insert_anchor_links = "heading"
+++
# UI Navigation
UI Navigation, or known as zluinav, is a Zola theme designed for accessibility rather than visual and made as easy as possible using templates and macros. Since I am a blind developer, I'd like to develop with accessibility as possible so visually impaired users can use them.
Expand Down
1 change: 1 addition & 0 deletions content/_index.my.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = "အိမ်"
insert_anchor_links = "heading"
+++
# UI လမ်းညွှန်
UI Navigation (သို့) zluinav ဟုခေါ်သော Zola theme သည် ပုံသဏ္ဍာန်များနှင့် မက်ခရိုများကို အသုံးပြု၍ တတ်နိုင်သမျှ လွယ်ကူအောင် ပြုလုပ်ထားခြင်းထက် အလွယ်တကူ ဖန်တီးထားသည့် Zola အပြင်အဆင်တစ်ခုဖြစ်သည်။ ကျွန်ုပ်သည် မျက်မမြင် developer တစ်ဦးဖြစ်သောကြောင့် အမြင်အာရုံချို့တဲ့သောအသုံးပြုသူများသည် ၎င်းတို့ကိုအသုံးပြုနိုင်စေရန် တတ်နိုင်သမျှ သုံးစွဲနိုင်မှုဖြင့် ဖွံ့ဖြိုးတိုးတက်စေလိုပါသည်။
Expand Down
1 change: 1 addition & 0 deletions content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title = "Documentation"
template = "doc.html"
page_template = "docpage.html"
sort_by = "weight"
insert_anchor_links = "heading"
+++
# %title%
Please note that these documentations are not localized in every language.
1 change: 1 addition & 0 deletions content/docs/extra/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ title = "Extra Variables"
render = false
sort_by = "title"
weight = 50
insert_anchor_links = "heading"
+++
1 change: 1 addition & 0 deletions content/docs/macros/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title = "Macros"
render = false
sort_by = "title"
weight = 60
insert_anchor_links = "heading"
+++
This is a list of available macros that are located in templates/mcs directory.
1 change: 1 addition & 0 deletions content/docs/shortcodes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title = "Shortcodes"
render = false
sort_by = "title"
weight = 100
insert_anchor_links = "heading"
+++
This is a list of available shortcodes that are located in shortcodes directory that can be used in your markdown files to obtain information.
10 changes: 5 additions & 5 deletions langs/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ acc_skip_footer = "Skip to footer"
main_menu = "Main menu"
author = "Author"
authors = "authors"
updated = "Updated on: $date$"
lastmod = "Last modified: $l$"
readtime = "Reading time: $r$"
published = "Published on: $date$"
wordcount = "Total words: $count$"
updated = "Updated on: %date%"
lastmod = "Last modified: %l% ago"
readtime = "Reading time: %r%"
published = "Published on: %date%"
wordcount = "Total words: %count%"
pagination_title = "Pagination"
pagination_first = "First page"
pagination_previous = "Previous page"
Expand Down
10 changes: 5 additions & 5 deletions langs/my.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ acc_skip_footer = "အောက်ခြေမှတ်စုသို့ ကျ
main_menu = "ပင်မမီနူး"
author = "စာရေးသူ"
authors = "စာရေးဆရာများ"
updated = "အပ်ဒိတ်ရက်စွဲ: $date$"
lastmod = "နောက်ဆုံးမွမ်းမံထားသည်: $l$"
readtime = "စာဖတ်ချိန်: $r$"
published = "ထုတ်ပြန်သည့်ရက်စွဲ: $date$"
wordcount = "စုစုပေါင်းစကားလုံးများ: $count$"
updated = "အပ်ဒိတ်ရက်စွဲ: %date%"
lastmod = "နောက်ဆုံးမွမ်းမံခဲ့သည်: လွန်ခဲ့သော %l%"
readtime = "စာဖတ်ချိန်: %r%"
published = "ထုတ်ပြန်သည့်ရက်စွဲ: %date%"
wordcount = "စုစုပေါင်းစကားလုံးများ: %count%"
pagination_title = "Pagination"
pagination_first = "ပထမစာမျက်နှာ"
pagination_previous = "ယခင်စာမျက်နှာ"
Expand Down
1 change: 1 addition & 0 deletions templates/anchor-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a class="zola-anchor" href="#{{ id }}"></a>
8 changes: 4 additions & 4 deletions templates/blogpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{%- endblock title %}
{%- block content %}
<h1>{{page.title}}</h1>
{%- if page.updated %}<p>{{ tran::get(tr = tr, key = "updated", def = "Updated on: $date$") | replace(from = "$date$", to = "<script>document.write(local_datetime_string('" ~ page.updated ~ "'));</script>") | safe }}</p>{% endif %}
{%- if page.updated %}<p>{{ tran::get(tr = tr, key = "updated", def = "Updated on: %date%") | replace(from = "%date%", to = "<script>document.write(local_datetime_string('" ~ page.updated ~ "'));</script>") | safe }}</p>{% endif %}
{{ postmc::show_post_authors(post=page, tr=tr) }}
{{- tmn::show(kind="categories", ctx=ctx) }}
<p>{{tran::get(tr=tr, key="published", def="Published on: $date$")|replace(from="$date$", to="<script>document.write(local_datetime_string('"~page.date~"'));</script>")|safe}}</p>
<p>{{tran::get(tr=tr, key="wordcount", def="Total words: $count$") | replace(from="$count$", to=page.word_count|as_str)}}</p>
<p>{{tran::get(tr=tr, key="readtime", def="Reading time: $r$")|replace(from="$r$", to=page.reading_time~"minute")}}</p>
<p>{{tran::get(tr=tr, key="published", def="Published on: %date%")|replace(from="%date%", to="<script>document.write(local_datetime_string('"~page.date~"'));</script>")|safe}}</p>
<p>{{tran::get(tr=tr, key="wordcount", def="Total words: %count%") | replace(from="%count%", to=page.word_count|as_str)}}</p>
<p>{{tran::get(tr=tr, key="readtime", def="Reading time: %r%")|replace(from="%r%", to=page.reading_time~"minute")}}</p>
<br>
{{ content::process(page=page) | safe }}

Expand Down
27 changes: 6 additions & 21 deletions templates/language_changer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,14 @@
{%- block title %}
{{- page.title}}{{config.extra.title_sep}}{{super() }}
{%- endblock title %}
{%- block footer %}
{{- super() }}
<script>
function goToLanguage() {
var selectedLanguage = document.getElementById("language").value;
if (selectedLanguage) {
window.location.href = selectedLanguage;
}
}
</script>
{%- endblock footer %}
{%- block content %}
<h1>Select Your Language</h1>
<form onsubmit="goToLanguage(); return false;">
<label for="language">Choose a language</label>
<select id="language" name="language">
<option value="">--Select--</option>
<option value="{{get_url(path="", lang=config.default_language)}}">{{tran::get(tr=tr, key="name")}}</option>
<nav aria-label="Language Selector">
<ul style="list-style-type: none;">
<li><a href="{{get_url(path="", lang=config.default_language)}}">{{tran::get(tr=tr, key="name")}}</a></li>
{%- for lname, language in config.languages %}
<option value="{{get_url(path = "", lang = lname)}}">{{tran::get(language=lname, key="name")}}</option>
<li><a href="{{get_url(path = "", lang = lname)}}">{{tran::get(language=lname, key="name")}}</a></li>
{%- endfor %}
</select>
<br><br>
<input type="submit" value="Change">
</form>
</ul>
</nav>
{%- endblock content %}
4 changes: 2 additions & 2 deletions templates/mcs/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<h{{hlevel}}><a href="{{post.permalink | safe}}">{{post.title}}</a>{%if not postdesc==""%}{{postdesc}}{%endif%}</h{{hlevel}}>
{{ self::show_post_authors(post=post, tr=tr) }}
{%- if post.updated-%}{%-set updated=post.updated-%}{%-else-%}{%-set updated=post.date-%}{%-endif %}
<p>{{tran::get(tr=tr, key="lastmod", def="Last modified: $l$")|replace(from="$l$", to="<script>document.write(ts_to_readable_time(get_timestamp('"~updated~"'), false, ' ago', false));</script>")|safe}}</p>
<p>{{tran::get(tr=tr, key="published", def="Published on: $date$")|replace(from="$date$", to="<script>document.write(local_datetime_string('"~post.date~"'));</script>")|safe}}</p>
<p>{{tran::get(tr=tr, key="lastmod", def="Last modified: %l%")|replace(from="%l%", to="<script>document.write(ts_to_readable_time(get_timestamp('"~updated~"'), false, '', false));</script>")|safe}}</p>
<p>{{tran::get(tr=tr, key="published", def="Published on: %date%")|replace(from="%date%", to="<script>document.write(local_datetime_string('"~post.date~"'));</script>")|safe}}</p>
{%- if post.summary %}
{{- post.summary | safe}}
{%- endif %}
Expand Down

0 comments on commit 951ed35

Please sign in to comment.