1
0
Эх сурвалжийг харах

Add avatar option and footer text option (#41)

* Add avatar option and footer text option

* add responsive avatar for narrow screen

* improvement of code

* conflicts solved
rdhox 7 жил өмнө
parent
commit
c7cae007a6

+ 4 - 0
README.md

@@ -40,6 +40,9 @@ disqusShortname = "yourdiscussshortname" # Enable or disable Disqus
     info = "Full Stack DevOps and Magician" # Author's job title or info.
     description = "John Doe's personal website" # Site description.
     keywords = "blog,developer,personal" # Site keywords.
+    avatarurl = "images/avatar.jpg" # Contain the path of the optionnal avatar in the static folder.
+
+    footercontent = "Enter a text here." # Add footer content
 
     # Whether you want to hide copyright and credits in the footer.
     hideCredits = false
@@ -132,6 +135,7 @@ Coder is licensed under the [MIT license](https://github.com/luizdepra/hugo-code
 - [Vlad Ionescu](https://github.com/Vlaaaaaaad)
 - [Niels Reijn](https://github.com/reijnn)
 - [Harry Khanna](https://github.com/hkhanna)
+- [rdhox](https://rdhox.io)
 - [Chip Senkbeil](https://github.com/chipsenkbeil)
 
 ## Special Thanks

+ 3 - 0
exampleSite/config.toml

@@ -19,10 +19,13 @@ disqusShortname = "yourdiscussshortname"
     description = "John Doe's personal website"
     keywords = "blog,developer,personal"
     info = "Full Stack DevOps and Magician"
+    avatarurl = "images/avatar.jpg"
+    footercontent = "Enter a text here."
 
     hideCredits = false
     hideCopyright = false
 
+
     # Custom CSS
     custom_css = []
 

+ 3 - 0
layouts/partials/footer.html

@@ -1,5 +1,8 @@
 <footer class="footer">
   <section class="container">
+    {{ with .Site.Params.footercontent }}
+      <p>{{.}}</p>
+    {{ end }}
     {{ if not .Site.Params.hideCopyright }} © {{ .Site.LastChange.Format "2006" }} {{ end }} {{ if not .Site.Params.hideCredits}} {{ if not .Site.Params.hideCopyright }} · {{ end }} Powered by <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>. {{ end }}
   </section>
 </footer>

+ 3 - 0
layouts/partials/home.html

@@ -1,5 +1,8 @@
 <section class="container centered">
   <div class="about">
+    {{ with .Site.Params.avatarurl }}
+      <div class="avatar"><img src="{{.}}" alt="avatar"></div>
+    {{ end }}
     <h1>{{ .Site.Params.author }}</h1>
     <h2>{{ .Site.Params.info }}</h2>
     {{ with .Site.Params.social }}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
static/css/style.min.css


BIN
static/images/avatar.jpg


+ 11 - 2
static/less/style.less

@@ -234,6 +234,15 @@ img {
   }
 }
 
+.avatar img{
+  width: 20rem;
+  height: auto;
+  border-radius: 50%;
+  @media only screen and (max-device-width : 768px) {
+    width: 10rem;
+  }
+}
+
 .list {
   ul {
     margin: 3.2rem 0 3.2rem 0;
@@ -344,10 +353,10 @@ img {
 }
 
 .footer {
-  height: 6.0rem;
   width: 100%;
   text-align: center;
-  line-height: 6.0rem;
+  line-height: 2.0rem;
+  margin-bottom:1.0rem;
 }
 
 .float-right {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно