Skip to content

Commit

Permalink
added archive
Browse files Browse the repository at this point in the history
  • Loading branch information
aishikrehman committed Mar 22, 2024
1 parent cc5846b commit 5a12e54
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 38 deletions.
8 changes: 8 additions & 0 deletions content/bn/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "পোস্টস আর্কাইভ"
layout: archive
_build:
list: never
type: posts
summary: This page contains an archive of all posts.
---
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions content/en/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Posts Archive"
layout: archive
hidden: true
type: posts
summary: This page contains an archive of all posts.
---
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions layouts/_default/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ define "main" }}
<section class="container py-5">
{{ $type := .Type }}
{{ $.Scratch.Set "count" 1 }}

{{ range (.Site.RegularPages.GroupByDate "2006") }}
{{ if and (gt .Key 1) (gt (where .Pages "Type" $type) 0) }}

{{ range (where .Pages "Type" $type) }}
{{ if (eq ($.Scratch.Get "count") 1) }}
{{ $.Scratch.Set "count" 0 }}
<h3>{{ .Date.Format "2006" }}</h3>
{{ end }}
{{ end }}

{{ $.Scratch.Set "count" 1 }}

<ul class="list mb-5">
{{ range (where .Pages "Type" $type) }}
{{ if (ne .Params.hidden true) }}
<li>
<a href="{{ .RelPermalink }}">
<span>{{ .Date.Format "02 Jan" }}</span> — {{ .Title }}
</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ end }}
</section>
{{ end }}
10 changes: 8 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<!DOCTYPE html>
<html lang="{{ .Language.LanguageCode }}">

<head>
{{ partial "metadata.html" . }}
<link rel="canonical" href="{{ .Permalink }}">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/common.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
{{- block "style" . }}{{ end -}}
{{- block "script" . }}{{ end }}
{{ block "style" . }}{{ end }}
{{ block "script" . }}{{ end }}
{{/* {{- template "_internal/google_analytics.html" . }} */}}
</head>

<body>
{{ partial "header.html" . }}
<main class="page-wrapper {{.Kind}}" id="{{ path.Base .Permalink}}" aria-label="Content">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
</body>

</html>
37 changes: 17 additions & 20 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ define "main" }}
<div class="page-title-overlap bg-accent py-md-5" itemscope itemtype="https://schema.org/Article">
<div class="container py-5">
<div class="py-md-5 d-flex flex-wrap justify-content-center justify-content-lg-between align-items-center">
<div class="text-center text-lg-start">
<div class="py-md-5 row">
<div class="col-12 col-md-7 text-center text-md-start">
<div class="mb-2 d-none d-lg-block">{{ partial "meta.breadcrumb.html" . }}</div>
<h3 class="text-light" itemprop="headline">{{ .Title }}</h3>
<div class="text-light" itemprop="author" itemscope itemtype="https://schema.org/Person">
Expand All @@ -14,17 +14,19 @@ <h3 class="text-light" itemprop="headline">{{ .Title }}</h3>
</div>
</div>

