Skip to content

Commit

Permalink
Update footer and allow empty alt
Browse files Browse the repository at this point in the history
  • Loading branch information
salif committed Nov 20, 2024
1 parent cc6c5dc commit 84aa7a4
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 2,129 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,8 @@ fb_admins = ["YOUR_USER_ID"]

| key | type |
| --------------------------------- | ------ |
| extra.footer.author_name | string |
| extra.footer.since | number |
| extra.footer.license_name | string |
| extra.footer.copyright | string |
| extra.footer.license_url | string |
| extra.footer.privacy_policy_url | string |
| extra.footer.terms_of_service_url | string |
Expand All @@ -606,11 +605,19 @@ Currently `privacy_policy_url`, `terms_of_service_url`, and `search_page_url` ar

`$BASE_URL` is supported in the `_url` options.

Option `copyright` supports Markdown and:
- `$BASE_URL`
- `$YEAR` (uses `since`)
- `$LICENSE_URL` (uses `license_url`)

```toml
[extra.footer]
# Replace with the correct year
since = 2024
license_name = "CC BY-SA 4.0"
# Replace with the url of the license you want
license_url = "https://creativecommons.org/licenses/by-sa/4.0/deed"
# Replace `Your Name` with your name and `CC BY-SA 4.0` with the name of the license you want
copyright = "© $YEAR Your Name | [CC BY-SA 4.0]($LICENSE_URL)"
# privacy_policy_url = "$BASE_URL/privacy-policy/"
# terms_of_service_url = "$BASE_URL/terms-of-service/"
# search_page_url = "$BASE_URL/search/"
Expand Down
5 changes: 2 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ social = [
]

[extra.footer]
author_name = "Linkita"
since = 2020
license_name = "CC BY-SA 4.0"
license_url = "https://creativecommons.org/licenses/by-sa/4.0/deed"
license_url = "https://creativecommons.org/licenses/by-sa/4.0/"
copyright = "© $YEAR Linkita | [CC BY-SA 4.0]($LICENSE_URL)"

[extra.languages]

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
},
"scripts": {
"dev": "pnpm tailwindcss -i ./static/app.css -o ./static/main.css --watch",
"build": "pnpm tailwindcss -i ./static/app.css -o ./static/main.css",
"build": "pnpm tailwindcss -i ./static/app.css -o ./static/main.css --minify",
"switch-to-latest": "git checkout tags/v${npm_package_version}",
"windows-switch-to-latest": "git checkout tags/v%npm_package_version%"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.15",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"tailwindcss": "^3.4.14"
"tailwindcss": "^3.4.14",
"terser": "^5.36.0"
}
}
54 changes: 54 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion static/js/linkita.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(function () {
const htmlClass = document.documentElement.classList;
const themeColorTag = document.head.querySelector('meta[name="theme-color"]');
const darkScheme = window.matchMedia("(prefers-color-scheme: dark)");

function applyDarkMode(isDark, doDispatchEvent) {
if (isDark) {
Expand All @@ -18,7 +19,6 @@
}

function initDarkMode() {
const darkScheme = window.matchMedia("(prefers-color-scheme: dark)");
const darkVal = localStorage.getItem("dark");
if (darkVal) {
applyDarkMode(darkVal === "dark", false);
Expand All @@ -41,6 +41,11 @@
localStorage.setItem("dark", isDark ? "dark" : "light");
}

function resetDarkMode() {
localStorage.removeItem("dark");
applyDarkMode(darkScheme.matches, true);
}

function initTranslationsButton(btn) {
let userLanguages = [];
if (navigator.languages) {
Expand Down Expand Up @@ -100,6 +105,7 @@
window.linkita = {
applyDarkMode: applyDarkMode,
toggleDarkMode: toggleDarkMode,
resetDarkMode: resetDarkMode,
initTranslationsButton: initTranslationsButton,
toggleHeaderMenu: toggleHeaderMenu,
initKatex: initKatex,
Expand Down
Loading

0 comments on commit 84aa7a4

Please sign in to comment.