Merge pull request #2 from hossainemruz/master

update fork
This commit is contained in:
Richard Tirtadji 2020-10-25 23:03:06 +07:00 committed by GitHub
commit 85eea236ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 267 additions and 124 deletions

37
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View file

@ -0,0 +1,37 @@
---
name: Bug
about: File a bug report.
title: 'bug'
---
## Expected Behavior
<!--- Tell us what should happen -->
## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
### Screenshots
<!--- Provide any screenshots or links to deployments -->
### Browsers Affected
<!-- Check all that apply -->
- [ ] Chrome
- [ ] Firefox
- [ ] Edge
- [ ] Safari 11
- [ ] Safari 10
- [ ] IE 11
## Detailed Description
<!--- Provide a detailed description of the change or addition you are proposing -->

View file

@ -0,0 +1,30 @@
---
name: Feature Request
about: File a Feature Request.
title: 'Feature Request'
---
<!---
Before filing an issue, please review the following:
Existing Features: https://github.com/hossainemruz/toha#features
Project Roadmap: https://github.com/hossainemruz/toha#project-roadmap
-->
### Describe the solution you'd like
<!--
Provide a clear and concise description of what you want to happen.
-->
### Describe alternatives you've considered
<!--
Let us know about other solutions you've tried or researched.
-->
### Additional context
<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->

9
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View file

@ -0,0 +1,9 @@
---
name: Question
about: Ask a general question.
---
<!--- Use this template for general questions. For bug reports or feature requests, please use those templates -->
### Question
<!--- Insert your question here. Please provide as much detail as possible. -->

10
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,10 @@
### Issue
<!--- Insert a link to the associated github issue here. -->
### Description
<!-- Insert details about what the changes being proposed are. -->
### Test Evidence
<!-- Provide screenshot evidence and/or testing steps to validate the proposed changes. -->

View file