<div class="d-flex mt-5 mt-lg-0">
<div class="text-sm-end me-5">
<div class="text-light fs-base">{{i18n "timetoread"}}</div>
<span class="text-light">{{ .ReadingTime }} {{i18n "mintues"}}</span>
</div>
{{ with .Params.date }}
<div class="text-sm-end me-5">
<div class="text-light fs-base">{{i18n "pubon"}}</div>
<span class="text-light">{{ . | dateFormat "January 02, 2006" }} </span>
<div class="col-12 col-md-5 mt-5 mt-md-0">
<div class="d-flex justify-content-center justify-content-lg-between align-items-center text-light">
<div class="text-center text-sm-end">
<div>{{i18n "timetoread"}}</div>
<span>{{ .ReadingTime }} {{i18n "mintues"}}</span>
</div>
{{ with .Params.date }}
<div class="text-sm-end">
<div>{{i18n "pubon"}}</div>
<span>{{ . | dateFormat "January 02, 2006" }} </span>
</div>
{{ end }}
</div>
{{ end }}
</div>
</div>
</div>
Expand All @@ -39,7 +41,8 @@ <h3 class="text-light" itemprop="headline">{{ .Title }}</h3>
<div class="mt-3 me-3">
{{ if isset .Params "tags" }}
<div class="fs-sm text-muted pe-2 mb-2">
{{ range .Params.tags }}<a class="btn-tag me-2 mb-2" href='{{absLangURL "/tags/"}}{{ . | urlize }}'>#{{ .}}</a>
{{ range .Params.tags }}<a class="btn-tag me-2 mb-2"
href='{{absLangURL "/tags/"}}{{ . | urlize }}'>#{{ .}}</a>
{{ end }}
</div>
{{ end }}
Expand All @@ -48,13 +51,7 @@ <h3 class="text-light" itemprop="headline">{{ .Title }}</h3>
{{ partial "sharethis.html" . }}
</div>
</div>
<nav class="entry-navigation" aria-label="Post navigation">
{{ if .Prev }}<a class="entry-navigation-link" href="{{ .Prev.Permalink }}">« {{i18n
"prevpost"}}<span class="d-none"> {{.Prev.Title}}</span></a>{{ end }}
<a class="entry-navigation-link" href='{{absLangURL "/posts/"}}'>{{i18n "allposts"}}</a>
{{ if .Next }}<a class="entry-navigation-link" href="{{ .Next.Permalink }}">{{i18n "nextpost"}}
»<span class="d-none"> {{.Next.Title}}</span></a>{{ end }}
</nav>
{{ partial "posts.navigation.html" . }}
</div>
</div>
</div>
Expand Down
25 changes: 16 additions & 9 deletions layouts/page/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@

