Skip to content

Commit

Permalink
fixed CSP, meta tags and alt attr
Browse files Browse the repository at this point in the history
  • Loading branch information
syedzayyan committed Oct 31, 2022
1 parent dc5c2b7 commit 6166e8d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,25 @@ git submodule add https://github.com/syedzayyan/shadharon themes/shadharon
```
cp -R themes/shadharon/content/. content
```
4. For customization refer to config.toml files, which has comments.

5. For customizing the banner on the homepage the content/posts/_index.md needs modification. The desc variable under `extra`, specifically. You could delete this as well to remove banner. For an about page or any aditional page an .md file in the "content" directory will do.
## Customization

1. For customization refer to config.toml files, which has comments.

2. For customizing the banner on the homepage the content/posts/_index.md needs modification. The desc variable under `extra`, specifically. You could delete this as well to remove banner. For an about page or any aditional page an .md file in the "content" directory will do.

You can add stylesheets to override the theme:

```toml
[extra]
stylesheets = [
"override.css",
]
```

## Options
These filenames are relative to the root of the site. In this example, the two CSS files would be in the `static` folder.


## References

This theme takes inspiration from
Expand Down
3 changes: 2 additions & 1 deletion sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
--light-border-color: rgba(255, 255, 255, 0.1);
--input-back: #4b4a4a;
--input-color: #294797;
--meta-color: rgb(198, 197, 197);
}

[data-theme="light"] {
--bg-0: #fff;
--bg-1: #f2f2f2;
--bg-2: #fefefe;
--primary-color: #ef5350;
--hover-color: white;
--background-color:#fff;
--navbar-color:#e3e3e3;
Expand All @@ -55,6 +55,7 @@
--input-color: #294797;
--input-back: rgb(158, 158, 158);
--input-color: #fbec48;
--meta-color: rgb(53, 53, 53);
}

html {
Expand Down
2 changes: 1 addition & 1 deletion sass/parts/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ header .main {
}

.meta {
color: #999;
color: var(--meta-color);
letter-spacing: -0.5px;
}

Expand Down
5 changes: 0 additions & 5 deletions sass/parts/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ a:hover {
background-color: var(--primary-color);
color: var(--hover-color);
}

time {
color: grey;
}

/* Remove post list padding */
@media screen and (max-width: 600px) {
.list>ul {
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% import "macros/macros.html" as post_macros %}

<!DOCTYPE html>
<html>
<html lang = "en">
{% include "partials/header.html" %}

<body>
Expand Down
2 changes: 1 addition & 1 deletion templates/macros/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>
<p id="banner-home-subtitle">{{ desc.text }}</p>
</div>
<div class="image-container-home">
<img class="banner-home-img" src="{{ desc.img }}" />
<img alt = "the owner" class="banner-home-img" src="{{ desc.img }}" />
</div>
</div>
{% endmacro content %}
Expand Down
2 changes: 2 additions & 0 deletions templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@
<meta property="og:description" content="{{ config.description }}">
<meta property="og:site_name" content="{{ config.title }}">

<meta http-equiv="Content-Security-Policy"
content="default-src 'self' ws://127.0.0.1:1024/; img-src 'self' https://*; script-src 'self'; style-src 'self'; font-src 'self'" />
</head>
6 changes: 3 additions & 3 deletions templates/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<nav class="socials nav-navs">
{%- if config.extra.socials %}
{% for social in config.extra.socials %}
<a rel="noopener noreferrer" target="_blank" class="nav-links" href="{{ social.url }}" class="social">
<a rel="noopener noreferrer" target="_blank" class="nav-links social" href="{{ social.url }}">
<img alt={{ social.name }} title={{ social.name }} src="/social_icons/{{ social.icon }}.svg">
</a>
{% endfor %}
Expand All @@ -30,8 +30,8 @@
<div class="background"></div>
<input type="checkbox" id="themeswitch">
<div class="switch">
<img class="moon" src="/menu_icon/moon.png">
<img class="sun" src="/menu_icon/sun.png">
<img alt = "theme switch to dark" class="moon" src="/menu_icon/moon.png">
<img alt = "theme switch to light" class="sun" src="/menu_icon/sun.png">
</div>
</label>
</nav>
Expand Down

0 comments on commit 6166e8d

Please sign in to comment.