1
0
Fork 0
Browse Source

new structure for extensions.

main
Gökmen Görgen 5 months ago
parent
commit
504a94b3b3
  1. 13
      README.md
  2. 18
      layouts/_default/baseof.html
  3. 33
      layouts/_default/terms.html
  4. 32
      layouts/blog/section.html
  5. 127
      layouts/blog/single.html
  6. 14
      layouts/partials/footer.html
  7. 13
      layouts/partials/footer_extra.html
  8. 35
      layouts/partials/head.html
  9. 21
      layouts/partials/head_extra.html
  10. 5
      layouts/partials/script_bootstrap.html
  11. 11
      layouts/partials/script_highlight.html
  12. 9
      layouts/partials/script_latex.html
  13. 10
      layouts/partials/script_progressively.html
  14. 6
      layouts/partials/style_bootstrap.html
  15. 12
      layouts/partials/style_highlight.html
  16. 13
      layouts/partials/style_main.html
  17. 4
      layouts/partials/style_progressively.html
  18. 4
      static/css/highlight.css

13
README.md

@ -30,7 +30,7 @@ of the theme._
- Twitter
- Homepage with latest and best posts.
- Single pages, sections with a header and a list of articles
- Syntax highlighting with `hightlightjs`
- Syntax highlighting with `highlightjs`
- Progressive images
- Twitter cards support
- LaTeX support with MathJax
@ -43,14 +43,14 @@ of the theme._
## DEPENDENCY VERSIONS
- bootstrap: 5.0.1
- highlightjs: 11.0.1
- bootstrap: 5.1.3
- highlightjs: 11.4.0
- mathjax: ^3.0.0
- progressively: 1.2.5
- progressively: latest stable version
## TYPOGRAPHY
You can customize the fonts copying and editing `head_extra.html`
You can customize the fonts copying and editing `style_main.html`
file. The defaults are:
- Title: Merriweather Sans
@ -73,6 +73,9 @@ file. The defaults are:
- `icon_back.html` has been renamed `icon_prev.html`.
- `header_extra.html` has been renamed `head_extra.html`.
- HEAD tags have been moved to `head.html`.
- All script lines have been moved to `footer_extra.html`.
- `highlight.css` has been removed and a new partial template
`style_highlight.html` has been created.
### V2.0.0: NEW MARKDOWN PARSERS

18
layouts/_default/baseof.html