@ -98,9 +98,9 @@ params:
# transparent navbar and the main logo will be used in the non-transparent navbar.
# It will be default to the theme logos if not provided.
logo:
main: assets/images/main-logo.png
inverted: assets/images/inverted-logo.png
favicon: assets/images/favicon.png
main: /assets/images/main-logo.png
inverted: /assets/images/inverted-logo.png
favicon: /assets/images/favicon.png
# GitHub repo URL of your site
gitRepo: https://github.com/hossainemruz/toha-example-site
@ -233,17 +233,44 @@ Here, are the current plan and progress of various components of this theme. The
## Contributing
You can contribute to this theme in various way. You can report a bug, file an feature request, send a PR, share your thoughts etc.
You can contribute to this theme in various ways. You can report a [bug](https://github.com/hossainemruz/toha/issues/new?template=bug.md), file an [feature request](https://github.com/hossainemruz/toha/issues/new?template=feature_request.md), send a PR, [share your thoughts](https://github.com/hossainemruz/toha/issues/new?template=question.md) etc.
Pull requests are most welcomed and I will be happy to review. Just follow the following principles:
Pull requests are most welcome and I will be happy to review. Just follow the following principles:
- Keep it simple.
- Keep it consistent with the design.
- Use as little dependency as possible.
- Have patient.
- Use as few dependencies as possible.
- Have patience.
>I am not a web developer. I just created this theme for my personal needs. So, it is reasonable to have some flaws in the codes. Feel free to open issues and PR acknowledging the problems.
## Local Development
For local development, you can run your own site or the [example site](https://github.com/hossainemruz/toha-example-site) locally and make changes in the theme submodule.
### Fork
Fork [this repo](https://github.com/hossainemruz/toha) and setup your local submodule with the following from the site's folder by running the following
```sh
git submodule update --init --recursive --remote
cd themes/toha
git remote add my-fork https://github.com/<your-github-user>/toha
git checkout -b my-feature-branch
```
From there you can make changes to the source code of the theme while testing with your running Hugo site.
### Open a PR
When the changes look good, commit and push them to your fork
```sh
git add .
git commit -m "A meaningful commit message"
git push my-fork my-feature-branch
```
And then open a PR `https://github.com/<your-github-user></your-github-user>/toha/pull/new/my-feature-branch`
## Attribution
- Thanks [Anup Deb](https://dribbble.com/anupdeb) for his design guidance.

View file

@ -15,7 +15,7 @@ languages:
bn:
languageName: বাংলা
weight: 3
de:
de:
languageName: Deutsch
weight: 4
id:
@ -54,9 +54,9 @@ params:
# transparent navbar and the main logo will be used in the non-transparent navbar.
# It will be default to the theme logos if not provided.
logo:
main: assets/images/main-logo.png
inverted: assets/images/inverted-logo.png
favicon: assets/images/favicon.png
main: /assets/images/main-logo.png
inverted: /assets/images/inverted-logo.png
favicon: /assets/images/favicon.png
# GitHub repo URL of your site
gitRepo: https://github.com/hossainemruz/toha-example-site

View file

@ -1,15 +1,15 @@
{{ define "header" }}
<link rel="stylesheet" href="/assets/css/404.css">
<link rel="stylesheet" href="{{ "/assets/css/404.css" | relURL }}">
{{ end }}
{{ define "navbar" }}
{{ partial "navigators/navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }}
{{ partial "navigators/navbar-2.html" (dict "baseURL" site.BaseURL "title" site.Title "hasToggleButton" false) }}
{{ end }}
{{ define "content" }}
<div class="container">
<div class="notFound">
<img src="/assets/images/404.png" alt="">
<img src="{{ "/assets/images/404.png" | relURL }}" alt="">
<div class="message">
<h1>404</h1>
<h4>The page you are looking for is not there yet.</h4>

View file

@ -9,7 +9,7 @@
{{ block "header" . }} {{ end }}
<!-- ADD GOOGLE ANALYTICS IF ENABLED -->
{{ if .Site.GoogleAnalytics }}
{{ if site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
</head>

View file

@ -1,6 +1,6 @@
{{ define "header" }}
<link rel="stylesheet" href="/assets/css/layouts/list.css">
<link rel="stylesheet" href="/assets/css/navigators/sidebar.css">
<link rel="stylesheet" href="{{ "/assets/css/layouts/list.css" | relURL }}">
<link rel="stylesheet" href="{{ "/assets/css/navigators/sidebar.css" | relURL}}">
{{ end }}
{{ define "navbar" }}
@ -21,7 +21,7 @@
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}/posts" data-filter="all">Posts</a></li>
<div class="subtree">
{{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }}
{{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
</div>
</ul>
</div>
@ -47,5 +47,5 @@
{{ end }}
{{ define "scripts" }}
<script src="/assets/js/list.js"></script>
<script src="{{ "/assets/js/list.js" | relURL }}"></script>
{{ end }}

View file

@ -4,8 +4,8 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
/>
<link rel="stylesheet" href="/assets/css/layouts/single.css" />
<link rel="stylesheet" href="/assets/css/navigators/sidebar.css">
<link rel="stylesheet" href="{{ "/assets/css/layouts/single.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/navigators/sidebar.css" | relURL }}">
{{ end }}
{{ define "navbar" }}
@ -21,7 +21,7 @@
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}posts" data-filter="all">Posts</a></li>
<div class="subtree">
{{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }}
{{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
</div>
</ul>
</div>
@ -35,13 +35,13 @@
<div class="content">
<div class="container p-0 read-area">
<!--Hero Area-->
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" .Site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'>
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" site.BaseURL }}{{ partial "helpers/get-hero.html" . | relURL }});'>
</div>
<!--Content Start-->
<div class="page-content">
<div class="author-profile ml-auto align-self-lg-center">
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}'/>
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . | relURL }}'/>
<h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
<p>{{ .Page.Date.Format "January 2, 2006" }}</p>
</div>
@ -55,9 +55,9 @@
</div>
<!--- Improve this page button --->
{{ if .Site.Params.GitRepo }}
{{ if site.Params.GitRepo }}
<div class="btn-improve-page">
<a href="{{ .Site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}">
<a href="{{ site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}">
<i class="fas fa-code-branch"></i>
Improve This Page
</a>
@ -69,7 +69,7 @@
{{ partial "navigators/next-prev-navigator.html" . }}
<hr />
<!-- Add Disqus forum -->
{{ if .Site.DisqusShortname }}
{{ if site.DisqusShortname }}
{{ partial "disqus.html" . }}
{{ end }}
</div>
@ -97,7 +97,7 @@
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="/assets/js/single.js"></script>
<script src="{{ "/assets/js/single.js" | relURL }}"></script>
<script>
hljs.initHighlightingOnLoad();
</script>

View file

@ -2,21 +2,29 @@
<html lang="en">
<head>
<title>{{- .Site.Title -}}</title>
<meta name="description" content="{{ .Site.Params.description }}" />
{{ $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 }}
<meta name="description" content="{{ $siteDescription }}" />
<!-- import common headers -->
{{- partial "header.html" . -}}
<!-- import index page specific headers -->
<link rel="stylesheet" href="/assets/css/sections/home.css" />
<link rel="stylesheet" href="/assets/css/sections/about.css" />
<link rel="stylesheet" href="/assets/css/sections/skills.css" />
<link rel="stylesheet" href="/assets/css/sections/experiences.css" />
<link rel="stylesheet" href="/assets/css/sections/projects.css" />
<link rel="stylesheet" href="/assets/css/sections/recent-posts.css" />
<link rel="stylesheet" href="/assets/css/sections/achievements.css" />
<link rel="stylesheet" href="{{ "/assets/css/sections/home.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/about.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/skills.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/experiences.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/projects.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/recent-posts.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/achievements.css" | relURL }}"/>
<!-- Add Google Analytics if enabled in configuration -->
{{ if .Site.GoogleAnalytics }}
{{ if site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
</head>
@ -29,9 +37,9 @@
{{- partial "sections/home.html" . -}}
<!--- ADD OPTIONAL SECTIONS ----------->
{{ $sections:= .Site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ if $sections }}
@ -62,9 +70,9 @@
{{ partial "scripts.html" . }}
<!--- ADD INDEX PAGE SPECIFIC SCRIPTS -->
<script src="/assets/js/itype.min.js"></script>
<script src="/assets/js/github-button.js"></script>
<script src="/assets/js/home.js"></script>
<script src="/assets/js/jquery.filterizr.min.js"></script>
<script src="{{ "/assets/js/itype.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/github-button.js" | relURL }}"></script>
<script src="{{ "/assets/js/home.js" | relURL }}"></script>
<script src="{{ "/assets/js/jquery.filterizr.min.js" | relURL }}"></script>
</body>
</html>

View file

@ -8,7 +8,7 @@
<div>
<div class="d-flex">
{{ if .logo }}
<img class="card-img-xs" src="{{ .logo | absURL }}" alt="{{ .name }}" />
<img class="card-img-xs" src="{{ .logo | relURL }}" alt="{{ .name }}" />
{{ end }}
<h5 class="card-title mb-0">{{ .name }}</h5>
</div>

View file

@ -3,7 +3,7 @@
<div class="card">
<div class="card-head d-flex">
{{ if .icon }}
<img class="card-img-xs" src="{{ .icon | absURL }}" alt="{{ .name }}" />
<img class="card-img-xs" src="{{ .icon | relURL }}" alt="{{ .name }}" />
{{ end }}
<h5 class="card-title">{{ .name }}</h5>
</div>

View file

@ -8,7 +8,7 @@
var dsq = document.createElement("script");
dsq.type = "text/javascript";
dsq.async = true;
var disqus_shortname = "{{ .Site.DisqusShortname }}";
var disqus_shortname = "{{ site.DisqusShortname }}";
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
(
document.getElementsByTagName("head")[0] ||

View file

@ -1,16 +1,16 @@
{{ $author:= .Site.Data.author }}
{{ if (index .Site.Data .Site.Language.Lang).author }}
{{ $author = (index .Site.Data .Site.Language.Lang).author }}
{{ $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 }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ $copyrightNotice := "© 2020 Copyright."}}
{{ if (index .Site.Data .Site.Language.Lang).site }}
{{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }}
{{ if (index site.Data site.Language.Lang).site }}
{{ $siteConfig := (index site.Data site.Language.Lang).site }}
{{ if $siteConfig.copyright }}
{{ $copyrightNotice = $siteConfig.copyright }}
{{ end }}
@ -48,7 +48,7 @@
</ul>
</div>
{{ end }}
{{ if .Site.Params.newsletter.enable }}
{{ if site.Params.newsletter.enable }}
<div class="col-md-4 col-sm-12">
<!-- <h5>Newsletter</h5> -->
<p>{{ i18n "newsletter_text" }}</p>
@ -76,7 +76,7 @@
<div class="row text-left">
<div class="col-md-4">
<a id="theme" href="https://github.com/hossainemruz/toha" target="#">
<img src="/assets/images/inverted-logo.png">
<img src="{{ "/assets/images/inverted-logo.png" | relURL }}">
Toha
</a>
</div>
@ -84,7 +84,7 @@
<div class="col-md-4 text-right">
<a id="hugo" href="https://gohugo.io/">{{ i18n "hugoAttributionText" }}
<img
src="/assets/images/hugo-logo-wide.svg"
src="{{ "/assets/images/hugo-logo-wide.svg" | relURL }}"
alt="Hugo Logo"
height="18"
/>

View file

@ -3,17 +3,17 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- ============ import common css ========== -->
<link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="/assets/css/layouts/main.css" />
<link rel="stylesheet" href="/assets/css/style.css" />
<link rel="stylesheet" href="/assets/css/navigators/navbar.css" />
<link rel="stylesheet" href="{{ "/assets/css/bootstrap.min.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/layouts/main.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/navigators/navbar.css" | relURL }}"/>
<!--=================== cdn ==============================-->
<link href="https://fonts.googleapis.com/css2?family=Muli:wght@300;400;500;600" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
<!--================= fab-icon =========================-->
<link rel="icon" type="image/png" href="{{ .Site.Params.logo.favicon | default "/assets/images/favicon.png" | absURL }}" />
<link rel="icon" type="image/png" href="{{ site.Params.logo.favicon | default "/assets/images/favicon.png" | relURL }}" />
<!--================= custom style overrides =========================-->
<link rel="stylesheet" href="/assets/css/style.css" />
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/>

View file

@ -1,7 +1,12 @@
{{ $authorImage:= "/assets/images/default-avatar.png"}}
{{ if .Site.Data.site.author}}
{{ $authorImage = .Site.Data.site.author.image | relURL }}
{{ end}}
{{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
{{ $authorImage:= "/assets/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .image }}

View file

@ -1,6 +1,6 @@
{{ $authorName:= .Site.Params.author.name }}
{{ if .Site.Data.site.author}}
{{ $authorName = .Site.Data.site.author.name }}
{{ $authorName:= site.Params.author.name }}
{{ if site.Data.site.author}}
{{ $authorName = site.Data.site.author.name }}
{{ end}}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}

View file

@ -1,12 +1,12 @@
{{ $pageURL:= .RelPermalink }}
{{ if .Site.IsMultiLingual }}
{{ if site.IsMultiLingual }}
{{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }}
{{ end }}
<div class="dropdown languageSelector">
<a class="btn dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }}
{{ site.Language.LanguageName }}
</a>
<div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range .Translations }}

View file

@ -1,12 +1,12 @@
{{ $pageURL:= .RelPermalink }}
{{ if .Site.IsMultiLingual }}
{{ if site.IsMultiLingual }}
{{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }}
{{ end }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }}
{{ site.Language.LanguageName }}
</a>
<div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range .Translations }}

View file

@ -1,10 +1,10 @@
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }}
{{ site.Language.LanguageName }}
</a>
<div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range $.Site.Home.AllTranslations }}
{{ range site.Home.AllTranslations }}
<a class="dropdown-item nav-link languages-item" href="{{ .Permalink }}">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/24.png">
{{ .Language.LanguageName }}

View file

@ -1,5 +1,5 @@
{{ $mainLogo:="assets/images/main-logo.png" }}
{{ $invertedLogo:="assets/images/inverted-logo.png" }}
{{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{ if site.Params.logo.main }}
{{ $mainLogo = site.Params.logo.main }}
{{ end }}
@ -13,7 +13,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $mainLogo | absURL }}">
<img src="{{ $mainLogo | relURL }}">
{{- site.Title -}}
</a>
<button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()">
@ -29,6 +29,6 @@
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | absURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | absURL }}" class="d-none" id="inverted-logo">
<img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
</nav>

