diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 948bad2e..beaeedba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,14 +3,29 @@ on: push: branches: - main +permissions: + contents: write jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + - uses: actions/setup-python@v4 with: python-version: 3.x - - run: pip install mkdocs-material - - run: pip install mkdocs-awesome-pages-plugin - - run: mkdocs gh-deploy --force + + - id: date + run: echo "::set-output name=week::$(date --utc '+%V')" + + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ steps.date.outputs.week }} + path: .cache + restore-keys: | + mkdocs-material- + + - run: pip install -r requirements.txt + - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 00000000..88c3d777 Binary files /dev/null and b/docs/.DS_Store differ diff --git a/docs/assets/css/extra.css b/docs/assets/css/extra.css new file mode 100644 index 00000000..ebe60207 --- /dev/null +++ b/docs/assets/css/extra.css @@ -0,0 +1,271 @@ +@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&display=swap"); +@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap"); + +:root { + --md-text-font: "Inter Tight", sans-serif; + --md-code-font: "Roboto Mono", monospace; + --md-typeset: { + font-size: 16px; + line-height: 1.5; + } +} + +.md-grid { + max-width: 1500px; +} + +[data-md-color-scheme="slate"] { + --md-default-bg-color: hsla(var(--md-hue), 15%, 10%, 1); +} + +.md-main__inner { + margin-top: 0; +} + +.md-sidebar__inner { + padding-right: calc(100% - 8.5rem); +} + +.md-typeset h1 { + font-weight: 700; + font-size: 1.6rem; + line-height: 1.5; + color: var(--md-text-font); + margin-bottom: 0.5rem; +} + +.md-typeset h2 { + font-weight: 700; + font-size: 1.2rem; + line-height: 1.4; + color: var(--md-text-font); + margin-top: 1.5rem; + border-bottom: 0.01rem solid rgba(148, 148, 148, 0.218); + padding-bottom: 0.01rem; + margin-bottom: 0.9rem; +} + +.md-typeset h3 { + font-weight: 700; + font-size: 0.9rem; + line-height: 1.3; + font-family: var(--md-text-font); +} + +.md-typeset h4 { + font-weight: 600; + font-size: 0.8rem; + line-height: 1.3; + color: var(--md-divider-color); + margin: 1rem 0; +} + +.md-typeset .grid { + grid-gap: 0.4rem; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); + margin: 1em 0; +} + +.md-typeset .grid.cards > ol, +.md-typeset .grid.cards > ul { + display: contents; +} + +.md-typeset .grid.cards > ol > li, +.md-typeset .grid.cards > ul > li, +.md-typeset .grid > .card { + border: 0.01rem solid var(--md-default-fg-color--lightest); + border-radius: 0.2rem; + display: block; + margin: 0; + padding: 0.8rem; + transition: border 0.25s, box-shadow 0.25s; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.125); +} + +.md-typeset .grid.cards > ol > li:focus-within, +.md-typeset .grid.cards > ol > li:hover, +.md-typeset .grid.cards > ul > li:focus-within, +.md-typeset .grid.cards > ul > li:hover, +.md-typeset .grid > .card:focus-within, +.md-typeset .grid > .card:hover { + border-color: var(--md-shadow-z2); + box-shadow: var(--md-shadow-z2); +} + +.md-typeset .grid.cards > ol > li > hr, +.md-typeset .grid.cards > ul > li > hr, +.md-typeset .grid > .card > hr { + margin-bottom: 1em; + margin-top: 1em; +} + +.md-typeset .grid.cards > ol > li > :first-child, +.md-typeset .grid.cards > ul > li > :first-child, +.md-typeset .grid > .card > :first-child { + margin-top: 0; +} + +.md-typeset .grid.cards > ol > li > :last-child, +.md-typeset .grid.cards > ul > li > :last-child, +.md-typeset .grid > .card > :last-child { + margin-bottom: 0; +} + +.md-typeset .grid > *, +.md-typeset .grid > .admonition, +.md-typeset .grid > .highlight > *, +.md-typeset .grid > .highlighttable, +.md-typeset .grid > .md-typeset details, +.md-typeset .grid > details, +.md-typeset .grid > pre { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > .highlight > pre:only-child, +.md-typeset .grid > .highlight > pre > code, +.md-typeset .grid > .highlighttable, +.md-typeset .grid > .highlighttable > tbody, +.md-typeset .grid > .highlighttable > tbody > tr, +.md-typeset .grid > .highlighttable > tbody > tr > .code, +.md-typeset .grid > .highlighttable > tbody > tr > .code > .highlight, +.md-typeset .grid > .highlighttable > tbody > tr > .code > .highlight > pre, +.md-typeset + .grid + > .highlighttable + > tbody + > tr + > .code + > .highlight + > pre + > code { + height: 100%; +} + +/* Remove margins for tabbed-set elements within the grid */ +.md-typeset .grid > .tabbed-set { + margin-bottom: 0; + margin-top: 0; +} + +@media screen and (min-width: 45em) { + [dir="ltr"] .md-typeset .inline { + float: left; + } + + [dir="rtl"] .md-typeset .inline { + float: right; + } + + [dir="ltr"] .md-typeset .inline { + margin-right: 0.8rem; + } + + [dir="rtl"] .md-typeset .inline { + margin-left: 0.8rem; + } + + .md-typeset .inline { + margin-bottom: 0.8rem; + margin-top: 0; + width: 11.7rem; + } + + [dir="ltr"] .md-typeset .inline.end { + float: right; + } + + [dir="rtl"] .md-typeset .inline.end { + float: left; + } + + [dir="ltr"] .md-typeset .inline.end { + margin-left: 0.8rem; + margin-right: 0; + } + + [dir="rtl"] .md-typeset .inline.end { + margin-left: 0; + margin-right: 0.8rem; + } +} + +.md-typeset .admonition { + border-width: 0; + border-left-width: 4px; + font-size: initial; +} + +.md-typeset details { + border-width: 0; + border-left-width: 4px; + font-size: initial; +} + +.md-typeset details summary:before { + -webkit-mask-image: none; + mask-image: none; + content: none; + width: 0; +} + +.md-typset summary { + padding-left: 0.02rem; + margin: 0; +} + +[dir="ltr"] .md-typeset summary { + padding-left: 0.5rem; +} + +.md-typeset img { + display: block; + margin-left: auto; + margin-right: auto; +} + +.custom-tag-details { + font-size: 0.8rem; + margin: 5px 0; + color: var(--md-primary-fg-color); + border: 1px solid lightgray; + border-radius: 0.2rem; + overflow: hidden; + transition: all 0.3s ease; +} + +.custom-tag-details summary { + background-color: var(--md-primary-bg-color); + padding: 5px; + list-style: none; + outline: none; +} + +.custom-tag-details summary::-webkit-details-marker { + display: none; +} + +.custom-tag-details[open] summary::before { + transform: rotate(180deg); +} + +.custom-tag-details summary::before { + content: "⌄"; + font-size: 0.6rem; + display: inline-block; + margin-right: 5px; + transition: transform 0.3s ease; +} + +.custom-tag-details p { + padding: 5px; + margin: 0; + color: var(--md-text-primary-on-background); +} + +.md-typeset .md-tag { + border-radius: 0.2rem; + white-space: nowrap; +} \ No newline at end of file diff --git a/docs/assets/js/tablesort.js b/docs/assets/js/tablesort.js new file mode 100644 index 00000000..98717aed --- /dev/null +++ b/docs/assets/js/tablesort.js @@ -0,0 +1,6 @@ +document$.subscribe(function () { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function (table) { + new Tablesort(table) + }) +}) diff --git a/mkdocs.yml b/mkdocs.yml index f35bd958..4175bfd0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,43 +1,98 @@ -site_name: HackforLA.org wiki +site_name: HackforLA.org Wiki theme: name: material + palette: + # Palette toggle for light mode + - scheme: default + primary: black + accent: pink + toggle: + icon: material/brightness-7 + name: Switch to dark mode + # Palette toggle for dark mode + - scheme: slate + primary: black + accent: pink + toggle: + icon: material/brightness-4 + name: Switch to light mode features: + - announce.dismiss - content.action.edit + - content.action.view + - content.code.annotate - content.code.copy - - navigation.indexes - # - navigation.expand + #- content.tabs.link + - content.tooltips + #- header.autohide + #- navigation.expand - navigation.footer - # - navigation.sections + - navigation.indexes + #- navigation.instant + - navigation.sections + #- navigation.tabs + #- navigation.tabs.sticky - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + #- toc.integrate + repo_url: https://github.com/hackforla/website-wiki repo_name: hackforla/website-wiki edit_uri: edit/main/docs/ -# Plugins +extra_css: + - assets/css/extra.css + +extra_javascript: + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + - assets/js/tablesort.js + plugins: - - search - awesome-pages: filename: .pages - collapse_single_pages: true + collapse_single_pages: false strict: false + - tags: + tags_file: tags.md + - minify: + minify_html: true + - search: {} + - autolinks: {} + - git-revision-date-localized: {} -# Extensions markdown_extensions: + - abbr - admonition + - attr_list + - def_list + - footnotes - md_in_html - toc: title: On this page - permalink: true - - pymdownx.betterem: - smart_enable: all + permalink: "#" + - pymdownx.betterem - pymdownx.caret - pymdownx.details - pymdownx.emoji: - emoji_generator: !!python/name:materialx.emoji.to_svg emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg - pymdownx.highlight - pymdownx.inlinehilite - pymdownx.keys + - pymdownx.magiclink: + hide_protocol: false + normalize_issue_symbols: false + user: hackforla + provider: github + repo: website + repo_url_shorthand: true + repo_url_shortener: false + social_url_shorthand: false + social_url_shortener: false - pymdownx.mark - pymdownx.smartsymbols - pymdownx.superfences: @@ -49,3 +104,4 @@ markdown_extensions: alternate_style: true - pymdownx.tasklist: custom_checkbox: true + - pymdownx.tilde diff --git a/requirements.txt b/requirements.txt index 78951260..5ee0cfe2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,14 @@ -mkdocs-material>=9.0.0,<10.0.0 +colorama>=0.4 jinja2>=3.0 markdown>=3.2 mkdocs>=1.5.0 -mkdocs-material-extensions>=1.1 -pygments>=2.14 -pymdown-extensions>=9.9.1 +mkdocs-autolinks-plugin==0.7.1 mkdocs-awesome-pages-plugin +mkdocs-git-revision-date-localized-plugin==1.2.0 +mkdocs-material>=9.0.0,<10.0.0 +mkdocs-material-extensions>=1.1 mkdocs-minify-plugin -colorama>=0.4 +pymdown-extensions>=9.9.1 +pygments>=2.14 regex>=2022.4.24 -requests>=2.26 +requests>=2.26 \ No newline at end of file