From aa2d0606cec1329cb9f70f830ec387502dd2b5c9 Mon Sep 17 00:00:00 2001 From: Sharwin24 Date: Fri, 27 Dec 2024 14:10:06 -0800 Subject: [PATCH] Editing code with my formatting --- assets/scripts/core/theme-scheme.js | 4 +- assets/scripts/features/darkmode/index.js | 2 +- content/posts/sample_paper/index.md | 18 + data/en/sections/education.yaml | 104 +++++ data/en/sections/experiences.yaml | 73 ++++ data/en/sections/projects.yaml | 38 ++ layouts/index.html | 131 ++++--- layouts/partials/footer.html | 365 +++++++++--------- .../partials/navigators/theme-selector.html | 51 +-- 9 files changed, 503 insertions(+), 283 deletions(-) create mode 100644 content/posts/sample_paper/index.md create mode 100644 data/en/sections/education.yaml create mode 100644 data/en/sections/experiences.yaml create mode 100644 data/en/sections/projects.yaml diff --git a/assets/scripts/core/theme-scheme.js b/assets/scripts/core/theme-scheme.js index a02d469..6a0fc96 100644 --- a/assets/scripts/core/theme-scheme.js +++ b/assets/scripts/core/theme-scheme.js @@ -1,9 +1,9 @@ -let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light' +let theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'dark' if (theme === 'system') { if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { theme = 'dark' } else { - theme = 'light' + theme = 'dark' } } document.documentElement.setAttribute('data-theme', theme) diff --git a/assets/scripts/features/darkmode/index.js b/assets/scripts/features/darkmode/index.js index 74ac8e0..fc7ca30 100644 --- a/assets/scripts/features/darkmode/index.js +++ b/assets/scripts/features/darkmode/index.js @@ -23,7 +23,7 @@ window.addEventListener('load', async () => { function getPreferredColorScheme() { const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches; - return isDarkMode ? "dark" : "light"; + return isDarkMode ? "dark" : "dark"; } function setScheme(newScheme) { diff --git a/content/posts/sample_paper/index.md b/content/posts/sample_paper/index.md new file mode 100644 index 0000000..5af650d --- /dev/null +++ b/content/posts/sample_paper/index.md @@ -0,0 +1,18 @@ +--- +title: "Sample Paper" +date: 2020-06-08T08:06:25+06:00 +description: Introduction to Sample Post +menu: + sidebar: + name: Introduction + identifier: introduction + weight: 10 +tags: ["Basic", "Multi-lingual"] +categories: ["Basic"] +--- + +Greeting! This is an introduction post. This post tests the followings: + +- Hero image is in the same directory as the post. +- This post should be at top of the sidebar. +- Post author should be the same as specified in `author.yaml` file. diff --git a/data/en/sections/education.yaml b/data/en/sections/education.yaml new file mode 100644 index 0000000..8aeeb56 --- /dev/null +++ b/data/en/sections/education.yaml @@ -0,0 +1,104 @@ +# section information +section: + name: Education + id: education + template: sections/education.html # Use "sections/education-alt.html for alternate template. + enable: true + weight: 2 + showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true + +degrees: +- name: Ph.D in Quantum Cryptography + icon: fa-microscope + timeframe: 2016-2020 + institution: + name: ABC University of Technology + url: "#" + logo: /images/sections/education/tech_college.png + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/education/tech_college.png + grade: #(optional) + scale: CGPA + achieved: 3.6 + outOf: 4 + publications: #(optional) + - title: Lorem ipsum dolor sit amet, consectetur adipiscing elit. + url: "#" + - title: Fusce eu augue ut odio porttitor pulvinar. + url: "#" + - title: Nullam vitae orci tincidunt purus viverra pulvinar. + url: "#" +- name: B.Sc. in Computer Science & Engineering + icon: fa-graduation-cap + timeframe: 2012-2016 + institution: + name: University of XYZ + url: "#" + logo: /images/sections/education/university.jpg + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/education/university.jpg + grade: #(optional) + scale: CGPA + achieved: 3.5 + outOf: 4 + takenCourses: #(optional) + # if true, the courses will be rendered as a table otherwise it will render as a list and the grades will be hidden. + showGrades: true + collapseAfter: 3 + courses: + - name: Data Structures and Algorithm + achieved: 3.75 + outOf: 4 + - name: Network Security + achieved: 3.80 + outOf: 4 + - name: Operating System + achieved: 3.5 + outOf: 4 + - name: Artificial Intelligent + achieved: 3.75 + outOf: 4 + publications: #(optional) + - title: Lorem ipsum dolor sit amet, consectetur adipiscing elit. + url: "#" + - title: Fusce eu augue ut odio porttitor pulvinar. + url: "#" + extracurricularActivities: #(optional) + - In vitae facilisis est, eget porta sem. + - Vestibulum consectetur lorem justo, at laoreet lorem feugiat et. + - Duis sed massa feugiat, ornare justo et, aliquam est. + - Pellentesque ut fringilla magna. + custonSections: #(optional) + - name: Thesis + content: Lorem ipsum dolor sit amet, consectetur adipiscing elit. + - name: Supervisor + content: Fusce eu augue ut odio porttitor pulvinar. +- name: Higher Secondary School Certificate + icon: fa-university + timeframe: 2010-2012 + institution: + name: MST College of Science + url: "#" + logo: /images/sections/education/science_college.png + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/education/science_college.png + grade: #(optional) + scale: GPA + achieved: 5 + outOf: 5 + extracurricularActivities: #(optional) + - In vitae facilisis est, eget porta sem. + - Vestibulum consectetur lorem justo, at laoreet lorem feugiat et. + - Duis sed massa feugiat, ornare justo et, aliquam est. + - Pellentesque ut fringilla magna. +- name: Secondary School Certificate + icon: fa-school + timeframe: 2005-2010 + institution: + name: JK School of Science + grade: #(optional) + scale: GPA + achieved: 4.5 + outOf: 5 diff --git a/data/en/sections/experiences.yaml b/data/en/sections/experiences.yaml new file mode 100644 index 0000000..806af52 --- /dev/null +++ b/data/en/sections/experiences.yaml @@ -0,0 +1,73 @@ +# section information +section: + name: Work Experience + id: experiences + enable: true + weight: 1 + showOnNavbar: true + # Can optionally hide the title in sections + # hideTitle: true + +# Your experiences +experiences: +- company: + name: Example Co. + url: "https://www.example.com" + location: Dhaka Branch + logo: /images/sections/experiences/company1.jpg + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/experiences/company1.jpg + # company overview + overview: Example Co. is a widely recognized company for cloud-native development. It builds tools for Kubernetes. + positions: + - designation: Senior Software Engineer + start: Nov 2019 + # don't provide end date if you are currently working there. It will be replaced by "Present" + # end: Dec 2020 + # give some points about what was your responsibilities at the company. + responsibilities: + - Design and develop XYZ tool for ABC task + - Design, develop and manage disaster recovery tool [Xtool](https://www.example.com) that backup Kubernetes volumes, databases, and cluster's resource definition. + - Lead backend team. + + - designation: Junior Software Engineer + start: Nov 2017 + end: Oct 2019 + responsibilities: + - Implement and test xyz feature for abc tool. + - Support client for abc tool. + - Learn k,d,w technology for xyz. + +- company: + name: PreExample Co. + url: "https://www.example.com" + location: Nowhere + logo: /images/sections/experiences/company2.jpg + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/experiences/company2.jpg + overview: PreExample Co. is a gateway company to enter into Example co. So, nothing special here. + positions: + - designation: Software Engineer + start: March 2016 + end: May 2017 + responsibilities: + - Write lots of example codes. + - Read lots of examples. + - See lots of example videos. + +- company: + name: Intern Counting Company (ICC). + url: "https://www.example.com" + location: Intern Land + logo: /images/sections/experiences/company3.jpg + # Can optionally show a different logo for dark theme + # darkLogo: /images/sections/experiences/company3.jpg + overview: Intern counting Company (ICC) is responsible for counting worldwide intern Engineers. + positions: + - designation: Intern + start: Jun 2015 + end: Jan 2016 + responsibilities: + - Count lost of interns. + - Count more interns. + - Count me as an intern. diff --git a/data/en/sections/projects.yaml b/data/en/sections/projects.yaml new file mode 100644 index 0000000..72fcafa --- /dev/null +++ b/data/en/sections/projects.yaml @@ -0,0 +1,38 @@ +# section information +section: + name: Projects + id: projects + enable: true + weight: 0 + showOnNavbar: true + # Can optionally hide the title in sections + hideTitle: false + +# filter buttons +buttons: +- name: All + filter: "all" +- name: Professional + filter: "professional" +- name: Academic + filter: "academic" +- name: Hobby + filter: "hobby" + +# your projects +projects: +- name: Kubernetes + logo: /images/sections/projects/kubernetes.png + role: Contributor + timeline: "March 2018 - Present" + repo: https://github.com/kubernetes/kubernetes # If your project is a public repo on GitHub, then provide this link. it will show star count. + #url: "" # If your project is not a public repo but it has a website or any external details url then provide it here. don't provide "repo" and "url" simultaneously. + summary: Production-Grade Container Scheduling and Management. + tags: ["professional", "kubernetes", "cloud"] + +- name: A sample academic paper + role: Team Lead + timeline: "Jan 2017 - Nov 2017" + url: "https://www.example.com" + summary: Lorem ipsum dolor sit amet consectetur adipisicing elit. Sapiente eius reprehenderit animi suscipit autem eligendi esse amet aliquid error eum. Accusantium distinctio soluta aliquid quas placeat modi suscipit eligendi nisi. + tags: ["academic","iot"] \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index cd8afbc..70767e7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,72 +1,75 @@ - - {{- .Site.Title -}} - {{ $siteDescription := .Site.Params.description }} - {{ if (index .Site.Data .Site.Language.Lang).site }} - {{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }} - {{ if $siteConfig.description }} - {{ $siteDescription = $siteConfig.description }} - {{ end }} + + + {{- .Site.Title -}} + {{ $siteDescription := .Site.Params.description }} + {{ if (index .Site.Data .Site.Language.Lang).site }} + {{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }} + {{ if $siteConfig.description }} + {{ $siteDescription = $siteConfig.description }} + {{ end }} + {{ end }} + + + + {{- partial "header.html" . -}} + {{- partial "opengraph.html" . -}} + + + {{- partial "analytics.html" . -}} + {{ with resources.Get "scripts/core/theme-scheme.js" | fingerprint }} + + {{ end }} + + + + + + {{- partial "navigators/navbar.html" . -}} + + + + + + {{ $sections:= site.Data.sections }} + {{ if (index site.Data site.Language.Lang).sections }} + {{ $sections = (index site.Data site.Language.Lang).sections }} + {{ end }} + + {{ if $sections }} + {{ $background:= "bg-primary"}} + {{ range sort $sections "section.weight" }} + {{ if .section.enable }} +
+ {{ if .section.template }} + {{- partial .section.template . -}} + {{ else }} + {{- partial (printf "sections/%s.html" (replace (lower .section.id) " " "-")) . -}} {{ end }} - - - - {{- partial "header.html" . -}} - {{- partial "opengraph.html" . -}} - - - {{- partial "analytics.html" . -}} - {{ with resources.Get "scripts/core/theme-scheme.js" | fingerprint }} - - {{ end }} - - +
+ + {{ if eq $background "bg-primary" }} + {{ $background = "bg-secondary" }} + {{ else }} + {{ $background = "bg-primary" }} + {{end}} + {{ end }} + {{ end }} + {{ end }} - - {{- partial "navigators/navbar.html" . -}} + + {{ $footerTemplate:= site.Params.footer.template | default "footer.html" }} + {{- partial $footerTemplate . -}} - - {{- partial "sections/home.html" . -}} + + {{ partial "scripts.html" . }} - - {{ $sections:= site.Data.sections }} - {{ if (index site.Data site.Language.Lang).sections }} - {{ $sections = (index site.Data site.Language.Lang).sections }} - {{ end }} + + {{- partial "misc/support.html" . -}} - {{ if $sections }} - {{ $background:= "bg-primary"}} - {{ range sort $sections "section.weight" }} - {{ if .section.enable }} -
- {{ if .section.template }} - {{- partial .section.template . -}} - {{ else }} - {{- partial (printf "sections/%s.html" (replace (lower .section.id) " " "-")) . -}} - {{ end }} -
- - {{ if eq $background "bg-primary" }} - {{ $background = "bg-secondary" }} - {{ else }} - {{ $background = "bg-primary" }} - {{end}} - {{ end }} - {{ end }} - {{ end }} + - - {{ $footerTemplate:= site.Params.footer.template | default "footer.html" }} - {{- partial $footerTemplate . -}} - - - {{ partial "scripts.html" . }} - - - {{- partial "misc/support.html" . -}} - - - + \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c04bd7a..06e9002 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,217 +1,200 @@ -{{/* variables for enabling/disabling parts of the footer */}} -{{ $footerEnabled := site.Params.footer.enable | default true }} -{{ $navigationEnabled := site.Params.footer.navigation.enable | default true }} +{{/* variables for enabling/disabling parts of the footer */}} +{{ $footerEnabled := site.Params.footer.enable | default true }} +{{ $navigationEnabled := site.Params.footer.navigation.enable | default true }} {{ $customMenusEnabled := site.Params.footer.navigation.customMenus | default true }} -{{ $contactMeEnabled := site.Params.footer.contactMe.enable | default true }} -{{ $newsletterEnabled := site.Params.footer.newsletter.enable | default true }} +{{ $contactMeEnabled := site.Params.footer.contactMe.enable | default true }} +{{ $newsletterEnabled := site.Params.footer.newsletter.enable | default true }} {{ $credentialsEnabled := site.Params.footer.credentials.enable | default true }} -{{ $disclaimerEnabled := site.Params.footer.disclaimer.enable | default false }} +{{ $disclaimerEnabled := site.Params.footer.disclaimer.enable | default false }} -{{/* Keep backward compatibility for the newsletter function */}} +{{/* Keep backward compatibility for the newsletter function */}} {{ if site.Params.newsletter }} - {{ if site.Params.newsletter.enable }} - {{ $newsletterEnabled = true }} - {{ else }} - {{ $newsletterEnabled = false }} - {{ end }} +{{ if site.Params.newsletter.enable }} +{{ $newsletterEnabled = true }} +{{ else }} +{{ $newsletterEnabled = false }} +{{ end }} {{ end }} {{ if $footerEnabled }} - {{ $author:= site.Data.author }} - {{ if (index site.Data site.Language.Lang).author }} - {{ $author = (index site.Data site.Language.Lang).author }} - {{ end }} +{{ $author:= site.Data.author }} +{{ if (index site.Data site.Language.Lang).author }} +{{ $author = (index site.Data site.Language.Lang).author }} +{{ end }} - {{ $sections:= site.Data.sections }} - {{ if (index site.Data site.Language.Lang).sections }} - {{ $sections = (index site.Data site.Language.Lang).sections }} - {{ end }} +{{ $sections:= site.Data.sections }} +{{ if (index site.Data site.Language.Lang).sections }} +{{ $sections = (index site.Data site.Language.Lang).sections }} +{{ end }} - {{ $customMenus := site.Params.customMenus }} - {{ if (index site.Data site.Language.Lang).site.customMenus }} - {{ $customMenus = (index site.Data site.Language.Lang).site.customMenus }} - {{ end }} +{{ $customMenus := site.Params.customMenus }} +{{ if (index site.Data site.Language.Lang).site.customMenus }} +{{ $customMenus = (index site.Data site.Language.Lang).site.customMenus }} +{{ end }} - {{ $copyrightNotice := now.Format "2006" | printf "© %s Copyright."}} - {{ if (index site.Data site.Language.Lang).site }} - {{ $siteConfig := (index site.Data site.Language.Lang).site }} - {{ if $siteConfig.copyright }} - {{ $copyrightNotice = $siteConfig.copyright }} - {{ end }} - {{ end }} +{{ $copyrightNotice := now.Format "2006" | printf "© %s Copyright."}} +{{ if (index site.Data site.Language.Lang).site }} +{{ $siteConfig := (index site.Data site.Language.Lang).site }} +{{ if $siteConfig.copyright }} +{{ $copyrightNotice = $siteConfig.copyright }} +{{ end }} +{{ end }} - {{ $disclaimer := "" }} - {{ $siteConfig := (index site.Data site.Language.Lang).site }} - {{ if $siteConfig.disclaimer }} - {{ $disclaimer = $siteConfig.disclaimer }} - {{ end }} +{{ $disclaimer := "" }} +{{ $siteConfig := (index site.Data site.Language.Lang).site }} +{{ if $siteConfig.disclaimer }} +{{ $disclaimer = $siteConfig.disclaimer }} +{{ end }} - {{/* footer logos */}} - {{ $themeLogo := "/images/theme-logo.png" }} - {{ $hugoLogo := "/images/hugo-logo.svg" }} +{{/* footer logos */}} +{{ $themeLogo := "/images/theme-logo.png" }} +{{ $hugoLogo := "/images/hugo-logo.svg" }} - {{/* resize the logos. don't resize svg because it is not supported */}} - {{ $themeLogo:= resources.Get $themeLogo}} - {{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }} - {{ $themeLogo = $themeLogo.Resize "32x" }} - {{ end }} - {{ $themeLogo = $themeLogo.RelPermalink}} +{{/* resize the logos. don't resize svg because it is not supported */}} +{{ $themeLogo:= resources.Get $themeLogo}} +{{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }} +{{ $themeLogo = $themeLogo.Resize "32x" }} +{{ end }} +{{ $themeLogo = $themeLogo.RelPermalink}} - {{ $hugoLogo:= resources.Get $hugoLogo}} - {{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}} - {{ $hugoLogo = $hugoLogo.Resize "32x" }} - {{ end }} - {{ $hugoLogo = $hugoLogo.RelPermalink}} +{{ $hugoLogo:= resources.Get $hugoLogo}} +{{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}} +{{ $hugoLogo = $hugoLogo.Resize "32x" }} +{{ end }} +{{ $hugoLogo = $hugoLogo.RelPermalink}} - +{{end}} \ No newline at end of file diff --git a/layouts/partials/navigators/theme-selector.html b/layouts/partials/navigators/theme-selector.html index 52d93ad..e85984a 100644 --- a/layouts/partials/navigators/theme-selector.html +++ b/layouts/partials/navigators/theme-selector.html @@ -1,31 +1,32 @@ -{{/* variables for enabling/disabling various features */}} -{{ $darkEnabled := true }} +{{/* variables for enabling/disabling various features */}} +{{ $darkEnabled := true }} {{ $lightEnabled := true }} {{ if site.Params.features.theme.enable }} - {{ $darkEnabled = site.Params.features.theme.services.dark | default true }} - {{ $lightEnabled = site.Params.features.theme.services.light | default true }} +{{ $darkEnabled = site.Params.features.theme.services.dark | default true }} +{{ $lightEnabled = site.Params.features.theme.services.light | default true }} {{ end }} + + \ No newline at end of file