Skip to content

Zheng-Bote/gha-gh-pages_minima

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GH-Pages with modified Jeckyll theme Minima

Jeckyll theme Minima with automatic Javascript Breadcrumbs

Report Issue Request Feature

MIT License GitHub Created At


Table of Contents


Description

Jeckyll theme Minima with automatic Javascript Breadcrumbs, Auto-TOC and Auto-Indexing

Features

  • works as designed
  • no bugs
  • Github Action for automated markdown indexing
  • Github Action for automated TOC
  • automated Breadcrumbs in GH-Pages

automated Markdown indexing

GHA .github/workflows/ghp-markdown_index.yml

Create / Update markdown indexes for GH Pages

Github Marketplace Markdown action: create indexes

automated Table of Contents (ToC)

Node GHA .github/workflows/repo-create_doctoc.yml

Create / Update Table of Contents

This is a GitHub Actions to generate TOC (Table of Contents), which executes DocToc and commits if changed.

gha-toc-generator (fork from technote-space)

Jeckyll

Jekyll is a blog-aware, site generator written in Ruby. It takes raw text files, runs it through a renderer and produces a publishable static website. Perfect for Github Pages.

Jeckyll has an extensive theme system that allows you to leverage community-maintained templates and styles to customize your site’s presentation. Jekyll themes specify plugins and package up assets, layouts, includes, and stylesheets in a way that can be overridden by your site’s content.

Jeckyll Minima theme

Minima v3 It's Jekyll's default (and first) theme. It's what you get when you run jekyll new.

automated Breadcrumbs in GH-Pages

easy to use Javascript function, documentation comming soon.

(back to top)

Status

Status GitHub Release Date

GitHub Issues GitHub Pull Requests

Repo - create Repo-Tree in README.md Repo - add Actions In/Out to README Repo - create TOC of README

GHP - create markdown indexes for GH Pages GH-Page

(back to top)

Installation

Tip

see branch gh-pages as well as the content of .github/workflows.

Github repo settings

Create a branch gh-pages

  • via Github UI or
  • command line
git branch gh-pages
git push -all

configure GH-Pages in Settings

  • Source Deploy from a branch
  • Branch gh-pages
  • folder docs

Tip

Content modifications on Branch gh-pages will be automatically deployed from Github to gh-pages. Automatical deployment via Github works only on branch gh-pages

Configuration

Clone the repo and checkout branch gh-pages

git clone git@github.com:Zheng-Bote/gha-gh-pages_minima.git
git checkout gh-pages

Configuration of Jeckyll theme Minima

In branch gh-pages in folder docs configure / customize file _config.yml. For details see Minima v3

GH-Page content (folders and pages)

Create folder structure within folder docs and add one or more markdown files.

Warning

Don't name your markdown files README.md. Filename README.md is reserved for GH-Action automatic markdown indexing

Push your modification in branch gh-pages back to your central Github respository

Note

If your GH-Pages in Settings configured for branch gh-pages, Github will deploy your pages automatically. Otherwise you have to handle your GH-Pages deployment yourself

After content modifications and pushed back to your central GH repo, wait some time so the GH Actions can do their jobs.

Dependencies

automated Markdown indexing

GHA .github/workflows/ghp-markdown_index.yml

Create / Update markdown indexes for GH Pages

Github Marketplace Markdown action: create indexes

automated Table of Contents (ToC)

Node GHA .github/workflows/repo-create_doctoc.yml

Create / Update Table of Contents

This is a GitHub Actions to generate TOC (Table of Contents), which executes DocToc and commits if changed.

gha-toc-generator (fork from technote-space)

Jeckyll

Jekyll is a blog-aware, site generator written in Ruby. It takes raw text files, runs it through a renderer and produces a publishable static website. Perfect for Github Pages.

Jeckyll has an extensive theme system that allows you to leverage community-maintained templates and styles to customize your site’s presentation. Jekyll themes specify plugins and package up assets, layouts, includes, and stylesheets in a way that can be overridden by your site’s content.

