Compare commits

...

33 Commits

Author SHA1 Message Date
Nuno Coração
0f262e87d8 Merge pull request #306 from nunocoracao/dev
🚀 v2.18.0 release
2022-12-13 09:09:22 +00:00
Nuno Coração
76eb6699be Merge pull request #323 from nunocoracao/305-update-blowfish-main-website-to-leverage-these-features
🍱 Update blowfish main website to leverage new features
2022-12-13 09:07:07 +00:00
Nuno Coração
07bfb8ab71 🍱 Update blowfish main website to use new features 2022-12-13 09:06:37 +00:00
Nuno Coração
a9ec7aa71f Merge pull request #322 from nunocoracao/304-update-documentation-for-the-new-use-cases
📝 Update documentation for the new use-cases
2022-12-13 09:04:18 +00:00
Nuno Coração
fd3598209c 📝 Update documentation for the new use-cases 2022-12-13 09:03:37 +00:00
Nuno Coração
adec3dae1a Merge pull request #321 from nunocoracao/311-term-add-card-view
Term add card view
2022-12-12 23:27:22 +00:00
Nuno Coração
b2045506dc Term add card view 2022-12-12 23:26:43 +00:00
Nuno Coração
5d5dcaa7f8 Merge pull request #320 from nunocoracao/309-term-add-hero-image
Term add hero image
2022-12-12 23:17:52 +00:00
Nuno Coração
88b8647fb7 Term add hero image 2022-12-12 23:17:14 +00:00
Nuno Coração
c40b75a601 Merge pull request #319 from nunocoracao/310-term-add-likes-and-views
Term add likes and views
2022-12-12 23:05:10 +00:00
Nuno Coração
8b132ffa0e Term add likes and views 2022-12-12 23:04:27 +00:00
Nuno Coração
f4b5413c05 Merge pull request #318 from nunocoracao/312-taxonomy-add-hero-image
Taxonomy add hero image
2022-12-12 22:59:17 +00:00
Nuno Coração
07055a2934 Taxonomy add hero image 2022-12-12 22:58:42 +00:00
Nuno Coração
6fd8de1edc Merge pull request #317 from nunocoracao/316-recycle-refactor-articles-and-list-to-use-pagejs-logic-instead-of-inline-js
♻️ refactor articles and list to use page.js logic instead of inline js
2022-12-12 22:43:44 +00:00
Nuno Coração
8171739c7e ♻️ refactor articles and list to use page.js logic instead of inline js 2022-12-12 22:43:05 +00:00
Nuno Coração
9a56be903f Merge pull request #315 from nunocoracao/313-taxonomy-add-likes-and-views
Taxonomy add likes and views
2022-12-12 22:35:20 +00:00
Nuno Coração
3034722b47 Taxonomy add likes and views 2022-12-12 22:34:28 +00:00
Nuno Coração
e448f06d3f Merge pull request #308 from nunocoracao/301-add-default-values-to-the-above-new-sections-in-paramstoml
🔧 Add default values to the above new sections in params.toml
2022-12-12 22:11:54 +00:00
Nuno Coração
2e222bf5aa 🔧 Add default values to the above new sections in params.toml 2022-12-12 22:11:21 +00:00
Nuno Coração
1c5ff0957b Merge pull request #307 from nunocoracao/300-add-relevant-parameters-to-paramstoml-file-for-both-taxonomy-and-term
🎨 Add relevant parameters to params.toml file for both taxonomy and term
2022-12-12 22:07:49 +00:00
Nuno Coração
3da417f6c9 🎨 Add relevant parameters to params.toml file for both taxonomy and term 2022-12-12 22:07:14 +00:00
Nuno Coração
b391a94c89 🔖 updated theme version 2022-12-12 21:58:14 +00:00
Nuno Coração
d62cf93865 Merge pull request #299 from nunocoracao/dev
Release v2.17.1
2022-12-12 21:40:57 +00:00
Nuno Coração
c2f5d25c4f updated theme version 2022-12-12 21:39:34 +00:00
Nuno Coração
2bc2c8c78c Merge pull request #298 from nunocoracao/297-prev-next-article-links-in-mobile-something-get-stuck-together
💄 add margin to article pagination links
2022-12-12 21:37:57 +00:00
Nuno Coração
738f8ee4cc added margin to article pagination links 2022-12-12 21:36:54 +00:00
Nuno Coração
e275c96fd2 Merge pull request #296 from krishna-santosh/main
💄 add margin-bottom to 'the-top' element
2022-12-12 21:24:01 +00:00
Krishna Santosh
16bc8cf841 fix: moved Tags Authors to left in mobile view 2022-12-12 22:04:33 +05:30
Krishna Santosh
2f053a7279 fix: add margin-bottom to 'the-top' element 2022-12-11 18:52:41 +05:30
Krishna Santosh
38bcea0e0a fix: add margin-bottom to the-top element 2022-12-11 18:28:14 +05:30
Nuno Coração
6c0d09ae8c Merge pull request #290 from mztiq/patch-1
Update index.md
2022-12-11 11:14:09 +00:00
mztiq
c246397a21 Update index.md 2022-12-10 02:21:04 +01:00
Nuno Coração
74be52e151 small fix in users page 2022-12-09 11:12:50 +00:00
21 changed files with 410 additions and 261 deletions