{{ define "script" }}
<script>
(function(opts_){
(function(opts_){/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
'use strict';var f=this||self;function g(a){return a};var h;function k(a,b){this.h=a===l&&b||"";this.g=m}function n(a){return a instanceof k&&a.constructor===k&&a.g===m?a.h:"type_error:Const"}var m={},l={};function p(a,b){this.h=b===q?a:""}p.prototype.toString=function(){return this.h+""};function r(a){return a instanceof p&&a.constructor===p?a.h:"type_error:TrustedResourceUrl"}
function u(a,b){var c=n(a);if(!v.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);a=c.replace(w,function(d,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, "'+e+'", in format string, "'+c+'", but no valid label mapping found in args: '+JSON.stringify(b));d=b[e];return d instanceof k?n(d):encodeURIComponent(String(d))});return x(a)}var w=/%{(\w+)}/g,v=RegExp("^((https:)?//[0-9a-z.:[\\]-]+/|/[^/\\\\]|[^:/\\\\%]+/|[^:/\\\\%]*[?#]|about:blank#)","i"),y=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/;
function z(a){var b=A;a=u(B,a);a=y.exec(r(a).toString());var c=a[3]||"";return x(a[1]+C("?",a[2]||"",b)+C("#",c))}var q={};function x(a){if(void 0===h){var b=null;var c=f.trustedTypes;if(c&&c.createPolicy){try{b=c.createPolicy("goog#html",{createHTML:g,createScript:g,createScriptURL:g})}catch(d){f.console&&f.console.error(d.message)}h=b}else h=b}a=(b=h)?b.createScriptURL(a):a;return new p(a,q)}
function C(a,b,c){if(null==c)return b;if("string"===typeof c)return c?a+encodeURIComponent(c):"";for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=c[d];e=Array.isArray(e)?e:[e];for(var t=0;t<e.length;t++){var D=e[t];null!=D&&(b||(b=a),b+=(b.length>a.length?"&":"")+encodeURIComponent(d)+"="+encodeURIComponent(String(D)))}}return b};function E(a,b){this.g=b===F?a:""}E.prototype.toString=function(){return this.g.toString()};var F={};

function C(a,b,c){if(null==c)return b;if("string"===typeof c)return c?a+encodeURIComponent(c):"";for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var e=c[d];e=Array.isArray(e)?e:[e];for(var t=0;t<e.length;t++){var D=e[t];null!=D&&(b||(b=a),b+=(b.length>a.length?"&":"")+encodeURIComponent(d)+"="+encodeURIComponent(String(D)))}}return b};function E(a,b){this.g=b===F?a:""}E.prototype.toString=function(){return this.g.toString()};var F={};/*
SPDX-License-Identifier: Apache-2.0
*/
var G;try{new URL("s://g"),G=!0}catch(a){G=!1}var H=G;var I="alternate author bookmark canonical cite help icon license next prefetch dns-prefetch prerender preconnect preload prev search subresource".split(" ");var J=new k(l,"https://www.google.com/cse/static/style/look/%{versionDir}%{versionSlash}%{theme}.css"),K=new k(l,"https://www.google.com/cse/static/element/%{versionDir}%{versionSlash}default%{experiment}+%{lang}.css"),B=new k(l,"https://www.google.com/cse/static/element/%{versionDir}%{versionSlash}cse_element__%{lang}.js"),L=new k(l,"/");window.__gcse=window.__gcse||{};window.__gcse.ct=Date.now();
window.__gcse.scb=function(){var a=window.__gcse;M()||delete opts_.rawCss;var b=N(a.initializationCallback||a.callback);google.search.cse.element.init(opts_)&&("explicit"!==a.parsetags?"complete"===document.readyState||"interactive"===document.readyState?(google.search.cse.element.go(),null==b||b()):google.setOnLoadCallback(function(){google.search.cse.element.go();null==b||b()},!0):null==b||b())};
function N(a){if("function"===typeof a)return a;if("string"!==typeof a)return null;a=window[a];return"function"!==typeof a?null:a}function M(){var a;return!(null==(a=window.__gcse)?0:a.plainStyle)}
Expand All @@ -31,7 +37,7 @@
"enableImageSearch": true,
"imageSearchLayout": "popup",
"resultSetSize": "filtered_cse",
"enableOrderBy": false,
"enableOrderBy": true,
"orderByOptions": [{
"label": '{{i18n "relevance"}}',
"key": ""
Expand Down Expand Up @@ -65,19 +71,20 @@
"enableHistory": false,
"numTopRefinements": -1,
"enableRichSnippets": false,
"hideElementBranding": true,
"hideElementBranding": false,
"cssThemeVersion": 4,
"isSafeSearchActive": false,
"autoCompleteSource": "partner-generic",
"numTopAds": 0
"numTopAds": 3
},
"protocol": "https",
"cse_token": "AB-tC_4pyN6sBO48WYXiLQ4Plikd:1710867311592",
"isHostedPage": true,
"rawCss": ".gsc-control-cse{font-family:arial, sans-serif}.gsc-control-cse .gsc-table-result{font-family:arial, sans-serif}.gsc-refinementsGradient{background:linear-gradient(to left,rgba(255,255,255,1),rgba(255,255,255,0))}",
"cse_token": "AB-tC_68F0NcriD6fRgjL8EBq3S-:1711144305213",
"isHostedPage": false,
"exp": ["cc"],
"cselibVersion": "8435450f13508ca1",
"usqp": "CAI\u003d",
"fexp": [72519161, 72519164]
"fexp": [72519171, 72519168]
});
</script>
<script>
Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/posts.navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<nav class="entry-navigation" aria-label="Post navigation">
{{ if .Prev }}<a class="entry-navigation-link" href="{{ .Prev.Permalink }}">« {{i18n
"prevpost"}}<span class="d-none"> {{.Prev.Title}}</span></a>{{ end }}
<a class="entry-navigation-link" href='{{absLangURL "/posts/"}}'>{{i18n "allposts"}}</a>
{{ if .Next }}<a class="entry-navigation-link" href="{{ .Next.Permalink }}">{{i18n "nextpost"}}
»<span class="d-none"> {{.Next.Title}}</span></a>{{ end }}
</nav>
7 changes: 0 additions & 7 deletions layouts/partials/section.html

This file was deleted.

0 comments on commit 5a12e54

Please sign in to comment.