Skip to content

Commit

Permalink
UPDATED Discord linl
Browse files Browse the repository at this point in the history
  • Loading branch information
duy103zxc committed Oct 14, 2024
1 parent 737805d commit fa02cf1
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 4 deletions.
4 changes: 1 addition & 3 deletions docs/join.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

Have you read the site? Please read the site before joining the Discord.

TheMoeWay Discord Server is made for Japanese learners (There are also a channel for Vietnamese so you can ask us there).

**[I understand, take me to the Discord!](https://discord.gg/nhqjydaR8j)**
**[I understand, take me to the Discord!](https://discord.gg/jJjaCH3Bc2)**
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ theme:
name: Switch to light mode
logo: assets/logo.svg
favicon: assets/vietnam.svg
custom_dir: overrides
features:
- navigation.tabs
- navigation.sections
Expand Down Expand Up @@ -79,7 +80,7 @@ markdown_extensions:
permalink: true
plugins:
- search
- open-in-new-tab
# - open-in-new-tab

extra:
generator: false
74 changes: 74 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{% extends "base.html" %}



{% block analytics %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6M8XGSMGX2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-6M8XGSMGX2');
</script>





<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7374918663808833"
crossorigin="anonymous"></script>

{% endblock %}

{% block lang_switcher %}
<script>

// console.log("Script loaded"); // Check if script is loaded

// function language_selector() {
// console.log("language_selector function called");
// }

// language_selector(); // Call the function initially

// const observer = new MutationObserver(language_selector);
// observer.observe(document.documentElement, { childList: true, subtree: true });


// </script>
{% endblock %}

{% block site_nav %}

{% if nav %}
{% if page and page.meta and page.meta.hide %}
{% set hidden = "hidden" if "navigation" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation" {{ hidden }}>
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
{% include "partials/nav.html" %}
</div>
</div>
</div>
{% endif %}

{% if page.toc and not "toc.integrate" in features %}
{% if page and page.meta and page.meta.hide %}
{% set hidden = "hidden" if "toc" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" {{ hidden }}>
<div class="md-sidebar__scrollwrap">

<!-- <a href="/donate"><img width="100%" src="/img/donate.png"></a> -->
<div class="md-sidebar__inner">
<br>
{% include "partials/toc.html" %}
</div>
</div>
</div>
{% endif %}

{% endblock %}
Empty file added overrides/partials/footer.html
Empty file.
124 changes: 124 additions & 0 deletions overrides/partials/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!--
Copyright (c) 2016-2021 Martin Donath <[email protected]>
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 NON-INFRINGEMENT. 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.
-->

<!-- Header -->
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="{{ lang.t('header.title') }}">

<!-- Link to home -->
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" title="{{ config.site_name | e }}"
class="md-header__button md-logo" aria-label="{{ config.site_name }}" data-md-component="logo">
{% include "partials/logo.html" %}
</a>

<!-- Button to open drawer -->
<label class="md-header__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>

<!-- Header title -->
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
{{ config.site_name }}
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
</div>
</div>

<!-- Discord icon that links to discord-->
<label class="md-icon">
<a href="https://daihocmo.github.io/learn-vietnamese/join">
{% include ".icons/fontawesome/brands/discord.svg" %}
</a>
</label>


<!-- Color palette -->
{% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set primary = option.primary | replace(" ", "-") | lower %}
{% set accent = option.accent | replace(" ", "-") | lower %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ option.scheme }}"
data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}" type="radio" name="__palette"
id="__palette_{{ loop.index }}" />
{% if option.toggle %}
<label class="md-header__button md-icon" title="{{ option.toggle.name }}"
for="__palette_{{ loop.index0 or loop.length }}" hidden>
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
</label>
{% endif %}
{% endfor %}
</form>
{% endif %}

<!-- Site language selector -->
{% if config.extra.alternate %}
<div class="md-header__option">
</form>
<div class="md-select">
{% set icon = config.theme.icon.alternate or "material/translate" %}
<button class="md-header__button md-icon">
{% include ".icons/" ~ icon ~ ".svg" %}
</button>
<div class="md-select__inner">
<ul class="md-select__list">
{% for alt in config.extra.alternate %}
<li class="md-select__item">
<a href="{{ alt.link | url }}" hreflang="{{ alt.lang }}" class="md-select__link language-select-link">
{{ alt.name }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endif %}

<!-- Button to open search modal -->
{% if "material/search" in config["plugins"] %}
<label class="md-header__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>

<!-- Search interface -->
{% include "partials/search.html" %}
{% endif %}

<!-- Repository information -->
{% if config.repo_url %}
<div class="md-header__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>

</header>
80 changes: 80 additions & 0 deletions overrides/partials/header1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!--
Copyright (c) 2016-2020 Martin Donath <[email protected]>
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 NON-INFRINGEMENT. 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.
-->

<!-- Mitigate bug: https://github.com/mkdocs/mkdocs/issues/2191 -->
{% set site_url = config.site_url | d(nav.homepage.url, true) | url %}
{% if not config.use_directory_urls and site_url[0] == site_url[-1] == "." %}
{% set site_url = site_url ~ "/index.html" %}
{% endif %}

<!-- Application header -->
<header class="md-header" data-md-component="header">

<!-- Top-level navigation -->
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">

<!-- Link to home -->
<a href="{{ site_url }}" title="{{ config.site_name | e }}" class="md-header-nav__button md-logo"
aria-label="{{ config.site_name }}">
{% include "partials/logo.html" %}
</a>

<!-- Button to open drawer -->
<label class="md-header-nav__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>

<!-- Header title -->
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<div class="md-header-nav__topic">
<span class="md-ellipsis">
<a href="{{ site_url }}">{{ config.site_name }}</a>
</span>
</div>
<div class="md-header-nav__topic">
<span class="md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
</div>
</div>

<!-- Button to open search dialogue -->
{% if "search" in config["plugins"] %}
<label class="md-header-nav__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>

<!-- Search interface -->
{% include "partials/search.html" %}
{% endif %}

<!-- Repository information -->
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>
</header>

0 comments on commit fa02cf1

Please sign in to comment.