View File

@@ -1306,6 +1306,10 @@ select {
margin-bottom: 3rem;
}
.mb-16 {
margin-bottom: 4rem;
}
.mt-5 {
margin-top: 1.25rem;
}

106
assets/js/page.js Normal file
View File

@@ -0,0 +1,106 @@
var liked_page = false
if (typeof auth !== 'undefined') {
var id = oid ? oid.replaceAll("/", "-") : oid
var viewed = localStorage.getItem(id);
if (!viewed) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('views').doc(id)
localStorage.setItem(id, true);
docRef.get().then((doc) => {
if (doc.exists) {
db.collection('views').doc(id).update({
views: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('views').doc(id).set({ views: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
var liked = localStorage.getItem(id_likes);
if (liked) {
liked_page = true
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
}
}
function like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_page = true
localStorage.setItem(id_likes, true);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function remove_like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_page = false
localStorage.removeItem(id_likes);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like"
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(-1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 0 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function process_article() {
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
if (!liked_page) {
like_article(id_likes)
} else {
remove_like_article(id_likes)
}
}

View File

@@ -15,6 +15,8 @@ enableCodeCopy = true
# mainSections = ["section1", "section2"]
# robots = ""
#defaultBackgroundImage = "IMAGE.jpg" # used as default for background images
[header]
layout = "basic" # valid options: basic, fixed
@@ -83,6 +85,24 @@ enableCodeCopy = true
[taxonomy]
showTermCount = true
#showHero = true
#heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
#showViews = false
#showLikes = false
#showTableOfContents = true
#cardView = false
[term]
#showHero = true
#heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
#showViews = false
#showLikes = false
#showTableOfContents = true
#groupByYear = false
#cardViewScreenWidth = false
#cardView = false
[firebase]
# apiKey = "XXXXXX"

View File

@@ -15,6 +15,8 @@ enableCodeCopy = true
mainSections = ["docs"]
# robots = ""
defaultBackgroundImage = "/img/iceland.jpg"
[header]
layout = "fixed" # valid options: basic, fixed
@@ -82,6 +84,24 @@ mainSections = ["docs"]
[taxonomy]
showTermCount = true
showHero = true
heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
showViews = true
showLikes = true
showTableOfContents = true
[term]
showHero = true
heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
showBreadcrumbs = false
showViews = true
showLikes = true
showTableOfContents = true
groupByYear = false
cardView = false
cardViewScreenWidth = false
[firebase]
apiKey = "AIzaSyB5tqlqDky77Vb4Tc4apiHV4hRZI18KGiY"

View File

@@ -193,6 +193,21 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `list.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. |
| `sitemap.excludedKinds` | `["taxonomy", "term"]` | Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values. |
| `taxonomy.showTermCount` | `true` | Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing. |
| `taxonomy.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each taxonomy page. |
| `taxonomy.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. |
| `taxonomy.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the taxonomy header. |
| `taxonomy.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. |
| `taxonomy.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. |
| `taxonomy.showTableOfContents` | `false` | Whether or not the table of contents is displayed on taxonomies. |
| `term.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each term page. |
| `term.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. |
| `term.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the term header. |
| `term.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. |
| `term.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. |
| `term.showTableOfContents` | `false` | Whether or not the table of contents is displayed on terms. |
| `term.groupByYear` | `false` | Whether or not articles are grouped by year on term pages. |
| `term.cardView` | `false` | Display lists as a gallery of cards. |
| `term.cardViewScreenWidth` | `false` | Enhance the width of card galleries in lists to take the full width available. |
| `firebase.apiKey` | _Not set_ | Firebase apiKey, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish. |
| `firebase.authDomain` | _Not set_ | Firebase authDomain, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish. |
| `firebase.projectId` | _Not set_ | Firebase projectId, required to integrate against Firebase. Check [this page]({{< ref "firebase-views" >}}) for a guide on how to integrate Firebase into Blowfish. |

View File

@@ -1,5 +1,5 @@
---
title: advanced
title: Advanced
---
This is the advanced tag. Just like other listing pages in Blowfish, you can add custom content to individual taxonomy terms and it will be displayed at the top of the term listing. :rocket:

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

View File

@@ -9,8 +9,9 @@ showDate: false
showAuthor: true
showReadingTime: false
showEdit: false
layoutBackgroundHeaderSpace: false
---
{{< lead >}}
Real websites that are built with Blowfish.
@@ -45,9 +46,18 @@ Real websites that are built with Blowfish.
| [insidemordecai.com](https://insidemordecai.com) | Personal site |
| [sajayprakash.com](https://sajayprakash.com) | Personal site |
| [jamesdixon.dev](https://jamesdixon.dev) | Personal site |
| [blastomussa.dev](https://blastomussa.dev) | Personal site |
| [cdell.io](https://cdell.io) | Personal site |
| [jam.dsg.li](https://jam.dsg.li) | Organization site |
| [priyakdey.com](https://priyakdey.com) | Personal site |
| [sdehm.dev](https://sdehm.dev) | Personal site |
| [dizzytech.de](https://dizzytech.de) | Personal site |
{{< alert >}}
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users.md).
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users/index.md).
{{</ alert >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

View File

@@ -28,7 +28,7 @@
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 200) }}
<div class="pointer-events-none absolute top-[100vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<a href="#the-top"
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
aria-label="{{ i18n " nav.scroll_to_top_title" }}" title="{{ i18n " nav.scroll_to_top_title" }}">
&uarr;
</a>
@@ -46,4 +46,4 @@
data-id="{{ .Site.Params.buymeacoffee.identifier }}" data-description="Support me on Buy me a coffee!" data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}"
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}" data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}" data-x_margin="18" data-y_margin="18"></script>
{{ end }}
</html>
</html>

View File

@@ -36,120 +36,12 @@
{{ .Content | emojify }}
</div>
<script>
var liked_article = false
if (typeof auth !== 'undefined') {
var oid = "views_{{ .File.Path }}"
var id = oid ? oid.replaceAll("/", "-") : oid
var viewed = localStorage.getItem(id);
if (!viewed) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('views').doc(id)
localStorage.setItem(id, true);
docRef.get().then((doc) => {
if (doc.exists) {
db.collection('views').doc(id).update({
views: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('views').doc(id).set({ views: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
var liked = localStorage.getItem(id_likes);
if (liked) {
liked_article = true
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
}
}
function like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_article = true
localStorage.setItem(id_likes, true);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function remove_like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_article = false
localStorage.removeItem(id_likes);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like"
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(-1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 0 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function process_article() {
var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
if (!liked_article) {
like_article(id_likes)
} else {
remove_like_article(id_likes)
}
}
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</section>
{{ if gt .Pages 0 }}
@@ -168,9 +60,7 @@
{{ end }}
{{ end }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
<h2 class="mt-12 mb-5 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
@@ -239,5 +129,4 @@
{{ partial "pagination.html" . }}
{{ end }}
{{ end }}

View File

@@ -38,120 +38,12 @@
{{ partial "series-closed.html" . }}
</div>
<script>
var liked_article = false
if (typeof auth !== 'undefined') {
var oid = "views_{{ .File.Path }}"
var id = oid ? oid.replaceAll("/", "-") : oid
var viewed = localStorage.getItem(id);
if (!viewed) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('views').doc(id)
localStorage.setItem(id, true);
docRef.get().then((doc) => {
if (doc.exists) {
db.collection('views').doc(id).update({
views: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('views').doc(id).set({ views: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
var liked = localStorage.getItem(id_likes);
if (liked) {
liked_article = true
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
}
}
function like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_article = true
localStorage.setItem(id_likes, true);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = ""
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 1 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function remove_like_article(id_likes) {
auth.signInAnonymously()
.then(() => {
var docRef = db.collection('likes').doc(id_likes)
docRef.get().then((doc) => {
liked_article = false
localStorage.removeItem(id_likes);
document.querySelectorAll("span[id='likes_button_heart']")[0].style.display = "none"
document.querySelectorAll("span[id='likes_button_emtpty_heart']")[0].style.display = ""
document.querySelectorAll("span[id='likes_button_text']")[0].innerText = "\xa0Like"
if (doc.exists) {
db.collection('likes').doc(id_likes).update({
likes: firebase.firestore.FieldValue.increment(-1)
});
} else {
db.collection('likes').doc(id_likes).set({ likes: 0 })
}
}).catch((error) => {
console.log("Error getting document:", error);
});
})
.catch((error) => {
var errorCode = error.code;
var errorMessage = error.message;
console.error(errorCode, errorMessage)
});
}
function process_article() {
var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
if (!liked_article) {
like_article(id_likes)
} else {
remove_like_article(id_likes)
}
}
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</section>
<footer class="pt-8 max-w-prose print:hidden">

View File

@@ -1,9 +1,26 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.taxonomy.showHero | default false }}
{{ $heroStyle := print "partials/hero/" .Site.Params.taxonomy.heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta-taxonomy.html" (dict "context" . "scope" "single") }}
</div>
</header>
{{ if .Content }}
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
@@ -12,6 +29,13 @@
</div>
</section>
{{ end }}
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
<section class="flex flex-wrap max-w-prose -mx-2 overflow-hidden">
{{ range .Data.Terms }}
<article class="w-full px-2 my-3 overflow-hidden sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/4">

View File

@@ -1,9 +1,26 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "partials/hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta-term.html" (dict "context" . "scope" "single") }}
</div>
</header>
{{ if .Content }}
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
@@ -12,18 +29,98 @@
</div>
</section>
{{ end }}
<section class="mt-5 space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<hr class="border-dotted w-36 border-neutral-400" />
{{ end }}
{{ range .Pages }}
{{ partial "article-link.html" . }}
{{ end }}
{{ end }}
</section>
{{ partial "pagination.html" . }}
{{ end }}
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ if gt .Pages 0 }}
{{ if .Params.cardView | default (.Site.Params.term.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth}}
{{ if not $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
{{ if $cardViewScreenWidth }}
<section class="relative w-screen" style="left: calc(-50vw + 50%);">
<div class="flex flex-wrap pl-8 pr-8">
{{ else }}
<section class="w-full">
<div class="flex flex-wrap">
{{ end }}
{{ end }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
<h2 class="mt-12 mb-5 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ else }}
{{ end }}
{{ if $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
{{ if $cardViewScreenWidth}}
<section class="relative w-screen" style="left: calc(-50vw + 50%);">
<div class="flex flex-wrap pl-8 pr-8">
{{ else }}
<section class="w-full">
<div class="flex flex-wrap">
{{ end }}
{{ end }}
{{ range .Pages }}
{{ if $cardViewScreenWidth }}
<div class="flex flex-wrap w-full p-4 sm:w-1/2 md:w-1/3 xl:w-1/4 2xl:w-1/5">
{{ else }}
<div class="flex flex-wrap w-full p-4 sm:w-1/2 md:w-1/3">
{{ end }}
{{ partial "article-link-card.html" . }}
</div>
{{ end }}
{{ if $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
</div>
</section>
{{ end }}
{{ end }}
{{ if not $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
</div>
</section>
{{ end }}
{{ else }}
<section class="space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $.Params.groupByYear | default ($.Site.Params.term.groupByYear | default true) }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ end }}
{{ range .Pages }}
{{ partial "article-link.html" . }}
{{ end }}
{{ end }}
</section>
{{ end }}
{{ else }}
<section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t">
<em>{{ i18n "list.no_articles" | emojify }}</em>
</p>
</section>
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@@ -1,6 +1,6 @@
{{ $articleClasses := "flex flex-wrap article" }}
{{ if .Site.Params.list.showCards }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md") " " }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md backdrop-blur") " " }}
{{ else }}
{{ $articleClasses = delimit (slice $articleClasses "") " " }}
{{ end }}

View File

@@ -0,0 +1,36 @@
{{/* Determine the correct context and scope */}}
{{/* This allows for different logic depending on where the partial is called */}}
{{ $context := . }}
{{ $scope := default nil }}
{{ if (reflect.IsMap . ) }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" }}
{{ end }}
</div>
{{ end }}

View File

@@ -0,0 +1,36 @@
{{/* Determine the correct context and scope */}}
{{/* This allows for different logic depending on where the partial is called */}}
{{ $context := . }}
{{ $scope := default nil }}
{{ if (reflect.IsMap . ) }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" }}
{{ end }}
</div>
{{ end }}

View File

@@ -11,7 +11,7 @@
<div class="flex justify-between pt-3">
<span>
{{ if $prev }}
<a class="flex group" href="{{ $prev.RelPermalink }}">
<a class="flex group mr-3" href="{{ $prev.RelPermalink }}">
<span
class="mr-3 text-neutral-700 group-hover:text-primary-600 ltr:inline rtl:hidden dark:text-neutral dark:group-hover:text-primary-400"
>&larr;</span
@@ -36,7 +36,7 @@
</span>
<span>
{{ if $next }}
<a class="flex text-right group" href="{{ $next.RelPermalink }}">
<a class="flex text-right group ml-3" href="{{ $next.RelPermalink }}">
<span class="flex flex-col">
<span
class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"

View File

@@ -2,10 +2,10 @@
{{/* Footer menu */}}
{{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }}
<nav class="pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }}
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<li class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="{{ .URL }}"
title="{{ .Title }}">{{ .Name | markdownify | emojify }}</a>
</li>

View File

@@ -1,6 +1,6 @@
{
"name": "hugo-blowfish-theme",
"version": "2.17.0",
"version": "2.18.0",
"description": "Blowfish theme for Hugo",
"scripts": {
"fullinstall": "npm run preinstall && npm install && npm run postinstall",