feat: Add option to disable feed link in nav

This commit is contained in:
daudix-UFO
2023-10-15 17:19:55 +00:00
parent e41cfb1d39
commit 9e9e12f732
5 changed files with 165 additions and 159 deletions

304
README.md
View File

@ -1,150 +1,154 @@
# Duckquill # Duckquill
[![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page) [![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page)
[![status-badge](https://ci.exozy.me/api/badges/159/status.svg)](https://ci.exozy.me/repos/159) [![status-badge](https://ci.exozy.me/api/badges/159/status.svg)](https://ci.exozy.me/repos/159)
[Duckquill](https://git.exozy.me/daudix/duckquill) is a modern, pretty, and clean (and very opinionated) [Zola](https://www.getzola.org) theme that has the purpose of greatly simplifying the process of rolling up your blog. It aims to provide all the needed options for comfortable writing, keeping the balance of it being simple. [Duckquill](https://git.exozy.me/daudix/duckquill) is a modern, pretty, and clean (and very opinionated) [Zola](https://www.getzola.org) theme that has the purpose of greatly simplifying the process of rolling up your blog. It aims to provide all the needed options for comfortable writing, keeping the balance of it being simple.
> Duckquill is made based on needs of [my website](https://daudix.exozy.me), if you need some feature/configuration that doesn't exist feel free to open an issue or better yet, pull request! > Duckquill is made based on needs of [my website](https://daudix.exozy.me), if you need some feature/configuration that doesn't exist feel free to open an issue or better yet, pull request!
[![Duckquill](https://i.imgur.com/PrzgtNB.png)](https://i.imgur.com/1fCi1sF.png) [![Duckquill](https://i.imgur.com/PrzgtNB.png)](https://i.imgur.com/1fCi1sF.png)
## Installation ## Installation
First, download this theme to your `themes` directory: First, download this theme to your `themes` directory:
```sh ```sh
git clone https://git.exozy.me/daudix/duckquill.git themes/duckquill git clone https://git.exozy.me/daudix/duckquill.git themes/duckquill
``` ```
...or add as submodule for easy updating (recommended if you already have git setup on site): ...or add as submodule for easy updating (recommended if you already have git setup on site):
```sh ```sh
git submodule init git submodule init
git submodule add https://git.exozy.me/daudix/duckquill.git themes/duckquill git submodule add https://git.exozy.me/daudix/duckquill.git themes/duckquill
``` ```
and then enable it in your `config.toml`: and then enable it in your `config.toml`:
``` ```
theme = "duckquill" theme = "duckquill"
``` ```
## Options ## Options
Duckquill offers some configuration options to make it fit you better (but that doesn't make it less opinionated). Duckquill offers some configuration options to make it fit you better.
### Custom CSS ### Custom CSS
You can add your own or override existing styles in the `sass/custom.scss` of your site, if for some reason overridden class are not respected, try using `!important`. You can import styles from Duckquill using `@use "../themes/duckquill/sass/NEEDED_FILE.scss";`. You can add your own or override existing styles in the `sass/custom.scss` of your site, if for some reason overridden class are not respected, try using `!important`. You can import styles from Duckquill using `@use "../themes/duckquill/sass/NEEDED_FILE.scss";`.
### Accent color ### Accent color
Duckquill respects chosen accent color everywhere, you can use any HEX color code you want Duckquill respects chosen accent color everywhere, you can use any HEX color code you want
First, change the accent color in `config.toml`: First, change the accent color in `config.toml`:
``` ```
[extra] [extra]
accent_color = "#HEX_COLOR_CODE" accent_color = "#HEX_COLOR_CODE"
``` ```
Then, paste the following code inside `sass/custom.scss` (inside your site, not the theme): Then, paste the following code inside `sass/custom.scss` (inside your site, not the theme):
``` ```
@use "sass:color"; @use "sass:color";
$accent-color: #HEX_COLOR_CODE; $accent-color: #HEX_COLOR_CODE;
$accent-color-20: color.scale($accent-color, $alpha: -80%); $accent-color-20: color.scale($accent-color, $alpha: -80%);
$crt-bg: radial-gradient( $crt-bg: radial-gradient(
color.scale($accent-color, $lightness: -80%), color.scale($accent-color, $lightness: -80%),
color.scale($accent-color, $lightness: -90%) color.scale($accent-color, $lightness: -90%)
); );
$bg-l: color.mix($accent-color, rgb(250, 250, 250), 10%); $bg-l: color.mix($accent-color, rgb(250, 250, 250), 10%);
$bg-d: color.mix($accent-color, rgb(11, 11, 11), 5%); $bg-d: color.mix($accent-color, rgb(11, 11, 11), 5%);
$glow: $glow:
0 0 0 1px color.scale($accent-color, $alpha: -95%), 0 0 0 1px color.scale($accent-color, $alpha: -95%),
0 2px 6px 2px color.scale($accent-color, $alpha: -95%), 0 2px 6px 2px color.scale($accent-color, $alpha: -95%),
0 4px 24px 4px color.scale($accent-color, $alpha: -90%); 0 4px 24px 4px color.scale($accent-color, $alpha: -90%);
:root { :root {
--accent-color-20: #{$accent-color-20}; --accent-color-20: #{$accent-color-20};
--accent-color: #{$accent-color}; --accent-color: #{$accent-color};
--background: #{$bg-l}; --background: #{$bg-l};
--crt-bg: #{$crt-bg}; --crt-bg: #{$crt-bg};
--glow: #{$glow}; --glow: #{$glow};
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--background: #{$bg-d}; --background: #{$bg-d};
} }
} }
``` ```
Set any color in `$accent-color` and reload, the accent color should be used now. This is a hack that is needed until Zola will be able to use `config.toml` inside Sass. Set any color in `$accent-color` and reload, the accent color should be used now. This is a hack that is needed until Zola will be able to use `config.toml` inside Sass.
### `[extra]` variables: ### `[extra]` variables:
- `accent_color`: Accent color used in some browsers set in metadata, see [#accent-color](https://git.exozy.me/daudix/duckquill#accent-color) - `accent_color`: Accent color used in some browsers set in metadata, see [#accent-color](https://git.exozy.me/daudix/duckquill#accent-color)
- `animated_favicon`: Specify if the favicon are animated GIF (true, false) - `animated_favicon`: Specify if the favicon are animated GIF (true, false)
- `blog_title`: The title of the blog - `blog_title`: The title of the blog
- `blog_description`: The description of the blog, displayed right under the blog title - `blog_description`: The description of the blog, displayed right under the blog title
- `date_format`: Allows setting custom date format in [Tera](https://keats.github.io/tera) format, all available variables are listed [here](https://docs.rs/chrono/0.4.31/chrono/format/strftime/index.html). Does not apply to comments - `date_format`: Allows setting custom date format in [Tera](https://keats.github.io/tera) format, all available variables are listed [here](https://docs.rs/chrono/0.4.31/chrono/format/strftime/index.html). Does not apply to comments
- `hosting`: Where the website source are located, used on 404 page - `hosting`: Where the website source are located, used on 404 page
- `issues_url`: Link to site bug tracker, if present - `issues_url`: Link to site bug tracker, if present
- `source_url`: Link to site source (not built site) - `source_url`: Link to site source (not built site)
- `nav_links`: Links used in navigation bar
### `[extra.nav]` variables:
The `nav_links` are set like so:
- `show_feed`: Whether to display "Feed" link
``` - `nav_links`: Links used in navigation bar
[extra]
nav_links = [ The `nav_links` are set like the following:
{url = "https://example.org", name = "Example"},
{url = "https://mstdn.social", name = "Mastodon"}, ```
] [extra]
``` nav_links = [
{url = "https://example.org", name = "Example"},
### `[extra.footer]` variables: {url = "https://mstdn.social", name = "Mastodon"},
]
- `johnvert_ref`: Site URL without `https://` part or trailing slashes, e.g `example.org`. Works only if `show_johnvert` are set to `true` ```
- `show_copyright`: Whether to display `© Duckquill, 2023`. (true, false)
- `show_johnvert`: Whether to display [Johnvertisement](https://john.citrons.xyz). (true, false) ### `[extra.footer]` variables:
- `show_powered_by`: Whether to display `Powered by Zola and Duckquill`. (true, false)
- `show_source`: Whether to display `Website source` link. (true, false) - `johnvert_ref`: Site URL without `https://` part or trailing slashes, e.g `example.org`. Works only if `show_johnvert` are set to `true`
- `show_copyright`: Whether to display `© Duckquill, 2023`. (true, false)
### `[extra.comments]` variables: - `show_johnvert`: Whether to display [Johnvertisement](https://john.citrons.xyz). (true, false)
- `show_powered_by`: Whether to display `Powered by Zola and Duckquill`. (true, false)
- `host`: Mastodon home server, e.g `mstdn.social` - `show_source`: Whether to display `Website source` link. (true, false)
- `user`: Mastodon username, e.g `Daudix`
- `token`: Mastodon app token, e.g `jTNX9pAV8XEPBby0cPWF6CmGY60kkIy4vidggfxXmoQ`. Can be left empty, but in this case only first 60 comments will be loaded, instructions on how to get one are available [here](https://github.com/cassidyjames/cassidyjames.github.io/blob/47c449a0083113ea5be8d215beb6650ac64929e4/_config.yaml#L48-L52) ### `[extra.comments]` variables:
These values are also used in the `<head>` for Mastodon verification. - `host`: Mastodon home server, e.g `mstdn.social`
- `user`: Mastodon username, e.g `Daudix`
## Test pages - `token`: Mastodon app token, e.g `jTNX9pAV8XEPBby0cPWF6CmGY60kkIy4vidggfxXmoQ`. Can be left empty, but in this case only first 60 comments will be loaded, instructions on how to get one are available [here](https://github.com/cassidyjames/cassidyjames.github.io/blob/47c449a0083113ea5be8d215beb6650ac64929e4/_config.yaml#L48-L52)
- [Demo page](https://duckquill.exozy.me/demo) These values are also used in the `<head>` for Mastodon verification.
- [Cake Party!](https://duckquill.exozy.me/demo/page)
- [ActivityPub/Fediverse comments demo](https://duckquill.exozy.me/demo/comments) ## Test pages
## Contribute - [Demo page](https://duckquill.exozy.me/demo)
- [Cake Party!](https://duckquill.exozy.me/demo/page)
If you want to improve Duckquill in any way, feel free to open an issue, or even better, a pull request! I'm happy about every contribution! - [ActivityPub/Fediverse comments demo](https://duckquill.exozy.me/demo/comments)
The main repo is https://git.exozy.me/daudix/duckquill, but since only exozy.me members can open issues and pull requests, there is two-way mirror at https://next.forgejo.org/daudix-UFO/duckquill, you can open issues and pull requests there just fine. ## Contribute
## Credits If you want to improve Duckquill in any way, feel free to open an issue, or even better, a pull request! I'm happy about every contribution!
- [Quill image used in the metadata card](https://commons.wikimedia.org/wiki/File:3quills.jpg) The main repo is https://git.exozy.me/daudix/duckquill, but since only exozy.me members can open issues and pull requests, there is two-way mirror at https://next.forgejo.org/daudix-UFO/duckquill, you can open issues and pull requests there just fine.
## Special thanks ♥ ## Credits
- [Jakub Steiner](https://jimmac.eu) for an awesome [OS Component Website](https://jimmac.github.io/os-component-website), on top of which this whole thing is built - [Quill image used in the metadata card](https://commons.wikimedia.org/wiki/File:3quills.jpg)
- [Cassidy James](https://cassidyjames.com) for an awesome [Mastodon-powered Comments](https://cassidyjames.com/blog/fediverse-blog-comments-mastodon)
- [Mehdi](https://codepen.io/meduzen) for an awesome [CSS Scanlines](https://codepen.io/meduzen/pen/zxbwRV) ## Special thanks ♥
- dwb, ejm and jgs for awesome ASCII art
- Everyone who supported me and said good stuff <3 - [Jakub Steiner](https://jimmac.eu) for an awesome [OS Component Website](https://jimmac.github.io/os-component-website), on top of which this whole thing is built
- [Cassidy James](https://cassidyjames.com) for an awesome [Mastodon-powered Comments](https://cassidyjames.com/blog/fediverse-blog-comments-mastodon)
- [Mehdi](https://codepen.io/meduzen) for an awesome [CSS Scanlines](https://codepen.io/meduzen/pen/zxbwRV)
- dwb, ejm and jgs for awesome ASCII art
- Everyone who supported me and said good stuff <3

View File

@ -30,7 +30,10 @@ date_format = "%d %B %Y"
hosting = "Codeberg" hosting = "Codeberg"
issues_url = "https://git.exozy.me/daudix/duckquill/issues" issues_url = "https://git.exozy.me/daudix/duckquill/issues"
source_url = "https://git.exozy.me/daudix/duckquill" source_url = "https://git.exozy.me/daudix/duckquill"
nav_links = [
[extra.nav]
show_feed = true
links = [
{url = "https://git.exozy.me/daudix/duckquill", name = "Repo"}, {url = "https://git.exozy.me/daudix/duckquill", name = "Repo"},
{url = "/demo", name = "Demo"}, {url = "/demo", name = "Demo"},
{url = "/blog", name = "Blog"}, {url = "/blog", name = "Blog"},

View File

@ -46,16 +46,14 @@ zola init blog
git init git init
``` ```
3. Fork Duckquill 3. Add Duckquill as Git submodule for easy updating:
4. Add Duckquill as Git submodule for easy updating:
``` ```
git submodule init git submodule init
git submodule add YOUR_FORK.git themes/duckquill git submodule add https://git.exozy.me/daudix/duckquill.git themes/duckquill
``` ```
5. Edit `config.toml` and enable Duckquill theme: 4. Edit `config.toml` and enable Duckquill theme:
``` ```
theme = "duckquill" theme = "duckquill"

View File

@ -4,11 +4,12 @@
{{ config.title }} {{ config.title }}
</a> </a>
<ul> <ul>
{% for link in config.extra.nav_links %} {% for link in config.extra.nav.links %}
<li> <li>
<a href="{{link.url}}">{{link.name}}</a> <a href="{{link.url}}">{{link.name}}</a>
</li> </li>
{% endfor %} {% endfor %}
{% if config.extra.nav.show_feed %}
<li> <li>
<a href="{{ config.base_url }}/atom.xml"> <a href="{{ config.base_url }}/atom.xml">
<svg class="link-icon" viewBox="0 0 16 16" width="16" height="16"> <svg class="link-icon" viewBox="0 0 16 16" width="16" height="16">
@ -20,6 +21,7 @@
Feed Feed
</a> </a>
</li> </li>
{% endif %}
</ul> </ul>
</div> </div>
</nav> </nav>

View File

@ -1,7 +1,7 @@
name = "Duckquill" name = "Duckquill"
description = "Modern, pretty, and clean theme" description = "Modern, pretty, and clean theme"
license = "MIT" license = "MIT"
homepage = "https://codeberg.org/daudix-UFO/duckquill" homepage = "https://git.exozy.me/daudix/duckquill"
min_version = "0.17.2" min_version = "0.17.2"
demo = "https://duckquill.exozy.me" demo = "https://duckquill.exozy.me"
@ -10,4 +10,3 @@ demo = "https://duckquill.exozy.me"
[author] [author]
name = "David Lapshin" name = "David Lapshin"
homepage = "https://daudix.exozy.me" homepage = "https://daudix.exozy.me"