View file

@ -1,22 +1,22 @@
{{ $mainLogo:="assets/images/main-logo.png" }}
{{ $invertedLogo:="assets/images/inverted-logo.png" }}
{{ if .Site.Params.logo.main }}
{{ $mainLogo = .Site.Params.logo.main }}
{{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{ if site.Params.logo.main }}
{{ $mainLogo = site.Params.logo.main }}
{{ end }}
{{ if .Site.Params.logo.inverted }}
{{ $invertedLogo = .Site.Params.logo.inverted }}
{{ if site.Params.logo.inverted }}
{{ $invertedLogo = site.Params.logo.inverted }}
{{ end }}
{{ $sections:= .Site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
<nav class="navbar navbar-expand-xl top-navbar initial-navbar" id="top-navbar">
<div class="container">
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
<img src="{{ $invertedLogo | absURL }}" id="logo">
{{- .Site.Title -}}
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $invertedLogo | relURL }}" id="logo">
{{- site.Title -}}
</a>
<button
class="navbar-toggler navbar-dark"
@ -31,7 +31,16 @@
<div class="collapse navbar-collapse" id="top-nav-items">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#home">{{ i18n "home" }}</a>
<a
class="nav-link"
href="#home"
data-toggle="collapse"
data-target=".navbar-collapse"
aria-controls="collapseExample"
role="button"
>
{{ i18n "home" }}
</a>
</li>
{{ if $sections }}
{{ range sort $sections "section.weight" }}
@ -41,7 +50,15 @@
{{ $sectionID = .section.id }}
{{ end }}
<li class="nav-item">
<a class="nav-link" href="#{{ $sectionID }}">{{ .section.name }}</a>
<a
class="nav-link"
href="#{{ $sectionID }}"
data-toggle="collapse"
data-target=".navbar-collapse"
aria-controls="collapseExample"
>
{{ .section.name }}
</a>
</li>
{{ end }}
{{- end }}
@ -60,7 +77,7 @@
<a class="nav-link" id="blog-link" href="{{ "/posts" | relLangURL }}">{{ i18n "posts" }}</a>
</li>
{{ end }}
{{ range (index .Site.Data .Site.Language.Lang).site.customMenus }}
{{ range (index site.Data site.Language.Lang).site.customMenus }}
<li class="nav-item">
<a class="nav-link" href="{{ .url }}">{{ .name }}</a>
</li>
@ -72,6 +89,6 @@
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | absURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | absURL }}" class="d-none" id="inverted-logo">
<img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
</nav>