Jeckyll Minima theme

Minima v3 It's Jekyll's default (and first) theme. It's what you get when you run jekyll new.

Breadcrumbs in Minima GH-Pages

Note

There is currently (2024-09) a bug in the Minima v3 theme so custom header content is not correctly parsed. See also Minima v3 issues. Due to this bug, the Breadcrumb function is integrated within docs/_includes/header.html

<style>
    ul.breadcrumb {
        padding: 10px 16px;
        list-style: none;
        background-color: #eee;
    }

    ul.breadcrumb li {
        display: inline;
        font-size: 1rem;
    }

    ul.breadcrumb li+li:before {
        padding: 8px;
        color: black;
        content: ">";
    }

    ul.breadcrumb li a {
        color: #0275d8;
        text-decoration: none;
    }

    ul.breadcrumb li a:hover {
        color: #01447e;
        text-decoration: underline;
    }
</style>
<script>
window.onload = start;

function start() {
  const url = window.location;
  const origin = "{{ site.page_url }}/";
  const path = url.pathname;
  let a_arr = path.split("/");
  let html = "false";

  const arr = a_arr.filter(rmEmpty);

  if (path.endsWith(".html")) {
    arr.length = arr.length - 1;
  }

  const bread = document.getElementById("bread");

  bread.innerHTML = `<li><a href="${origin}">Main</a>`;

  if (a_arr.length === 0) {
    return;
  }

  const uri_arr = [];
  for (let i = 1; i < arr.length; i++) {
    uri_arr.push(arr[i]);
    let text = origin;
    text += uri_arr.join("/");

    if (i === arr.length - 1) {
      if (path.endsWith(".html")) {
        bread.innerHTML += `<li><a href="${text}">${arr[i]}</a></li>`;
      } else {
        bread.innerHTML += `<li>${arr[i]}</li>`;
      }
    } else {
      bread.innerHTML += `<li><a href="${text}">${arr[i]}</a></li>`;
    }
  }

  function rmEmpty(item) {
    if (item.length > 0) {
      return item;
    }
  }
}

</script>

folder structure

.
├── .github
│   └── workflows
│       ├── ghp-markdown_index.yml
│       ├── repo-actions_docu.yml
│       ├── repo-create_doctoc.yml
│       └── repo-create_tree_readme.yml
├── README.md
├── docs
│   └── img
│       ├── screenshot_breadcrumbs_1.png
│       ├── screenshot_breadcrumbs_2.png
│       ├── screenshot_deployment.png
│       ├── screenshot_folder-structure.png
│       ├── screenshot_jeckyll_minima.png
│       ├── screenshot_markdown-indexes.png
│       ├── screenshot_minima.png
│       ├── screenshot_settings_pages.png
│       └── screenshot_toc.png
└── tree.bak

4 directories, 15 files

(back to top)

Documentation

flowchart TD
    A[Repo-Settings] --> B[Pages]
    B-->C(Branch)-->D(Folder)
Loading
flowchart TD
    A[Branch 'gh-pages'] --> B(add or modify content)
    B --> C(push to GH Repo)
    C-->D(Deployment)-->E[GH-Pages]
Loading
flowchart TD
    A(push to central GH-Repo) --> B(Workflow 'markdown indexing')
    B --> C(Workflow 'create ToC')
    C-->D(GH Workflow 'pages-build-deployment')-->E[GH-Pages]
Loading

Github Page

GH-Page https://zheng-bote.github.io/gha-gh-pages_minima/

see also: https://www.github.com/Zheng-Bote/gha-gh-pages_minima

(back to top)

Screenshots

Settings - Pages

Jeckyll theme Minima (modified)

Minima Breadcrumbs

Breadcrumbs folder-level

Breadcrumbs page-level

Github Actions / Workflows

(back to top)

Authors and License

License

MIT License

Copyright (c) 2024 Zheng Robert

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    https://choosealicense.com/licenses/mit/

Authors

  • Zheng Robert

Code Contributors

Contributors

Zheng Robert


🖖

(back to top)

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •