Skip to content

Commit

Permalink
Updated blog.
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Cai <[email protected]>
  • Loading branch information
caizelin committed Sep 17, 2024
1 parent 4a02909 commit 771e37a
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 152 deletions.
44 changes: 12 additions & 32 deletions .github/workflows/blog.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
# Copyright (c) 2016-2023 Makerdiary

# 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.
# Copyright (c) 2016-2024 Makerdiary <https://makerdiary.com>
#
# SPDX-License-Identifier: Apache-2.0

name: Blog
on:
Expand All @@ -36,37 +20,33 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v4

- name: Set up Python runtime
uses: actions/setup-python@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set the date environmental variable
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- name: Set up build cache
uses: actions/cache@v3
id: cache
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: sudo apt-get install pngquant

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install -r requirements.txt
- name: Build site
run: mkdocs build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This is a place to share your applications, articles, videos and any other resou

## License

Copyright (c) 2016-2023 Makerdiary. See [LICENSE](./LICENSE) for further details.
Copyright (c) 2016-2024 Makerdiary. See [LICENSE](./LICENSE) for further details.
8 changes: 8 additions & 0 deletions docs/.overrides/.icons/microcotroller.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions docs/.overrides/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

<!-- Additional styles for landing page -->
<style>

/* Application header should be static for the landing page */
.md-header {
position: initial;
}

.md-typeset h2 {
font-weight: 700;
margin-top: 0.175em;
Expand Down
131 changes: 82 additions & 49 deletions docs/.overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@

<!-- Additional styles for landing page -->
<style>

/* Application header should be static for the landing page */
.md-header {
position: initial;
}

/* Hero section */
.mdx-container {
background: linear-gradient(to bottom, var(--md-primary-fg-color), var(--md-primary-fg-color--light) 99%, var(--md-default-bg-color) 99%);
Expand Down Expand Up @@ -180,39 +174,65 @@ <h1>{{ config.theme.home.hero.title }}</h1>
font-weight: 700;
margin-top: 0.175em;
}

.mdx-featured-blog__viewall {
.mdx-news__viewall {
margin-top: 1.5rem;
text-align: center;
}
.md-typeset .grid {

.md-post__grid {
grid-gap: 1.6rem 1.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 {

.md-post__grid.md-post__cards>ol,.md-post__grid.md-post__cards>ul {
display: contents
}
.md-typeset .grid.cards h3 {
margin: 0.5rem 0;
font-size: 0.9rem;

.md-post__grid.md-post__cards h2 {
margin: 0.5rem 0;
font-size: 0.9rem;
font-weight: 700;
}

.md-post__grid.md-post__cards a {
color: var(--md-default-fg-color);
}
.md-post__grid.md-post__cards a:hover {
color: var(--md-primary-fg-color);
}

.article_link:hover .twemoji {
transform: translateX(0.2rem);
}
.md-typeset .grid.cards>ol>li,.md-typeset .grid.cards>ul>li,.md-typeset .grid>.card {

.md-post__grid.md-post__cards>ol>li,.md-post__grid.md-post__cards>ul>li,.md-post__grid>.md-post__card {
border: .05rem solid var(--md-default-fg-color--lightest);
border-radius: .1rem;
display: block;
margin: 0;
padding: .8rem;
transition: border .25s,box-shadow .25s
}
.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 {

.md-post__grid.md-post__cards>ol>li:focus-within,.md-post__grid.md-post__cards>ol>li:hover,.md-post__grid.md-post__cards>ul>li:focus-within,.md-post__grid.md-post__cards>ul>li:hover,.md-post__grid>.md-post__card:focus-within,.md-post__grid>.md-post__card:hover {
border-color: #0000;
box-shadow: var(--md-shadow-z2)
}

.md-typeset .md-post__grid .md-tags {
margin-top: 0.5rem;
margin-bottom: -0.5rem;
}

.md-typeset .md-post__meta {
margin: 0.5rem 0;
}

.md-typeset .md-draft {
margin-left: 0.25rem;
}
</style>

<!-- Multicolumn -->
Expand Down Expand Up @@ -241,41 +261,54 @@ <h2 class="mdx-multicolumn__title">{{ column.title }}</h2>
{% endif %}
{% endif %}

{% if config.theme.blog %}
<h1 id="#latest-posts">Latest posts<a class="headerlink" href="#latest-posts" title="Permanent link"></a></h1>
{% if config.theme.blog.articles %}
<div class="grid cards">
<ul>
{% for article in config.theme.blog.articles %}
{% if loop.index < 4 %}
<li>
<img src="{{ article.cover | url }}" alt="{{ article.title | e }}" loading="lazy">
<h3>{{ article.title }}</h3>
<small>
<span class="twemoji">{% include ".icons/octicons/calendar-24.svg" %}</span>
{{ article.date }} ·
<span class="twemoji">{% include ".icons/octicons/clock-24.svg" %}</span>
{{ article.reading_time }} read
</small>
<p>{{ article.excerpt }}</p>
<p>
<a class="article_link" href="{{ article.link | url }}">
Continue reading
<span class="twemoji">
{% include ".icons/octicons/arrow-right-24.svg" %}
</span>
</a>
</p>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="md-typeset mdx-featured-blog__viewall">
<a href="{{ config.theme.blog.catalog | url }}" class="md-button md-button--primary"> View all </a>
</div>
{% endif %}
{% if config.theme.home.news %}
{% if config.theme.home.news.heading %}
<header class="md-typeset">
<h1 id="{{ config.theme.home.news.id }}">{{ config.theme.home.news.heading }}<a href="#{{ config.theme.home.news.id }}" class="headerlink" title="Permanent link"></a> </h1>
</header>
{% endif %}
<div class="md-post__grid md-post__cards">
<ul>
{% for post in config.theme.home.news.posts %}
{% if loop.index < 4 %}
<li>
<img src="{{ post.cover | url }}" alt="{{ post.title | e }}" loading="lazy">
<h2><a href="{{ post.url | url }}" class="toclink">{{ post.title }}</a></h2>
<p>{{ post.excerpt }}</p>
<div class="md-post__meta md-meta">
<div class="md-meta__list">
<!-- Post Date-->
<div class="md-meta__item">
<span class="twemoji">{% include ".icons/octicons/calendar-24.svg" %}</span>
<time datetime="{{ post.date }}">
{{- post.date | date -}}
</time>
{#- Collapse whitespace -#}
</div>
<!-- Post readtime -->
{% if post.readtime %}
{% set time = post.readtime %}
<div class="md-meta__item">
<span class="twemoji">{% include ".icons/octicons/clock-24.svg" %}</span>
{% if time == 1 %}
{{ lang.t("readtime.one") }}
{% else %}
{{ lang.t("readtime.other") | replace("#", time) }}
{% endif %}
</div>
{% endif %}
</div>
</div>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="md-typeset mdx-news__viewall">
<a href="{{ config.theme.home.news.viewall | url }}" class="md-button md-button--primary"> View all </a>
</div>
{% endif %}

{% endblock %}

<!-- Application footer -->
Expand Down
41 changes: 0 additions & 41 deletions docs/.overrides/partials/actions.html

This file was deleted.

Binary file added docs/posts/imx-rt1011-nano-kit-is-here/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 771e37a

Please sign in to comment.