dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit dfcab1c901a1a422fc44e755fbd9cba64401fa35 parent 9c19cad487acefd151d3d7b864f25174ce218c89 Author: maydayv7 <maydayv7@gmail.com> Date: Tue, 18 Feb 2025 21:35:44 +0530 feat(`site`): Add loader Also fix feed
Diffstat:
| M | site/config.toml | | | 3 | +-- |
| A | site/content/feed.md | | | 7 | +++++++ |
| D | site/content/feeds.md | | | 7 | ------- |
| M | site/content/projects.md | | | 2 | +- |
| M | site/sass/_logo.scss | | | 51 | ++++++++++++++++++++++++++++++++++++++++++++++++++- |
| A | site/static/js/load.js | | | 5 | +++++ |
| M | site/templates/macros/comments.html | | | 10 | +++++----- |
| M | site/templates/macros/javascript.html | | | 3 | ++- |
| M | site/templates/macros/logo.html | | | 1 | + |
| M | site/templates/macros/social.html | | | 4 | ++-- |
| M | site/templates/page.html | | | 10 | +++------- |
11 files changed, 77 insertions(+), 26 deletions(-)
diff --git a/site/config.toml b/site/config.toml @@ -86,8 +86,7 @@ main_menu_items = [ # Socials Bar email = "mailto:maydayv7@gmail.com" -show_rss_badge = true -rss_path = "rss.xml" +feed_path = "rss.xml" reddit_profile = "https://reddit.com/u/maydayv7" github_profile = "https://github.com/maydayv7" discord_profile = "https://discordlookup.com/user/519513852648357929" diff --git a/site/content/feed.md b/site/content/feed.md @@ -0,0 +1,7 @@ ++++ +title = "Blog Feed" + +[extra] +skip-meta = true +feed = true ++++ diff --git a/site/content/feeds.md b/site/content/feeds.md @@ -1,7 +0,0 @@ -+++ -title = "Blog Feeds" - -[extra] -skip-meta = true -feeds = true -+++ diff --git a/site/content/projects.md b/site/content/projects.md @@ -1,5 +1,5 @@ +++ -title = "Highlighted Projects" +title = "My Projects" [extra] skip-meta = true diff --git a/site/sass/_logo.scss b/site/sass/_logo.scss @@ -6,10 +6,59 @@ border-radius: $corner-radius; color: black; display: flex; - padding: 8px 15px; + padding: 8px 10px; text-decoration: none; &:hover { color: var(--accent-secondary); } } + +.loading { + margin-left: 15px; + font-size: 3px; + position: relative; + text-indent: -9999em; + border-top: 1.1em solid var(--border-color); + border-right: 1.1em solid var(--border-color); + border-bottom: 1.1em solid var(--border-color); + border-left: 1.1em solid black; + + transform: translateZ(0); + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + animation: load8 1.1s infinite linear; + -webkit-animation: load8 1.1s infinite linear; + + border-radius: 50%; + width: 7em; + height: 7em; + + &:after { + border-radius: 50%; + width: 7em; + height: 7em; + } +} + +@-webkit-keyframes load8 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes load8 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} diff --git a/site/static/js/load.js b/site/static/js/load.js @@ -0,0 +1,5 @@ +var loading = document.querySelector(".loading"); + +window.addEventListener("load", function () { + loading.style.display = "none"; +}); diff --git a/site/templates/macros/comments.html b/site/templates/macros/comments.html @@ -13,7 +13,7 @@ js::comments() }} {% endif %} {% endmacro comments %} {% macro disqus() %} (function () { var d = document, s = d.createElement("script"); - s.src = "https://{{config.extra.disqus.short_name}}.disqus.com/embed.js"; + s.src = "https://{{ config.extra.disqus.short_name }}.disqus.com/embed.js"; s.setAttribute("data-timestamp", +new Date()); (d.head || d.body).appendChild(s); })(); @@ -28,10 +28,10 @@ js::comments() }} {% endif %} {% endmacro comments %} {% macro disqus() %} <div class="comments" id="giscus_thread"> <script src="https://giscus.app/client.js" - data-repo="{{config.extra.giscus.repo}}" - data-repo-id="{{config.extra.giscus.repo_id}}" - data-category="{{config.extra.giscus.category}}" - data-category-id="{{config.extra.giscus.category_id}}" + data-repo="{{ config.extra.giscus.repo }}" + data-repo-id="{{ config.extra.giscus.repo_id }}" + data-category="{{ config.extra.giscus.category }}" + data-category-id="{{ config.extra.giscus.category_id }}" data-mapping="title" data-reactions-enabled="1" data-emit-metadata="0" diff --git a/site/templates/macros/javascript.html b/site/templates/macros/javascript.html @@ -1,9 +1,10 @@ {% macro script() %} +<script src="{{ get_url(path="js/load.js") }}"></script> <script src="{{ get_url(path="js/theme.js") }}"></script> +<script src="{{ get_url(path="js/scroll.js") }}"></script> <script> switch_theme.init("{{config.base_url | safe}}"); </script> <script src="{{ get_url(path="js/clipboard.js") }}"></script> <script src="{{ get_url(path="js/footnote.js") }}"></script> -<script src="{{ get_url(path="js/scroll.js") }}"></script> {% if config.build_search_index %} <script src="{{ get_url(path="elasticlunr.min.js") }}"></script> <script src="{{ get_url(path="search_index.en.js") }}"></script> diff --git a/site/templates/macros/logo.html b/site/templates/macros/logo.html @@ -3,6 +3,7 @@ href="{%- if config.extra.logo_home_link -%}{{ config.extra.logo_home_link }}{%- else -%}{{ config.base_url }}{%- endif -%}"> <div class="logo"> {{ config.extra.logo_text | default(value="logo") | safe }} + <div class="loading"></div> </div> </a> {%- endmacro logo -%} diff --git a/site/templates/macros/social.html b/site/templates/macros/social.html @@ -1,7 +1,7 @@ {% macro socials_bar() %} <div class="socials-bar"> - {%- if config.extra.show_rss_badge -%} - <a href="{{ config.extra.rss_path }}" style="text-decoration: none"> + {%- if config.generate_feeds -%} + <a href="{{ config.extra.feed_path }}" style="text-decoration: none"> {%- set rss_image = resize_image(path="../static/social/rss.png", width=33, height=33, op="scale", format="png") -%} <img src="{{ rss_image.url }}" style="display: inline" alt="RSS Badge" /> diff --git a/site/templates/page.html b/site/templates/page.html @@ -26,15 +26,11 @@ endblock math -%} {%- block title %} <li>{{ posts::meta(page=page, list=true) }}</li> {% endfor %} </ul> - {% endif %} {% if page.extra['feeds'] %} + {% endif %} {% if page.extra['feed'] %} <ul class="post-list"> <li> - {{ url::internal(path=config.extra.rss_path, trailing_slash=false, - text="RSS link") }} - </li> - <li> - {{ url::internal(path="{{ get_url(path='blog/atom.xml', - trailing_slash=false) }}", text="Atom Link") }} + {{ url::internal(path=config.extra.feed_path, trailing_slash=false, + text="RSS Link") }} </li> </ul> {% endif %} {% if config.extra.edit_page and page.extra.edit %} {{