Compare commits

...

8 Commits

Author SHA1 Message Date
~m de66539e8b
Merge 477633a62a into 0989c28a0e 2023-12-16 18:28:12 +01:00
Aditya Telange 0989c28a0e
Allow aligning social-icons in homeInfo mode
In Site config
    homeInfoParams:
        AlignSocialIconsTo: "center" # or left or right
2023-12-16 21:40:14 +05:30
Aditya Telange fb1c0aeb6f
social icons refactor Params.socialIcons 2023-12-16 21:38:24 +05:30
Aditya Telange 69e5e085ab
improved profile mode spacing 2023-12-16 20:59:36 +05:30
Aditya Telange f8e125c7ee
Add padding to social-icons for better tap sizing 2023-12-16 20:59:08 +05:30
~m 477633a62a
Merge branch 'adityatelange:master' into master 2023-12-12 20:41:19 +07:00
~m 0ea466b5b7 add in-article type ad 2023-12-05 00:30:09 +07:00
~m cfb5c01418 add adsense option 2023-12-03 22:18:59 +07:00
17 changed files with 73 additions and 14 deletions

View File

@ -27,12 +27,10 @@
margin-inline-start: auto;
}
.social-icons {
padding: 12px 0;
}
.social-icons a:not(:last-of-type) {
margin-inline-end: 12px;
.social-icons a {
display: inline-flex;
padding: 10px;
}
.social-icons a svg {

View File

@ -10,19 +10,20 @@
text-align: center;
}
.profile .profile_inner h1 {
padding: 12px 0;
.profile .profile_inner {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.profile img {
display: inline-table;
border-radius: 50%;
}
.buttons {
flex-wrap: wrap;
max-width: 400px;
margin: 0 auto;
}
.button {

View File

@ -68,6 +68,7 @@
</div>
{{- end }}
</div>
{{- partial "adsense-infeed.html" $ -}}
{{- end }}
{{- end }}

View File

@ -39,6 +39,7 @@
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
{{ partial "adsense-inarticle.html" $ }}
</div>
{{- end }}
@ -60,6 +61,7 @@
{{- if (.Param "comments") }}
{{- partial "comments.html" . }}
{{- end }}
{{ partial "adsense-multiplex.html" $ }}
</article>
{{- end }}{{/* end main */}}

View File

@ -0,0 +1,10 @@
<!-- ad-display -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="{{- .Site.Params.adsense.clientID -}}"
data-ad-slot="{{- .Site.Params.adsense.slotDisplay -}}"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

View File

@ -0,0 +1,10 @@
<!-- ad-in-article -->
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="{{- .Site.Params.adsense.clientID -}}"
data-ad-slot="{{- .Site.Params.adsense.slotInArticle -}}"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

View File

@ -0,0 +1,16 @@
<!-- ad-in-feed -->
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-gw-3+1f-3d+2z"
data-ad-client="{{- .Site.Params.adsense.clientID -}}"
data-ad-slot="{{- .Site.Params.adsense.slotInFeed -}}"></ins>
<!-- <ins class="adsbygoogle imgtheme-dark"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-gw-3+1f-3d+2z"
data-ad-client="{{- .Site.Params.adsense.clientID -}}"
data-ad-slot="{{- .Site.Params.adsense.slotInFeedDark -}}"></ins> -->
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

View File

@ -0,0 +1,9 @@
<!-- ad-multiplex -->
<ins class="adsbygoogle"
style="display:block"
data-ad-format="autorelaxed"
data-ad-client="{{- .Site.Params.adsense.clientID -}}"
data-ad-slot="{{- .Site.Params.adsense.slotMultiplex -}}"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

View File

@ -167,4 +167,5 @@
{{- template "partials/templates/opengraph.html" . }}
{{- template "partials/templates/twitter_cards.html" . }}
{{- template "partials/templates/schema_json.html" . }}
{{- template "partials/templates/adsense.html" . }}
{{- end -}}

View File

@ -7,7 +7,7 @@
{{ .Content | markdownify }}
</div>
<footer class="entry-footer">
{{ partial "social_icons.html" site.Params.socialIcons }}
{{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }}
</footer>
</article>
{{- end -}}

View File

@ -32,7 +32,7 @@
{{- end }}
<h1>{{ .title | default site.Title | markdownify }}</h1>
<span>{{ .subtitle | markdownify }}</span>
{{- partial "social_icons.html" site.Params.socialIcons -}}
{{- partial "social_icons.html" -}}
{{- with .buttons }}
<div class="buttons">

View File

@ -1,6 +1,7 @@
<div class="social-icons">
{{- range . }}
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}">
<div class="social-icons" {{ with .align}}align="{{.}}" {{- end }}>
{{- range site.Params.socialIcons }}
<a href="{{ trim .url " " | safeURL }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}">
{{ partial "svg.html" . }}
</a>
{{- end }}

View File

@ -0,0 +1,6 @@
{{ $adsenseEnabled := (and .Site.Params "adsense" (ne .Params.disableAdsense true) ) }}
{{ $adsenseAllowedOnPage := (ne .Kind "404" )}}
{{- if (and $adsenseEnabled $adsenseAllowedOnPage) }}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client={{- .Site.Params.adsense.clientID -}}" crossorigin="anonymous"></script>
{{- end }}

View File

@ -0,0 +1 @@
{{ partial "adsense-inarticle.html" $ }}

View File

@ -0,0 +1 @@
{{ partial "adsense-display.html" $ }}

View File

@ -0,0 +1 @@
{{ partial "adsense-infeed.html" $ }}

View File

@ -0,0 +1 @@
{{ partial "adsense-multiplex.html" $ }}