fixed but with image zoom

This commit is contained in:
Nuno Coração 2022-09-12 13:36:52 +01:00
parent 11320067eb
commit a74044911e
10 changed files with 76 additions and 28 deletions

View file

@ -1,6 +0,0 @@
# Changelog
All notable changes to Blowfish will be documented in this file. Things that need particular attention when upgrading from a prior version are marked ⚠️.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

View file

@ -6,3 +6,52 @@ Personal Website & Blog Theme for Hugo
based on Congo
git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish
- only one header
Firebase
1. create account
2. create project
3. select analytics
4. Setup firebase
```
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyB5tqlqDky77Vb4Tc4apiHV4hRZI18KGiY",
authDomain: "blowfish-21fff.firebaseapp.com",
projectId: "blowfish-21fff",
storageBucket: "blowfish-21fff.appspot.com",
messagingSenderId: "60108104191",
appId: "1:60108104191:web:039842ebe1370698b487ca",
measurementId: "G-PEDMYR1V0K"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
```
5. Setup Firestore - Build > Firestore - create database - start production mode - select server - wait - rules
```
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
```
5. Toggle guest authorization - Build > Authentication - Get Started - Anonymous - toggle - Save
6. Get values
7. copy into params.toml
8. Enjoy - activate views

View file

@ -1,9 +1,3 @@
mediumZoom(document.querySelectorAll("img:not(.nozoom)"), {
margin: 24,
background: 'rgba(0,0,0,0.5)',
scrollOffset: 0,
})
if (typeof auth !== 'undefined') {
var viewsCollection = db.collection('views');

View file

@ -13,7 +13,7 @@ summaryLength = 30
buildDrafts = false
buildFuture = false
googleAnalytics = "G-XXXXXX"
googleAnalytics = "G-PEDMYR1V0K"
[sitemap]
changefreq = 'daily'

View file

@ -58,13 +58,13 @@ mainSections = ["posts", "suggest", "external"]
showTermCount = true
[firebase]
apiKey = "AIzaSyAN9vJzbGcqXi3fCiakI8rCVV7-S6T8n4s"
authDomain = "homepage-a0c38.firebaseapp.com"
projectId = "homepage-a0c38"
storageBucket = "homepage-a0c38.appspot.com"
messagingSenderId = "722874298820"
appId = "1:722874298820:web:b5c0e707586eba68c43491"
measurementId = "G-H8CSEYZFG4"
apiKey = "AIzaSyB5tqlqDky77Vb4Tc4apiHV4hRZI18KGiY"
authDomain = "blowfish-21fff.firebaseapp.com"
projectId = "blowfish-21fff"
storageBucket = "blowfish-21fff.appspot.com"
messagingSenderId = "60108104191"
appId = "1:60108104191:web:039842ebe1370698b487ca"
measurementId = "G-PEDMYR1V0K"
[fathomAnalytics]
# site = "ABC12345"

View file

@ -8,10 +8,13 @@ article:
one: "{{ .Count }} minuto"
other: "{{ .Count }} minutos"
reading_time_title: "Tempo de leitura"
# table_of_contents: "Table of Contents"
# word_count:
# one: "{{ .Count }} word"
# other: "{{ .Count }} words"
table_of_contents: "Tabela de conteúdos"
word_count:
one: "{{ .Count }} palavra"
other: "{{ .Count }} palavras"
views:
one: "{{ .Count }} visualização"
other: "{{ .Count }} visualizaçōes"
author:
byline_title: "Autor"

View file

@ -12,6 +12,9 @@ article:
word_count:
one: "{{ .Count }} palavra"
other: "{{ .Count }} palavras"
views:
one: "{{ .Count }} visualização"
other: "{{ .Count }} visualizaçōes"
author:
byline_title: "Autor"

View file

@ -40,6 +40,13 @@
{{ end }}
</div>
<script>
mediumZoom(document.querySelectorAll("img:not(.nozoom)"), {
margin: 24,
background: 'rgba(0,0,0,0.5)',
scrollOffset: 0,
})
</script>
{{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsProcess.RelPermalink }}" integrity="{{ $jsProcess.Data.Integrity }}"></script>

View file

@ -124,8 +124,6 @@
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
{{/* Firebase */}}
<script>console.log( {{ .Site.Params.firebase.apiKey }})</script>
{{ with $.Site.Params.firebase }}
{{ if isset $.Site.Params "firebase" }}
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>

View file

@ -8,7 +8,7 @@
"assets": "rimraf assets/vendor && vendor-copy",
"dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w",
"build": "NODE_ENV=production ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --minify -s exampleSite --themesDir ../.. -d ../docs --baseURL https://nunocoracao.github.io/blowfish/",
"example": "hugo server --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/ -p 1313",
"example": "hugo server --minify --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/ -p 1313",
"lighthouse": "lhci autorun"
},
"repository": {