Skip to content

Commit

Permalink
Various fixes (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohandebsarkar committed Aug 23, 2024
2 parents 336533b + f88029e commit 2eb0d35
Show file tree
Hide file tree
Showing 20 changed files with 138 additions and 93 deletions.
9 changes: 0 additions & 9 deletions assets/css/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ html {
scroll-behavior: smooth;
}

a {
font-weight: 500;
text-decoration: underline;

&:hover {
color: var(--global-theme-color);
}
}

#TableOfContents {
ul {
li {
Expand Down
7 changes: 7 additions & 0 deletions assets/css/distill.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ a {
color: currentColor;
}

span .katex {
color: var(--global-text-color-primary) !important;
}

d-byline {
border-top-color: var(--global-divider-color) !important;
}
Expand Down Expand Up @@ -59,6 +63,9 @@ d-article {
b i {
display: inline;
}
ul li {
list-style: disc;
}

d-contents {
align-self: start;
Expand Down
15 changes: 15 additions & 0 deletions assets/css/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
a {
@apply text-theme;
@apply hover:underline;
}

nav a {
@apply text-primary;
}

.social a {
@apply text-primary;
}
}
3 changes: 3 additions & 0 deletions assets/svg/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 22 additions & 14 deletions exampleSite/config/_default/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ email: einstein@example.org

description: Albert Einstein's personal website powered by the Academic Folio theme

favicon: ⚛️ # You can either enter an emoji or the name of an image file present in `assets/img` folder

footerText: >
Powered by <a href="https://gohugo.io">Hugo</a> with
<a href="https://github.com/rohandebsarkar/academic-folio">Academic Folio</a> theme
tags: # these tags would be added as keywords in metadata for website
- academic-folio
- academic-website
Expand All @@ -31,18 +37,20 @@ colorTheme: blue # choose a theme from `data/themes` folder

giscusScript: >
<script src="https://giscus.app/client.js"
data-repo="rohandebsarkar/academic-folio"
data-repo-id="R_kgDOI0baIw"
data-category="Comments (giscus)"
data-category-id="DIC_kwDOI0baI84CWhyL"
data-mapping="og:title"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async
data-repo="rohandebsarkar/academic-folio"
data-repo-id="R_kgDOI0baIw"
data-category="Comments (giscus)"
data-category-id="DIC_kwDOI0baI84CWhyL"
data-mapping="og:title"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async
></script>
analyticsScript: >
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<header>
<header class="space-y-2">
<h1 class="text-4xl font-medium">
Page not found!
</h1>
Expand Down
5 changes: 4 additions & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
{{ partial "header" . }}

{{/* Main */}}
<main class="mt-24 md:mt-14 mb-12 md:mb-8 p-4 space-y-4">
<main class="mt-24 md:mt-14 mb-12 md:mb-8 px-4 py-8 space-y-8">
{{ block "main" . }}{{ end }}
</main>

{{/* Footer */}}
{{ partial "footer" . }}

{{/* Anlytics Script */}}
{{ safeHTML .Site.Params.analyticsScript }}
</body>
</html>
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<header>
<header class="space-y-2">
<h1 class="text-4xl font-medium">
{{ .Page.Title }}
</h1>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<header>
<header class="space-y-2">
<h1 class="text-4xl font-medium">
{{ .Page.Title }}
</h1>
Expand Down
6 changes: 6 additions & 0 deletions layouts/distill/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
{{ partial "distill/d-appendix" . }}

{{ partial "footer" . }}

{{ if (and .Site.Params.giscusScript (not .Params.disableGiscusComments)) }}
<div id="comments" class="max-w-[800px] mx-auto mb-8 pb-8">
{{ partial "scripts/giscus" . }}
</div>
{{ end }}
</body>

</html>
44 changes: 26 additions & 18 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<header>
<header class="space-y-2">
<h1 class="text-4xl font-medium">
{{ if (or .Site.Params.firstName .Site.Params.middleName .Site.Params.lastName) }}
<span class="font-bold">{{ .Site.Params.firstName }}</span>
Expand All @@ -11,23 +11,27 @@ <h1 class="text-4xl font-medium">

{{ with .Site.Params.description }}
<h2 class="font-medium">
{{ . }}
{{ safeHTML . }}
</h2>
{{ end }}
</header>

<figure class="sm:float-right w-3/4 sm:w-1/3 md:w-1/4 mx-auto sm:ml-4 space-y-2">
<figure class="sm:float-right w-3/4 md:w-1/4 sm:w-1/3 mx-auto sm:ml-4 space-y-4">
{{ with resources.Get (printf "img/%s" .Params.profPic) }}
{{ partial "img" (dict "img" . "class" "rounded" "alt" .RelPermalink) }}
{{ if (strings.HasSuffix . ".svg") }}
<object data="{{ .RelPermalink }}" type="image/svg+xml" width="auto" height="auto" title="{{ .RelPermalink }}"></object>
{{ else }}
{{ partial "img" (dict "img" . "class" "rounded" "alt" .RelPermalink) }}
{{ end }}
{{ end }}

<address class="font-medium text-center">
<address class="font-medium text-center space-y-2">
{{ with .Site.Params.email }}
{{ partial "scripts/cloakemail" . }}
{{ end }}

{{ if (and .Site.Params.socialHomePage .Site.Menus.social) }}
<div class="text-2xl overflow-auto">
<div class="text-3xl overflow-auto">
{{ partial "social" . }}
</div>
{{ end }}
Expand All @@ -40,17 +44,21 @@ <h2 class="font-medium">
</article>
{{ end }}

<article class="space-y-1">
<h3 class="text-2xl">
<a href="/news/" class="text-primary font-semibold no-underline">Recent News</a>
</h3>
{{ partial "news/recents" . }}
</article>
{{ if .Site.Params.showRecentNews }}
<article class="space-y-1">
<h3 class="text-2xl">
<a href="/news/" class="text-primary font-semibold no-underline">Recent News</a>
</h3>
{{ partial "news/recents" . }}
</article>
{{ end }}

<article class="space-y-1">
<h3 class="text-2xl">
<a href="/posts/" class="text-primary font-semibold no-underline">Recent Posts</a>
</h3>
{{ partial "posts/recents" . }}
</article>
{{ if .Site.Params.showRecentPosts }}
<article class="space-y-1">
<h3 class="text-2xl">
<a href="/posts/" class="text-primary font-semibold no-underline">Recent Posts</a>
</h3>
{{ partial "posts/recents" . }}
</article>
{{ end }}
{{ end }}
7 changes: 3 additions & 4 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<footer class="fixed inset-x-0 bottom-0 p-2 bg-footer text-primary text-center text-xs font-light border-t border-divider">
<footer class="fixed inset-x-0 bottom-0 p-2 bg-footer text-primary text-center text-xs border-t border-divider">
{{ with .Site.Copyright }}
{{ . }}
{{ end }}
&bull;
Powered by <a href="https://gohugo.io">Hugo</a> with
<a href="https://github.com/rohandebsarkar/academic-folio">Academic Folio</a> theme
{{ end }}
{{ safeHTML .Site.Params.footerText }}
{{ if .Site.Params.footerLastUpdated }}
&bull;
Last updated: {{ now.Format "02 Jan 2006"}}
Expand Down
10 changes: 10 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
{{ end }}
</title>

{{ if not (strings.Contains .Site.Params.favicon ".") }}
{{ with resources.Get "svg/favicon.svg" | resources.ExecuteAsTemplate "favicon.svg" . }}
<link rel="shortcut icon" href="{{ .RelPermalink }}" type="image/svg+xml">
{{ end }}
{{ else }}
{{ with resources.Get (printf "%s%s" "img/" .Site.Params.favicon) | resources.Copy .Site.Params.favicon }}
<link rel="shortcut icon" href="{{ .RelPermalink }}" type='{{ if strings.HasSuffix . ".svg" }}image/svg+xml{{ else }}image/x-icon{{ end }}'>
{{ end }}
{{ end }}

{{/* Canonical URL */}}
<link rel="canonical" href="{{ .Permalink }}">

Expand Down
6 changes: 2 additions & 4 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<nav class="mx-auto p-4 text-base font-medium flex md:flex-row flex-col">
<ul class="flex flex-row">
<li>
{{ if (and .Site.Params.navbarTitle (ne .Site.Title (printf "%s %s" .Site.Params.firstName .Site.Params.lastName))) }}
<a class="whitespace-nowrap font-bold no-underline" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
{{ end }}
<a class="whitespace-nowrap font-bold no-underline" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</li>
{{ if (and .Site.Params.socialNavbar (not .IsHome)) }}
<li class="ml-auto pl-4 text-[1.25em] overflow-x-auto overflow-y-hidden">
Expand Down Expand Up @@ -37,7 +35,7 @@
</li> */}}
{{ else }}
<li>
<a href="{{ .URL }}" class="whitespace-nowrap no-underline {{ if eq $currentPage.RelPermalink .URL }}text-theme{{ end }}">
<a href="{{ safeURL .URL }}" {{ if (or (strings.HasPrefix .URL "http") (strings.HasSuffix .URL ".pdf")) }} target="_blank" rel="external nofollow noopener"{{ end }} class="whitespace-nowrap no-underline {{ if eq $currentPage.RelPermalink .URL }}text-theme{{ end }}">
{{ .Name }}
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="list border-t border-dashed">
<ul class="list border-t border-dashed border-divider">
{{ range .Pages }}
<li class="py-4 space-y-2 border-b border-dashed">
<li class="py-4 space-y-2 border-b border-dashed border-divider">
<hgroup>
<h3>
<a class="text-2xl font-medium text-primary no-underline" href="{{ .RelPermalink }}">
Expand Down
38 changes: 18 additions & 20 deletions layouts/partials/news/recents.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<!-- You can change blog to anything else and build recent item for that thing -->
{{ if .Site.Params.showRecentNews }}
<table class="text-left">
<tbody>
{{ range ( where .Site.RegularPages "Type" "news" | first .Site.Params.recentNews ) }}
<tr>
<th class="pr-2 py-1">
{{ .Date.Format "January 02, 2006" }}
</th>
<td class="pl-2 py-1">
{{ if .Content }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
<span class="font-medium">{{ .Title }}</span>
{{ end }}
</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
<table class="text-left">
<tbody>
{{ range ( where .Site.RegularPages "Type" "news" | first .Site.Params.recentNews ) }}
<tr>
<th class="pr-2 py-1">
{{ .Date.Format "January 02, 2006" }}
</th>
<td class="pl-2 py-1">
{{ if .Content }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ else }}
<span class="font-medium">{{ .Title }}</span>
{{ end }}
</td>
</tr>
{{ end }}
</tbody>
</table>
30 changes: 14 additions & 16 deletions layouts/partials/posts/recents.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<!-- You can change blog to anything else and build recent item for that thing -->
{{ if .Site.Params.showRecentPosts }}
<table class="text-left">
<tbody>
{{ range ( where .Site.RegularPages "Type" "posts" | first .Site.Params.recentPosts ) }}
<tr>
<th class="pr-2 py-1">
{{ .Date.Format "January 02, 2006" }}
</th>
<td class="pl-2 py-1">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
<table class="text-left">
<tbody>
{{ range ( where .Site.RegularPages "Type" "posts" | first .Site.Params.recentPosts ) }}
<tr>
<th class="pr-2 py-1">
{{ .Date.Format "January 02, 2006" }}
</th>
<td class="pl-2 py-1">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</td>
</tr>
{{ end }}
</tbody>
</table>
2 changes: 1 addition & 1 deletion layouts/partials/social.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ul class="flex flex-row flex-nowrap space-x-4 justify-center">
<ul class="social flex flex-row flex-nowrap space-x-4 justify-center">
{{ $currentPage := . }}
{{ range .Site.Menus.social }}
<li>
Expand Down
1 change: 1 addition & 0 deletions layouts/shortcodes/html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{.Inner}}
2 changes: 1 addition & 1 deletion static/tailwind.css

Large diffs are not rendered by default.

0 comments on commit 2eb0d35

Please sign in to comment.