diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a490399..172e5e9 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -8,8 +8,11 @@ on: workflow_dispatch: env: + # Build directory where the website will run its build. Use the dot (period) to use current. + builddir: . # Output directory where built files will deploy. This also will be used on Pagefind search generation. outdir: HTML + defaults: run: shell: bash @@ -24,9 +27,9 @@ jobs: - name: Install uses: taiki-e/install-action@zola - name: Install Python Requirements - run: pip install -r requirements.txt + run: pip install pagefind[extended] - name: Build - run: zola build + run: zola -r "${{ env.builddir }}" build # Ignore below name if you do not use pagefind. - name: Generate Pagefind Search run: python -m pagefind --site ${{ env.outdir }} diff --git a/README.md b/README.md index 21ccc69..74437d7 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ git clone https://github.com/harrymkt/zluinav.git ``` Or [download manually](https://github.com/harrymkt/zluinav/archive/refs/heads/main.zip) and paste in the themes directory. -Or, add to the Git submodule +Or, add to the Git submodule (recommended): ```bash git submodule add --name zluinav https://github.com/harrymkt/zluinav.git themes/zluinav git submodule update --remote diff --git a/content/_index.md b/content/_index.md index 56ae83b..4936aaa 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,6 +1,5 @@ +++ 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. diff --git a/content/_index.my.md b/content/_index.my.md index 31e3550..3803b3a 100644 --- a/content/_index.my.md +++ b/content/_index.my.md @@ -1,6 +1,5 @@ +++ title = "အိမ်" -insert_anchor_links = "heading" +++ # UI လမ်းညွှန် UI Navigation (သို့) zluinav ဟုခေါ်သော Zola theme သည် ပုံသဏ္ဍာန်များနှင့် မက်ခရိုများကို အသုံးပြု၍ တတ်နိုင်သမျှ လွယ်ကူအောင် ပြုလုပ်ထားခြင်းထက် အလွယ်တကူ ဖန်တီးထားသည့် Zola အပြင်အဆင်တစ်ခုဖြစ်သည်။ ကျွန်ုပ်သည် မျက်မမြင် developer တစ်ဦးဖြစ်သောကြောင့် အမြင်အာရုံချို့တဲ့သောအသုံးပြုသူများသည် ၎င်းတို့ကိုအသုံးပြုနိုင်စေရန် တတ်နိုင်သမျှ သုံးစွဲနိုင်မှုဖြင့် ဖွံ့ဖြိုးတိုးတက်စေလိုပါသည်။ diff --git a/content/docs/macros/general.md b/content/docs/macros/general.md index 989879e..f3a7b39 100644 --- a/content/docs/macros/general.md +++ b/content/docs/macros/general.md @@ -6,4 +6,6 @@ General macros added in general namespace ## title(titles) Returns the titles, separated by the value set in `config.extra.title_sep`, with the site title appended after it. -- `titles`(array) required: array of titles. \ No newline at end of file +- `titles`(array) required: array of titles. +- `sep`(string) optional: The title's separator. Defaults to what it is set in `title_sep` site extra. Passing this string empty will set back to default. +- `overwrite`(bool) optional: `false` if the site title should be appended after the titles, or `true` otherwise. Defaults to `false`. \ No newline at end of file diff --git a/content/docs/search.md b/content/docs/search.md index c68be61..870f62b 100644 --- a/content/docs/search.md +++ b/content/docs/search.md @@ -12,7 +12,7 @@ See [search configuration](@/docs/extra/config.md#searching) You have a variety of formats to choose for your search. ### main -This format uses the default searching method configured in search according to Zola's documentation. `search.js` in the static folder provides for `elasticlunr`. +This format uses the default searching method configured in search according to Zola's documentation. `search.js` in the static folder provides for `elasticlunr`. The only disadvantage of this search format is that custom languages cannot be used to index. ### pagefind This is the default used in Zluinav's demo and is a third party searching tool, and thus it cannot be used in `zola serve`. Instead, this is best if you run this tool after the build. In short, this tool runs over your HTML files to generate the search, and it only takes up a few seconds. @@ -20,7 +20,7 @@ This is the default used in Zluinav's demo and is a third party searching tool, {% details(summary="Setup Pagefind") %} #### Setup Pagefind Do the following to get up and run Pagefind. We'll asume you have Python installed: -1. Install Pagefind extended version. You can do this by this command up to the root of this repository. `pip install -r requirements.txt` +1. Install Pagefind extended version. You can do this by this command. `pip install -r pagefind[extended]` 2. Set the search format in the `searching` object. 3. Build the site. `zola build` 4. Generate the search index. Make sure to replace outputdir with the directory where your built files live. `python -m pagefind --site outputdir` diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 30cadfc..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pagefind[extended] \ No newline at end of file diff --git a/static/scripts/search.js b/static/scripts/search.js index f8f5766..fb7041b 100644 --- a/static/scripts/search.js +++ b/static/scripts/search.js @@ -143,7 +143,7 @@ function initSearch() { }; var currentTerm = ""; var index; - const base_url = document.querySelector("base").href; + const base_url = document.querySelector("baseurl").href; const lang = document.querySelector("html").lang; const language = (lang ? lang : "en"); const resource_path = new URL(`search_index.${language}.json`, base_url).href; diff --git a/templates/base.html b/templates/base.html index aac8fd1..58c19ae 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,7 +20,7 @@
-