Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f411349c20 | |||
| f0d7967d33 | |||
| 8f90faf8dc | |||
| 66028185e6 | |||
| b74eb25d6a | |||
| 413eb0ff30 | |||
| bedb8ba1ca | |||
| 185202fc81 | |||
| 6da06e4755 | |||
| c68ff46e73 | |||
| 5921485a10 | |||
| 7d826646dc | |||
| e3f3528262 | |||
| 6944931cdd | |||
| ea22cf364b | |||
| 009f58d863 | |||
| 63cb28aa72 | |||
| b783b1b224 | |||
| 7b38dc4602 | |||
| 2cb88d74e5 | |||
| f457fc4874 | |||
| 6d1ebbace5 | |||
| 0d95181b63 | |||
| efc0918ad7 | |||
| f08cc9e736 | |||
| fdd628c9cd | |||
| 6b22957c7c | |||
| 88afcb3b0c | |||
| 80e9a7971b | |||
| 5a872cf17a | |||
| 0959b9c3af | |||
| 143b5f6fb3 | |||
| fb91257cfb | |||
| 9d51f4113e |
+1
-1
@@ -16,4 +16,4 @@ hugo.darwin
|
||||
hugo.linux
|
||||
|
||||
# Temporary lock file while building
|
||||
/.hugo_build.lock
|
||||
.hugo_build.lock
|
||||
|
||||
+59
-35
@@ -3,9 +3,17 @@ languageCode: "en-us"
|
||||
title: "Hugo Profile"
|
||||
theme: hugo-profile
|
||||
|
||||
outputs:
|
||||
home:
|
||||
- "HTML"
|
||||
- "RSS"
|
||||
- "JSON"
|
||||
page:
|
||||
- "HTML"
|
||||
- "RSS"
|
||||
|
||||
Paginate: 3
|
||||
disqusShortname: gurusabarish
|
||||
googleAnalytics: G-DWJJVE27WD
|
||||
enableRobotsTXT: true
|
||||
|
||||
markup:
|
||||
goldmark:
|
||||
@@ -19,13 +27,11 @@ Menus:
|
||||
title: Blog posts
|
||||
url: /blogs
|
||||
weight: 1
|
||||
|
||||
- identifier: gallery
|
||||
name: Gallery
|
||||
title: Blog posts
|
||||
url: /gallery
|
||||
weight: 2
|
||||
|
||||
#Dropdown menu
|
||||
# - identifier: dropdown
|
||||
# title: Example dropdown menu
|
||||
@@ -55,15 +61,23 @@ params:
|
||||
# Note the lack of "" in true, it should be of boolean type.
|
||||
useBootstrapCDN: false
|
||||
|
||||
# If you want to load dynamically responsive images from Cloudinary
|
||||
# This requires your images to be uploaded + hosted on Cloudinary
|
||||
# Uncomment and change YOUR_CLOUD_NAME to the Cloud Name in your Cloudinary console
|
||||
# cloudinary_cloud_name: "YOUR_CLOUD_NAME"
|
||||
|
||||
# Whether the fade animations on the home page will be enabled
|
||||
animate: true
|
||||
|
||||
theme:
|
||||
disableThemeToggle: false
|
||||
# disableThemeToggle: true
|
||||
# defaultTheme: "light" # dark
|
||||
|
||||
# font:
|
||||
# fontSize: 1.5rem # default: 1rem
|
||||
# fontWeight: 500 # default: 400
|
||||
# lineHeight: 1 # default: 1.5
|
||||
# textAlign: right # default: left
|
||||
font:
|
||||
fontSize: 1rem # default: 1rem
|
||||
fontWeight: 400 # default: 400
|
||||
lineHeight: 1.5 # default: 1.5
|
||||
textAlign: left # default: left
|
||||
|
||||
# color preference
|
||||
# color:
|
||||
@@ -83,18 +97,18 @@ params:
|
||||
# secondaryColor:
|
||||
|
||||
# If you want to customize the menu, you can change it here
|
||||
# navbar:
|
||||
# align: mx-auto # Left: ms-auto | center: mx-auto | right: me-auto | Default: ms-auto
|
||||
navbar:
|
||||
align: ms-auto # Left: ms-auto | center: mx-auto | right: me-auto | Default: ms-auto
|
||||
# brandLogo: "/logo.png" # Logo for the brand | default is the favicon variable
|
||||
# brandName: "Profile" # Brand name for the brand | default is the title variable
|
||||
|
||||
# menus:
|
||||
# disableAbout: true
|
||||
# disableExperience: true
|
||||
# disableEducation: true
|
||||
# disableProjects: true
|
||||
# disableAchievements: true
|
||||
# disableContact: true
|
||||
brandName: "Hugo Profile" # Brand name for the brand | default is the title variable
|
||||
disableSearch: false
|
||||
menus:
|
||||
disableAbout: false
|
||||
disableExperience: false
|
||||
disableEducation: false
|
||||
disableProjects: false
|
||||
disableAchievements: false
|
||||
disableContact: false
|
||||
|
||||
# Hero
|
||||
hero:
|
||||
@@ -109,6 +123,7 @@ params:
|
||||
name: "Resume"
|
||||
url: "#"
|
||||
download: true
|
||||
newPage: false
|
||||
socialLinks:
|
||||
fontAwesomeIcons:
|
||||
- icon: fab fa-github
|
||||
@@ -208,7 +223,7 @@ params:
|
||||
education:
|
||||
enable: true
|
||||
# title: "Custom Name"
|
||||
# index: true
|
||||
index: false
|
||||
items:
|
||||
- title: "Master of Business Administration"
|
||||
school:
|
||||
@@ -277,10 +292,10 @@ params:
|
||||
featured:
|
||||
name: Demo
|
||||
link: https://hugo-profile.netlify.app
|
||||
# badges:
|
||||
# - "Hugo"
|
||||
# - "Bootstrap"
|
||||
# - "Javascript"
|
||||
badges:
|
||||
- "Hugo"
|
||||
- "Bootstrap"
|
||||
- "Javascript"
|
||||
links:
|
||||
- icon: fa fa-envelope
|
||||
url: mailto:?subject=Hugo%20Profile%20Template&body=Check%20it%20out:%20https%3a%2f%2fhugo-profile.netlify.app%2fblog%2fmarkdown-syntax%2f
|
||||
@@ -295,9 +310,9 @@ params:
|
||||
featured:
|
||||
name: Demo
|
||||
link: https://django-converter.herokuapp.com
|
||||
# badges:
|
||||
# - "Django"
|
||||
# - "Bootstrap"
|
||||
badges:
|
||||
- "Django"
|
||||
- "Bootstrap"
|
||||
links:
|
||||
- icon: fab fa-github
|
||||
url: https://github.com/gurusabarish/converter
|
||||
@@ -308,10 +323,10 @@ params:
|
||||
featured:
|
||||
name: Demo V2
|
||||
link: https://hugo-profile-2.netlify.app
|
||||
# badges:
|
||||
# - "Hugo"
|
||||
# - "Bootstrap"
|
||||
# - "Javascript"
|
||||
badges:
|
||||
- "Hugo"
|
||||
- "Bootstrap"
|
||||
- "Javascript"
|
||||
links:
|
||||
- icon: fab fa-github
|
||||
url: https://github.com/gurusabarish/HugoProfileV2
|
||||
@@ -319,16 +334,25 @@ params:
|
||||
#Contact
|
||||
contact:
|
||||
enable: true
|
||||
#title: "Custom name"
|
||||
# title: "Custom Name"
|
||||
content: My inbox is always open. Whether you have a question or just want to say hi, I’ll try my best to get back to you!
|
||||
email: gurusabarisha@gmail.com
|
||||
btnName: Mail me
|
||||
|
||||
footer:
|
||||
# recentPosts: false
|
||||
recentPosts:
|
||||
path: "blogs"
|
||||
count: 3
|
||||
title: Recent Posts
|
||||
enable: true
|
||||
disableFeaturedImage: false
|
||||
socialNetworks:
|
||||
github: https://github.com
|
||||
linkedin: https://linkedin.com
|
||||
twitter: https://twitter.com
|
||||
instagram: https://instagram.com
|
||||
facebook: https://facebook.com
|
||||
|
||||
# List pages like blogs and posts
|
||||
listPages:
|
||||
disableFeaturedImage: false
|
||||
|
||||
@@ -13,67 +13,60 @@ description: ""
|
||||
toc:
|
||||
---
|
||||
|
||||
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
|
||||
<!--more-->
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
|
||||
## Blockquotes
|
||||
|
||||
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
|
||||
|
||||
### Blockquote without attribution
|
||||
|
||||
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use *Markdown syntax* within a blockquote.
|
||||
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
|
||||
### Blockquote with attribution
|
||||
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.</p>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
|
||||
## Tables
|
||||
|
||||
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.
|
||||
|
||||
| Name | Age |
|
||||
| ----- | --- |
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
| Name | Age |
|
||||
| ----- | --- |
|
||||
| Bob | 27 |
|
||||
| Alice | 23 |
|
||||
|
||||
### Inline Markdown within tables
|
||||
|
||||
| Inline | Markdown | In | Table |
|
||||
| ------------------------ | -------------------------- | ----------------------------------- | ------ |
|
||||
| *italics* | **bold** | ~~strikethrough~~ | `code` |
|
||||
| _italics_ | **bold** | ~~strikethrough~~ | `code` |
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Code block with backticks
|
||||
|
||||
``` html
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block indented with four spaces
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -88,7 +81,9 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
||||
</html>
|
||||
|
||||
### Code block with Hugo's internal highlight shortcode
|
||||
|
||||
{{< highlight html >}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -111,13 +106,13 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
||||
|
||||
### Unordered List
|
||||
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
|
||||
### Nested list
|
||||
|
||||
* Item
|
||||
- Item
|
||||
1. First Sub-item
|
||||
2. Second Sub-item
|
||||
|
||||
@@ -126,10 +121,15 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
# H1
|
||||
|
||||
## H2
|
||||
|
||||
### H3
|
||||
|
||||
#### H4
|
||||
|
||||
##### H5
|
||||
|
||||
###### H6
|
||||
|
||||
## Other Elements — abbr, sub, sup, kbd, mark
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "Render Math With Mathjax"
|
||||
date: 2022-12-09T19:53:33+05:30
|
||||
draft: false
|
||||
author: "Gurusabarish"
|
||||
tags:
|
||||
- Markdown syntax
|
||||
- Mathjax
|
||||
- example
|
||||
image: /images/mathjax.png
|
||||
description: ""
|
||||
toc: true
|
||||
mathjax: true
|
||||
---
|
||||
|
||||
## Mathjax
|
||||
|
||||
Math equations can be rendered using [Mathjax](https://www.mathjax.org) syntax with AMS symbol support.
|
||||
|
||||
Optionally enable this on a per-page basis by adding `mathjax: true` to your frontmatter.
|
||||
|
||||
Then, use `$$ ... $$` on a line by itself to render a block equation:
|
||||
|
||||
$$ | Pr_{x \leftarrow P_{1}} [A(x) = 1] - Pr_{x \leftarrow P_{2}} [A(x) = 1] | < \text{negligible} $$
|
||||
|
||||
The raw version is:
|
||||
|
||||
```
|
||||
$$ | Pr_{x \leftarrow P_{1}} [A(x) = 1] - Pr_{x \leftarrow P_{2}} [A(x) = 1] | < \text{negligible} $$
|
||||
```
|
||||
|
||||
|
||||
Write in-line equations with `\\( ... \\)` , like \\( x^n / y \\) . It's easy!
|
||||
|
||||
```
|
||||
Write in-line equations with `\\( ... \\)` , like \\( x^n / y \\) . It's easy!
|
||||
```
|
||||
|
||||
@@ -51,3 +51,25 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
||||
<br>
|
||||
{{< youtube w7Ft2ymGmfc >}}
|
||||
<br>
|
||||
|
||||
## Theme Custom Shortcodes
|
||||
|
||||
These shortcodes are not Hugo built-ins, but are provided by the theme.
|
||||
|
||||
### Responsive Images with Cloudinary
|
||||
|
||||
You can learn more about this [here](https://cloudinary.com/documentation/responsive_images).
|
||||
|
||||
Set the `cloudinary_cloud_name` parameter in your site config to use this shortcode.
|
||||
|
||||
```
|
||||
{{</* dynamic-img src="/my/image/on/cloudinary" title="A title for the image" */>}}
|
||||
```
|
||||
|
||||
Note that you do not include the file extension (e.g. `.png`) in the `src` parameter, as the shortcode will automatically determine the best quality and format for the user's device.
|
||||
|
||||
Optionally, you can customize the general CSS styles for the image:
|
||||
|
||||
```
|
||||
{{</* dynamic-img src="/my/image/on/cloudinary" title="A title for the image" style="max-width:60%" */>}}
|
||||
```
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -26,6 +26,11 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "scripts.html" . -}}
|
||||
|
||||
<!-- for search -->
|
||||
<section id="search-content" class="py-2">
|
||||
<div class="container" id="search-results"></div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
{{- $.Scratch.Add "index" slice -}}
|
||||
{{- range .Site.RegularPages -}}
|
||||
{{- $.Scratch.Add "index" (dict "title" .Title "description" .Params.description "content" .Content "image" .Params.image "permalink" .Permalink) -}}
|
||||
{{- end -}}
|
||||
{{- $.Scratch.Get "index" | jsonify -}}
|
||||
@@ -13,7 +13,15 @@
|
||||
<div class="row">
|
||||
{{ range .Paginator.Pages }}
|
||||
<div class="col-lg-4 col-md-6 my-3">
|
||||
<div class="card-columns">
|
||||
<div class="card h-100">
|
||||
{{ if and (not (.Site.Params.listPages.disableFeaturedImage | default false)) (.Params.image) }}
|
||||
<div class="card-header">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img src="{{ .Params.image }}" class="card-img-top" alt="{{ .Title }}">
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="card-body bg-transparent p-4 shadow-sm">
|
||||
<a href="{{ .RelPermalink }}" class="primary-font card-title">
|
||||
<h5 class="card-title bg-transparent" title="{{ .Title }}">{{ .Title | truncate 25 }}</h5>
|
||||
@@ -28,6 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-auto m-3">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width">
|
||||
<link rel="icon" href={{ .Site.Params.favicon | default "/fav.png" }} type="image/gif">
|
||||
|
||||
<!-- Fonts -->
|
||||
@@ -23,7 +24,7 @@
|
||||
<link rel="stylesheet" href="{{ .Site.Params.staticPath }}/css/font.css" media="all">
|
||||
|
||||
<!-- Internal templates -->
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
||||
@@ -67,4 +68,31 @@
|
||||
line-height: {{ .Site.Params.font.lineHeight | default "1.5" }};
|
||||
text-align: {{ .Site.Params.font.textAlign | default "left" }};
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: var(--background-color) !important;
|
||||
}
|
||||
|
||||
body::-webkit-scrollbar {
|
||||
width: .5em;
|
||||
height: .5em;
|
||||
background-color: var(--background-color);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: inset 0 0 6px var(--background-color);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 1rem;
|
||||
background-color: var(--secondary-color);
|
||||
outline: 1px solid var(--background-color);
|
||||
}
|
||||
|
||||
#search-content::-webkit-scrollbar {
|
||||
width: .5em;
|
||||
height: .1em;
|
||||
background-color: var(--background-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -62,3 +62,39 @@
|
||||
} catch(err) {}
|
||||
}
|
||||
</script>
|
||||
|
||||
{{ if not (.Site.Params.navbar.disableSearch | default false) }}
|
||||
<script src="/js/search.js"></script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ if (.Params.mathjax | default false) }}
|
||||
|
||||
{{ "<!-- MathJax -->" | safeHTML }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js" integrity="sha384-M5jmNxKC9EVnuqeMwRHvFuYUE8Hhp0TgBruj/GZRkYtiMrCRgH7yvv5KY+Owi7TW" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['\\(','\\)']],
|
||||
displayMath: [['$$','$$'], ['\[','\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { equationNumbers: { autoNumber: "AMS" },
|
||||
extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Site.Params.cloudinary_cloud_name | default false) }}
|
||||
|
||||
{{ "<!-- cloudinary -->" | safeHTML }}
|
||||
<script src="https://unpkg.com/cloudinary-core@2.13.0/cloudinary-core-shrinkwrap.js" integrity="sha384-0bQduxVhZMs6xfvcPH9osdUIw44hjF8EahHuQBdyN6Rryk8tgyFO80Yz5d14F+5d" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript">
|
||||
var cl = cloudinary.Cloudinary.new({cloud_name: "{{- .Site.Params.cloudinary_cloud_name }}"});
|
||||
cl.responsive();
|
||||
</script>
|
||||
|
||||
{{ end }}
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
<div class="container py-3" id="recent-posts">
|
||||
{{ if .Site.Params.footer.recentPosts | default true }}
|
||||
<div class="h3 text-center text-secondary py-3">Recent posts</div>
|
||||
{{ if .Site.Params.footer.recentPosts.enable | default false }}
|
||||
{{ $recentPostsPath := .Site.Params.footer.recentPosts.path | default "blogs" }}
|
||||
{{ $recentPostsCount := .Site.Params.footer.recentPosts.count | default 3 }}
|
||||
{{ $recentPosts := where .Site.RegularPages "Section" $recentPostsPath | first $recentPostsCount }}
|
||||
<div class="h3 text-center text-secondary py-3">
|
||||
{{ .Site.Params.footer.recentPosts.title | default "Recent Posts" }}
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
{{ range ( where .Site.RegularPages "Type" "blogs" | first 3 ) }}
|
||||
{{ range $recentPosts }}
|
||||
<div class="col-lg-4 col-md-6 pt-2">
|
||||
<div class="card h-100">
|
||||
{{ if and (not (.Site.Params.footer.recentPosts.disableFeaturedImage | default false)) (.Params.image) }}
|
||||
<div class="card-header">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<img src="{{ .Params.image }}" class="card-img-top" alt="{{ .Title }}">
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="card-body bg-transparent p-3 shadow-sm">
|
||||
<a href="{{ .RelPermalink }}" class="primary-font card-title">
|
||||
<h5 class="card-title bg-transparent" title="{{ .Title }}">{{ .Title | truncate 25 }}</h5>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- /* theme-toggle is enabled */}}
|
||||
{{- if (not .Site.Params.theme.disableThemeToggle) }}
|
||||
{{- if (not .Site.Params.theme.disableThemeToggle | default false) }}
|
||||
{{- /* theme is auto */}}
|
||||
<script>
|
||||
if (localStorage.getItem("pref-theme") === "dark") {
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<!-- Navbar -->
|
||||
<header>
|
||||
<nav class="pt-3 navbar navbar-expand-lg">
|
||||
<nav class="pt-3 navbar navbar-expand-lg {{ if .Site.Params.animate }}animate{{ end }}">
|
||||
<div class="container-fluid mx-xs-2 mx-sm-5 mx-md-5 mx-lg-5">
|
||||
<!-- navbar brand -->
|
||||
<a class="navbar-brand primary-font text-wrap" href="{{ .Site.BaseURL | relURL }}">
|
||||
@@ -37,6 +37,13 @@
|
||||
{{ end }}
|
||||
</a>
|
||||
|
||||
{{ if not (.Site.Params.navbar.disableSearch | default false) }}
|
||||
<div>
|
||||
<input id="search" autocomplete="off" class="form-control mr-sm-2 d-none d-md-block" placeholder="Search ..."
|
||||
aria-label="Search" oninput="searchOnChange(event)">
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<!-- navbar toggler -->
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent"
|
||||
aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -48,44 +55,64 @@
|
||||
<!-- navbar content -->
|
||||
<div class="collapse navbar-collapse text-wrap primary-font" id="navbarContent">
|
||||
<ul class="navbar-nav {{ .Site.Params.navbar.align | default "ms-auto"}} text-center">
|
||||
{{ if not (.Site.Params.navbar.disableSearch | default false) }}
|
||||
<li class="nav-item navbar-text d-block d-md-none">
|
||||
<div class="nav-link">
|
||||
<input id="search" autocomplete="off" class="form-control mr-sm-2" placeholder="Search ..." aria-label="Search" oninput="searchOnChange(event)">
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.about.enable | default false) (not (.Site.Params.navbar.menus.disableAbout | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#about" aria-label="about">About</a>
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#about" aria-label="about">
|
||||
{{ .Site.Params.about.title | default "About" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.experience.enable | default false) (not (.Site.Params.navbar.menus.disableExperience | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#experience"
|
||||
aria-label="experience">Experience</a>
|
||||
aria-label="experience">
|
||||
{{ .Site.Params.experience.title | default "Experience" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.education.enable | default false) (not (.Site.Params.navbar.menus.disableEducation | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#education"
|
||||
aria-label="education">Education</a>
|
||||
aria-label="education">
|
||||
{{ .Site.Params.education.title | default "Education" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.projects.enable | default false) (not (.Site.Params.navbar.menus.disableEducation | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#projects"
|
||||
aria-label="projects">Projects</a>
|
||||
aria-label="projects">
|
||||
{{ .Site.Params.projects.title | default "Projects" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.achievements.enable | default false) (not (.Site.Params.navbar.menus.disableAchievements | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#achievements"
|
||||
aria-label="achievements">Achievements</a>
|
||||
aria-label="achievements">
|
||||
{{ .Site.Params.achievements.title | default "Achievements" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.Site.Params.contact.enable | default false) (not (.Site.Params.navbar.menus.disableContact | default false)) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<a class="nav-link" href="{{ .Site.BaseURL | relURL }}#contact"
|
||||
aria-label="contact">Contact</a>
|
||||
aria-label="contact">
|
||||
{{ .Site.Params.contact.title | default "Contact" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
@@ -117,10 +144,10 @@
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
{{ if (not .Site.Params.theme.disableThemeToggle | default false) }}
|
||||
<li class="nav-item navbar-text">
|
||||
<!-- darkmode mode toggle -->
|
||||
{{ if (not .Site.Params.theme.disableThemeToggle) }}
|
||||
<div class="text-center">
|
||||
<button id="theme-toggle">
|
||||
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
@@ -139,8 +166,11 @@
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<section id="hero" class="py-5 align-middle">
|
||||
<div class="container px-3 px-sm-5 px-md-5 px-lg-5 pt-lg-3">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-8 content" id="primary-font">
|
||||
<div class="col-sm-12 col-md-12 col-lg-8 content {{ if .Site.Params.animate }}animate{{ end }}" id="primary-font">
|
||||
<span class="subtitle">
|
||||
{{ .Site.Params.hero.intro }}
|
||||
</span>
|
||||
@@ -18,7 +18,10 @@
|
||||
<div class="row">
|
||||
<div class="col-auto h-100">
|
||||
{{ if .Site.Params.hero.button.enable }}
|
||||
<a href="{{ .Site.Params.hero.button.url }}" class="btn" {{ cond .Site.Params.hero.button.download "download" "" }}>
|
||||
<a href="{{ .Site.Params.hero.button.url }}" class="btn" {{ cond .Site.Params.hero.button.download "download" "" }}
|
||||
{{ if .Site.Params.hero.button.newPage | default true }}
|
||||
target="_blank"
|
||||
{{ end }}>
|
||||
{{ .Site.Params.hero.button.name }}
|
||||
</a>
|
||||
{{ end }}
|
||||
@@ -30,7 +33,7 @@
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-12 col-md-9 pt-5 image px-5 px-md-5 px-lg-0 text-center">
|
||||
<div class="col-sm-12 col-md-9 pt-5 image {{ if .Site.Params.animate }}animate{{ end }} px-5 px-md-5 px-lg-0 text-center">
|
||||
<img src="{{ .Site.Params.hero.image }}"
|
||||
class="img-thumbnail mx-auto"
|
||||
alt=""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<span id="loading-icons" style="display: none;">
|
||||
<span id="loading-icons" style="display: {{ if .Site.Params.animate }}none{{else}}block{{ end }};">
|
||||
{{ range .Site.Params.hero.socialLinks.fontAwesomeIcons }}
|
||||
<span class="px-1">
|
||||
<a href="{{ .url }}" target="_blank" class="btn social-icon">
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{{ $image := .Get "src" }}
|
||||
{{ $alt := .Get "title" }}
|
||||
{{ $width := .Get "width" | default "w_auto" }}
|
||||
{{ $style := .Get "style" | default "max-width:80%" }}
|
||||
<img alt="{{ $alt }}" title="{{ $alt }}" data-src="https://res.cloudinary.com/{{ $.Site.Params.cloudinary_cloud_name }}/{{ $width }},c_scale,f_auto,q_auto,dpr_auto{{ $image}}" class="cld-responsive" style="padding-bottom: 16px; display: block; margin: auto; {{ $style }}">
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[build]
|
||||
publish = "exampleSite/public"
|
||||
command = "cd exampleSite && hugo --gc --minify --themesDir ../.."
|
||||
command = 'cd exampleSite && echo -e "\ngoogleAnalytics: $GOOGLE_ANALYTICS \ndisqusShortname: $DISQUS_SHORTNAME \n" >> config.yaml && hugo --gc --minify --themesDir ../..'
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.92.0"
|
||||
|
||||
@@ -16,6 +16,7 @@ footer .card {
|
||||
border-radius: .75rem;
|
||||
cursor: context-menu;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
footer .card:hover {
|
||||
@@ -30,6 +31,7 @@ footer .card-text * {
|
||||
footer .card-footer {
|
||||
background-color: var(--background-color) !important;
|
||||
padding: .8em .7em;
|
||||
border: 1px solid var(--secondary-color);
|
||||
}
|
||||
|
||||
footer .card-footer a {
|
||||
@@ -47,3 +49,16 @@ footer .card-footer a:hover {
|
||||
footer .card-footer a:focus {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
footer .card > .card-header {
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
background-color: var(--secondary-color) !important;
|
||||
}
|
||||
|
||||
footer .card > .card-header .card-img-top {
|
||||
width: 100%;
|
||||
height: 250px !important;
|
||||
object-fit: cover;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
@@ -57,3 +57,55 @@ li > .dropdown-toggle:focus{
|
||||
.dropdown-item:focus, .dropdown-item:active {
|
||||
background-color: var(--secondary-color) !important;
|
||||
}
|
||||
|
||||
#search {
|
||||
border-radius: 1rem !important;
|
||||
background-color: var(--secondary-color);
|
||||
color: var(--text-color);
|
||||
border-color: var(--background-color) !important;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#search:focus {
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
#search-content {
|
||||
-ms-scroll-chaining: none;
|
||||
scrollbar-width: none;
|
||||
display: none;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.2);
|
||||
z-index: 9999;
|
||||
width: 10%;
|
||||
max-height: 350px;
|
||||
background-color: var(--secondary-color) !important;
|
||||
position: absolute;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
#search-content::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search-results > .card {
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#search-results > .card :hover {
|
||||
border-radius: 1rem !important;
|
||||
background-color: var(--background-color) !important;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
#search-results .card a {
|
||||
opacity: 0.9;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
color: var(--text-color) !important;
|
||||
}
|
||||
|
||||
#search-results .card a:hover {
|
||||
color: var(--primary-color) !important;
|
||||
}
|
||||
+15
-7
@@ -51,10 +51,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
header .navbar {
|
||||
header .navbar.animate {
|
||||
animation: fade-up 0.5s ease-in;
|
||||
}
|
||||
|
||||
|
||||
/* ToolTip */
|
||||
|
||||
.tooltip {
|
||||
@@ -75,7 +76,7 @@ header .navbar {
|
||||
line-height: 2rem;
|
||||
max-width: 100%;
|
||||
}
|
||||
#hero .content {
|
||||
#hero .content.animate {
|
||||
animation: fade-left 1s ease-out;
|
||||
}
|
||||
|
||||
@@ -109,16 +110,22 @@ header .navbar {
|
||||
}
|
||||
|
||||
#hero .image img {
|
||||
animation: fade-in 1s ease-out;
|
||||
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
|
||||
transition: box-shadow 0.3s;
|
||||
box-shadow:0px 8px 56px rgba(15, 80, 100, 0.16);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border: 2px solid var(--secondary-color);
|
||||
border: 3px solid var(--secondary-color);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
#hero .image.animate img {
|
||||
animation: fade-in 1s ease-out;
|
||||
transition: box-shadow 0.3s;
|
||||
}
|
||||
|
||||
#hero .image img:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#hero .image.animate img:hover {
|
||||
box-shadow: 0 0 11px rgb(15 80 100 / 20%);
|
||||
filter: contrast(1.2);
|
||||
cursor: pointer;
|
||||
@@ -476,6 +483,7 @@ header .navbar {
|
||||
}
|
||||
|
||||
#achievements .card {
|
||||
cursor: context-menu;
|
||||
background-color: var(--secondary-color) !important;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 0 36px rgba(0,0,0,0.1);
|
||||
|
||||
+12
-1
@@ -4,6 +4,7 @@
|
||||
border-radius: .75rem;
|
||||
cursor: context-menu;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#list-page .card a {
|
||||
@@ -15,7 +16,6 @@
|
||||
}
|
||||
|
||||
#list-page .card:hover {
|
||||
border: 1px solid var(--secondary-color);
|
||||
transition: all 0.3s ease-out;
|
||||
transform: translateY(-7px);
|
||||
}
|
||||
@@ -47,6 +47,17 @@
|
||||
color: var(--primary-color) !important;
|
||||
}
|
||||
|
||||
#list-page .card > .card-header {
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
background-color: var(--secondary-color) !important;
|
||||
}
|
||||
|
||||
#list-page .card > .card-header .card-img-top {
|
||||
width: 100%;
|
||||
height: 250px !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* pagination */
|
||||
#list-page ul li a {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
|
||||
margin-bottom: 1rem;
|
||||
background-color: var(--secondary-color);
|
||||
}
|
||||
|
||||
#single .page-content a {
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
async function searchOnChange(evt) {
|
||||
let searchQuery = evt.target.value;
|
||||
|
||||
if (searchQuery !== "") {
|
||||
const searchButtonEle = document.querySelectorAll("#search");
|
||||
let searchButtonPosition;
|
||||
if (window.innerWidth > 768) {
|
||||
searchButtonPosition = searchButtonEle[0].getBoundingClientRect();
|
||||
document.getElementById("search-content").style.width = "500px";
|
||||
} else {
|
||||
searchButtonPosition = searchButtonEle[1].getBoundingClientRect();
|
||||
document.getElementById("search-content").style.width = "300px";
|
||||
}
|
||||
|
||||
document.getElementById("search-content").style.top =
|
||||
searchButtonPosition.top + 50 + "px";
|
||||
document.getElementById("search-content").style.left =
|
||||
searchButtonPosition.left + "px";
|
||||
|
||||
let searchJson = await fetch("/index.json").then((res) => res.json());
|
||||
let searchResults = searchJson.filter((item) => {
|
||||
let res = false;
|
||||
if (item.title && item.description && item.content) {
|
||||
res =
|
||||
item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
item.description.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
item.content.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
} else if (item.title && item.description) {
|
||||
res =
|
||||
item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
item.description.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
} else if (item.title && item.content) {
|
||||
res =
|
||||
item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
item.content.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
} else if (item.description && item.content) {
|
||||
res =
|
||||
item.description.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
item.content.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
} else if (item.title) {
|
||||
res = item.title.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
} else if (item.description) {
|
||||
res = item.description
|
||||
.toLowerCase()
|
||||
.includes(searchQuery.toLowerCase());
|
||||
} else if (item.content) {
|
||||
res = item.content.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
}
|
||||
return res;
|
||||
});
|
||||
if (searchResults.length > 0) {
|
||||
let searchResultsHtml = "";
|
||||
searchResults.map((item) => {
|
||||
searchResultsHtml += `<div class="card">
|
||||
<a href="${item.permalink}">
|
||||
<div class="p-3">
|
||||
<h5>${item.title}</h5>
|
||||
<div>${item.description}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>`;
|
||||
});
|
||||
document.getElementById("search-results").innerHTML = searchResultsHtml;
|
||||
} else {
|
||||
let searchResultsHtml = `<p class="text-center py-3">No results found for "${searchQuery}"</p>`;
|
||||
document.getElementById("search-results").innerHTML = searchResultsHtml;
|
||||
}
|
||||
document.getElementById("search-content").style.display = "block";
|
||||
} else {
|
||||
document.getElementById("search-content").style.display = "none";
|
||||
document.getElementById("search-results").innerHTML = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user