mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-26 16:26:47 +08:00
Several enhancements and bug fixes (#981)
* Update the installation section. * Fix storage_pyramid.png * Update the landing page. * Update index.md * Add download buttons to the landing page. * Update the button style. * Update .gitignore
This commit is contained in:
@@ -0,0 +1 @@
|
||||
comments.html
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,32 @@
|
||||
<!-- Actions -->
|
||||
{% if page.edit_url %}
|
||||
|
||||
<!-- Edit button -->
|
||||
{% if "content.action.edit" in features and "edit" not in page.meta.hide %}
|
||||
<a
|
||||
href="{{ page.edit_url }}"
|
||||
title="{{ lang.t('action.edit') }}"
|
||||
class="md-content__button md-icon"
|
||||
>
|
||||
{% set icon = config.theme.icon.edit or "material/file-edit-outline" %}
|
||||
{% include ".icons/" ~ icon ~ ".svg" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- View button -->
|
||||
{% if "content.action.view" in features %}
|
||||
{% if "/blob/" in page.edit_url %}
|
||||
{% set part = "blob" %}
|
||||
{% else %}
|
||||
{% set part = "edit" %}
|
||||
{% endif %}
|
||||
<a
|
||||
href="{{ page.edit_url | replace(part, 'raw') }}"
|
||||
title="{{ lang.t('action.view') }}"
|
||||
class="md-content__button md-icon"
|
||||
>
|
||||
{% set icon = config.theme.icon.view or "material/file-eye-outline" %}
|
||||
{% include ".icons/" ~ icon ~ ".svg" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -1,25 +1,3 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<!-- Tags -->
|
||||
{% if "material/tags" in config.plugins and tags %}
|
||||
{% include "partials/tags.html" %}
|
||||
@@ -28,14 +6,6 @@
|
||||
<!-- Actions -->
|
||||
{% include "partials/actions.html" %}
|
||||
|
||||
<!--
|
||||
Hack: check whether the content contains a h1 headline. If it doesn't, the
|
||||
page title (or respectively site name) is used as the main headline.
|
||||
-->
|
||||
{% if "\x3ch1" not in page.content %}
|
||||
<h1>{{ page.title | d(config.site_name, true)}}</h1>
|
||||
{% endif %}
|
||||
|
||||
<!-- Page content -->
|
||||
{{ page.content }}
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
--md-admonition-fg-color: #1d1d20;
|
||||
|
||||
--md-typeset-color: #1d1d20;
|
||||
--md-typeset-a-color: #2aa996;
|
||||
--md-typeset-a-color: #349890;
|
||||
|
||||
--md-typeset-btn-color: #55aea6;
|
||||
--md-typeset-btn-hover-color: #52bbb1;
|
||||
}
|
||||
|
||||
[data-md-color-scheme="slate"] {
|
||||
@@ -35,7 +38,10 @@
|
||||
--md-footer-fg-color: #adbac7;
|
||||
|
||||
--md-typeset-color: #adbac7;
|
||||
--md-typeset-a-color: #21c8b8 !important;
|
||||
--md-typeset-a-color: #52bbb1 !important;
|
||||
|
||||
--md-typeset-btn-color: #52bbb1;
|
||||
--md-typeset-btn-hover-color: #55aea6;
|
||||
}
|
||||
|
||||
/* https://github.com/squidfunk/mkdocs-material/issues/4832#issuecomment-1374891676 */
|
||||
@@ -119,3 +125,40 @@ body {
|
||||
[data-md-color-scheme="slate"] .md-typeset video {
|
||||
filter: brightness(0.85) invert(0.05);
|
||||
}
|
||||
|
||||
/* landing page */
|
||||
.header-img-div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
width: 100%; /* Default to full width */
|
||||
}
|
||||
|
||||
/* rounded button */
|
||||
.rounded-button {
|
||||
display: inline-flex; /* Use flexbox for alignment */
|
||||
align-items: center; /* Align items vertically */
|
||||
justify-content: center; /* Center items horizontally */
|
||||
border-radius: 100px; /* Circular corners */
|
||||
padding: 9px 18px; /* Padding around the text */
|
||||
margin: 0.15em 0;
|
||||
border: none; /* Removes default border */
|
||||
background-color: var(--md-typeset-btn-color); /* Background color */
|
||||
color: var(--md-primary-fg-color) !important; /* Text color */
|
||||
font-size: 0.85em; /* Font size */
|
||||
text-align: center; /* Center the text */
|
||||
text-decoration: none; /* Remove underline from anchor text */
|
||||
cursor: pointer; /* Pointer cursor on hover */
|
||||
}
|
||||
|
||||
.rounded-button:hover {
|
||||
background-color: var(--md-typeset-btn-hover-color);
|
||||
}
|
||||
|
||||
.rounded-button svg {
|
||||
fill: var(--md-primary-fg-color); /* Fill SVG icon with text color */
|
||||
width: 1.2em;
|
||||
height: auto;
|
||||
margin-right: 0.5em; /* Add some space between the SVG icon and the text */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user