@ -1,9 +1,19 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{- partial "head.html" . -}}
{{- partial "head" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">{{- block "main" . }}{{- end }}</div>
{{- partial "footer.html" . -}}
{{- partial "header" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer" . -}}
{{- partial "footer_extra" . -}}
{{- template "_internal/google_analytics_async.html" . -}}
</body>
</html>

33
layouts/_default/terms.html

@ -1,33 +0,0 @@
{{ define "main" }}
{{ partial "header" . }}
<div class="content">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<div class="markdown">
<h1 class="mx-0 mx-md-4">
{{ if eq .Title "Tags" }}
{{ i18n "title_tags" . }}
{{ else }}
{{ .Title }}
{{ end }}
</h1>
<p class="h4">
{{ $data := .Data }}
{{ range $key, $value := .Data.Terms.Alphabetical }}
<a href="{{ $value.Name | urlize }}" class="badge badge-light text-monospace">
{{ $value.Name }}
<span class="badge badge-secondary">{{ $value.WeightedPages.Count }}</span>
</a>
{{ end }}
</p>
</div>
</div>
</div>
</div>
</div>
{{ partial "footer" . }}
{{ end }}

32
layouts/blog/section.html

@ -1,32 +0,0 @@
{{ define "main" }}
{{ partial "header" . }}
<div class="content">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<div class="markdown">
{{ partial "content" . }}
</div>
<div class="mx-0 mx-md-4 posts">
<h1>{{ i18n "blog_posts" }}</h1>
<ul class="mb-5 list-unstyled">
{{ range (.Paginate (.Pages.GroupByDate "Jan, 2006" "desc")).PageGroups }}
<li class="groupby">{{ .Key }}</li>
{{ range sort .Pages "Date" "desc" }}
{{ partial "list" . }}
{{ end }}
{{ end }}
</ul>
{{ template "_internal/pagination.html" . }}
</div>
</div>
</div>
</div>
</div>
{{ partial "footer" . }}
{{ end }}

127
layouts/blog/single.html

@ -1,127 +0,0 @@
{{ define "main" }}
{{ $isTocEnabled := or (.Params.toc) (and (.Site.Params.toc) (or (not (isset .Params "toc")) (.Params.toc))) }}
{{ .Scratch.Set "isTocEnabled" $isTocEnabled }}
{{ partial "header" . }}
<div class="content">
<div class="container">
<div class="row justify-content-center">
<div
{{ if $isTocEnabled }}
class="col-md-9 col-lg-9"
{{ else }}
class="col-md-12 col-lg-10"
{{ end }}
>
<h1 class="mx-0 mx-md-4">
{{ .Title }}
</h1>
<div class="mb-4 mb-md-5 meta">
<span class="date" title='{{ .Date.Format "Mon Jan 2 2006 15:04:05 MST" }}'>
{{ .Date.Format "January 02, 2006" }}
</span>
{{ if not .Params.noauthor }}
{{ if .Params.author }}
<span class="author middot" title="{{ .Params.Author }}">
{{ .Params.author }}
</span>
{{ end }}
{{ end }}
<span class="reading-time middot">
{{ i18n "reading_time" .ReadingTime }}
</span>
<div class="d-none d-md-inline tags">
<ul class="list-unstyled d-inline">
{{ range .Params.tags }}
<li class="d-inline middot">
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
</li>
{{ end }}
</ul>
</div>
<div class="d-none d-md-inline tags">
<ul class="list-unstyled d-inline">
{{ if isset .Params "hacker_news_id" }}
{{ if ne .Params.hacker_news_id "" }}
<li class="d-inline middot">
<a href="https://news.ycombinator.com/item?id={{ .Params.hacker_news_id }}">Hacker News</a>
</li>
{{ end }}
{{ end }}
{{ if isset .Params "lobsters_id" }}
{{ if ne .Params.lobsters_id "" }}
<li class="d-inline middot">
<a href="https://lobste.rs/s/{{ .Params.lobsters_id }}">Lobsters</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
</div>
<div class="markdown">
{{ partial "content" . }}
</div>
</div>
{{ if $isTocEnabled }}
<div class="col-sm-12 col-md-3">
{{ replace .TableOfContents "id=\"TableOfContents\"" "id=\"TableOfContents\" class=\"sticky-top\"" | safeHTML }}
</div>
{{ end }}
</div>
<div class="row{{ if not $isTocEnabled }} justify-content-center{{ end }}">
<div
{{ if $isTocEnabled }}
class="col-md-9 col-lg-9"
{{ else }}
class="col-md-12 col-lg-10"
{{ end }}
>
{{ if .Site.Params.posts_navigation }}
<div class="navigation">
<div class="row">
<div class="col-12 col-md-6">
{{ if .PrevInSection }}
<div class="mx-0 mx-md-4 mt-4 text-start">
<a href="{{ .PrevInSection.Permalink }}">
{{ partial "icon_back" . }}
<span class="text">{{ .PrevInSection.Title }}</span>
</a>
</div>
{{ end }}
</div>
<div class="col-12 col-md-6">
{{ if .NextInSection }}
<div class="mx-0 mx-md-4 mt-4 text-end">
<a href="{{ .NextInSection.Permalink }}">
<span class="text">{{ .NextInSection.Title }}</span>
{{ partial "icon_next" . }}
</a>
</div>
{{ end }}
</div>
</div>
</div>
{{ end }}
{{ if .Site.DisqusShortname }}
<div class="mt-5 mx-0 mx-md-4 disqus">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
</div>
</div>
</div>
</div>
{{ partial "footer" . }}
{{ end }}

14
layouts/partials/footer.html

@ -6,7 +6,7 @@
{{ range .Site.Menus.footer.ByWeight }}
<div>
<a
class="mx-1 mr-md-2 ml-md-0 {{ if .Identifier }}
class="mx-1 mr-md-2 ml-md-0{{ if .Identifier }}
text-{{ .Identifier }}
{{ end }}"
href="{{ .URL }}"
@ -19,13 +19,13 @@
{{ if .Site.Params.copyright }}
{{ if .Site.Params.copyrightUrl }}
<a href="{{ .Site.Params.copyrightUrl }}"
>{{ .Site.Params.copyright }}</a
>
<a href="{{ .Site.Params.copyrightUrl }}">
{{ .Site.Params.copyright }}
</a>
{{ else }}
<a href="{{ .Site.BaseURL }}license"
>{{ .Site.Params.copyright }}</a
>
<a href="{{ .Site.BaseURL }}license">
{{ .Site.Params.copyright }}
</a>
{{ end }}
{{ end }}
</div>

13
layouts/partials/footer_extra.html

@ -0,0 +1,13 @@
{{- partial "script_bootstrap" . -}}
{{ if .Site.Params.highlightjs }}
{{- partial "script_highlight" . -}}
{{ end }}
{{ if .Site.Params.progressively }}
{{- partial "script_progressively" . -}}
{{ end }}
{{ if .Site.Params.uselatex }}
{{- partial "script_latex" . -}}
{{ end }}

35
layouts/partials/head.html

@ -58,38 +58,13 @@
<link rel="canonical" href="{{ .Permalink }}" />
<link
href="//cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/main.css" />
{{ if .Site.Params.highlightjs }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/highlight.css" />
{{ end }}
{{ if .Site.Params.progressively }}
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/progressively@1.2.5/dist/progressively.min.css"
integrity="sha256-xbqLYBMsjpuCihs+3Fgp/MFMtPdo2SWKoOjEWOqR4X0="
crossorigin="anonymous"
/>
{{ if .Site.Params.faviconfile }}
<link rel="shortcut icon" href="{{ .Site.Params.faviconfile | absURL }}" />
{{ else }}
<link rel="shortcut icon" href="{{ .Site.BaseURL }}img/favicon.ico" />
{{ end }}
<link
rel="shortcut icon"
href="{{ if .Site.Params.faviconfile }}
{{ .Site.Params.faviconfile | absURL }}
{{ else }}
{{ .Site.BaseURL }}img/favicon.ico
{{ end }}"
/>
<link
href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}"
rel="alternate"
@ -97,5 +72,5 @@
title="{{ .Site.Title }}"
/>
{{ partial "head_extra" . }}
{{- partial "head_extra" . -}}
</head>

21
layouts/partials/head_extra.html

@ -1,12 +1,11 @@
<link
href="//fonts.googleapis.com/css?family=Fira+Code|Merriweather+Sans:400,700|Merriweather:400,700&display=swap"
rel="stylesheet"
/>
{{- partial "style_bootstrap" . -}}
<style>
:root {
--font-code: "Fira Code", monospace;
--font-content: "Merriweather", serif;
--font-title: "Merriweather Sans", sans-serif;
}
</style>
{{- partial "style_main" . -}}
{{ if .Site.Params.highlightjs }}
{{- partial "style_highlight" . -}}
{{ end }}
{{ if .Site.Params.progressively }}
{{- partial "style_progressively" . -}}
{{ end }}

5
layouts/partials/script_bootstrap.html

@ -0,0 +1,5 @@
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>

11
layouts/partials/script_highlight.html

@ -0,0 +1,11 @@
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script>
{{ range .Site.Params.highlightjslanguages }}
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/{{.}}.min.js" defer></script>
{{ end }}
<script>
window.addEventListener('load', function() {
hljs.highlightAll();
}, true);
</script>

9
layouts/partials/script_latex.html

@ -0,0 +1,9 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script
id="MathJax-script"
async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
></script>

10
layouts/partials/script_progressively.html

@ -0,0 +1,10 @@
<script src="https://cdn.jsdelivr.net/npm/progressively/dist/progressively.min.js"></script>
<script>
window.addEventListener(
"load",
function () {
progressively.init({ delay: 30, throttle: 50 });
},
true
);
</script>

6
layouts/partials/style_bootstrap.html

@ -0,0 +1,6 @@
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>

12
layouts/partials/style_highlight.html

@ -0,0 +1,12 @@
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/styles/github.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/styles/tomorrow-night-bright.min.css"
/>
<style>
screen and (prefers-color-scheme: dark);
</style>

13
layouts/partials/style_main.html

@ -0,0 +1,13 @@
<link
rel="stylesheet"
href="//fonts.googleapis.com/css?family=Fira+Code|Merriweather+Sans:400,700|Merriweather:400,700&display=swap"
/>
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/main.css" />
<style>
:root {
--font-code: "Fira Code", monospace;
--font-content: "Merriweather", serif;
--font-title: "Merriweather Sans", sans-serif;
}
</style>

4
layouts/partials/style_progressively.html

@ -0,0 +1,4 @@
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/progressively/dist/progressively.min.css"
/>

4
static/css/highlight.css

@ -1,3 +1,3 @@
@import "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.0.1/build/styles/github.min.css";
@import "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.0.1/build/styles/tomorrow-night-bright.min.css"
@import "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/styles/github.min.css";
@import "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/styles/tomorrow-night-bright.min.css"
screen and (prefers-color-scheme: dark);

Loading…
Cancel
Save