View file

@ -1,6 +1,6 @@
<script src="/assets/js/jquery-3.4.1.min.js"></script>
<script src="/assets/js/popper.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="{{ "/assets/js/jquery-3.4.1.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/popper.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/bootstrap.min.js" | relURL }}"></script>
<script src="/assets/js/navbar.js"></script>
<script src="/assets/js/main.js"></script>
<script src="{{ "/assets/js/navbar.js" | relURL }}"></script>
<script src="{{ "/assets/js/main.js" | relURL }}"></script>

View file

@ -38,7 +38,7 @@
</ul>
</div>
{{ if .resume }}
<a href="{{ .resume | absURL }}" target="#"
<a href="{{ .resume | relURL }}" target="#"
><button class="btn btn-dark">{{ i18n "resume"}}</button></a
>
{{ end }}

View file

@ -1,6 +1,6 @@
<div
class="achievement-entry text-center"
style="background-image: url({{ .image | absURL }});"
style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ .image | relURL }}');"
>
<i class="fas fa-search-plus" id="enlarge-icon"></i>
<h4 class="title" id="achievement-title">{{ .title }}</h4>

View file

@ -1,6 +1,6 @@
{{ $author:= .Site.Data.author }}
{{ if (index .Site.Data .Site.Language.Lang).author }}
{{ $author = (index .Site.Data .Site.Language.Lang).author }}
{{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
{{ $name:="Jane Doe" }}
@ -10,17 +10,17 @@
{{ $name = $author.name }}
{{ end }}
{{ $sections:= .Site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ $backgroundImage:= "assets/images/default-background.jpg" }}
{{ if .Site.Params.background }}
{{ $backgroundImage = .Site.Params.background }}
{{ $backgroundImage:= "/assets/images/default-background.jpg" }}
{{ if site.Params.background }}
{{ $backgroundImage = site.Params.background }}
{{ end }}
{{ $authorImage:= "assets/images/default-avatar.png" }}
{{ $authorImage:= "/assets/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
@ -28,10 +28,10 @@
<div class="container-fluid home" id="home">
<div
class="background container-fluid"
style="background-image: url('{{ $backgroundImage | absURL }}');"
style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ $backgroundImage | relURL }}');"
></div>
<div class="container content text-center">
<img src="{{ $authorImage | absURL }}"
<img src="{{ $authorImage | relURL }}"
class="rounded-circle mx-auto d-block img-fluid"
/>
<h1 class="greeting"> {{ $author.greeting }} {{ $name }}</h1>

12
package-lock.json generated
View file

@ -149,9 +149,9 @@
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001150",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001150.tgz",
"integrity": "sha512-kiNKvihW0m36UhAFnl7bOAv0i1K1f6wpfVtTF5O5O82XzgtBnb05V0XeV3oZ968vfg2sRNChsHw8ASH2hDfoYQ==",
"version": "1.0.30001151",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz",
"integrity": "sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==",
"dev": true
},
"chalk": {
@ -258,9 +258,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.582",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.582.tgz",
"integrity": "sha512-0nCJ7cSqnkMC+kUuPs0YgklFHraWGl/xHqtZWWtOeVtyi+YqkoAOMGuZQad43DscXCQI/yizcTa3u6B5r+BLww==",
"version": "1.3.583",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.583.tgz",
"integrity": "sha512-L9BwLwJohjZW9mQESI79HRzhicPk1DFgM+8hOCfGgGCFEcA3Otpv7QK6SGtYoZvfQfE3wKLh0Hd5ptqUFv3gvQ==",
"dev": true
},
"emoji-regex": {